Front:
if (consts.str_entupd_flg_ent. Equals (STRENTUPDFLG))
{
datarow[] Drarr = This.dtHaisyaData.Select ("JIGYOUSYO_CD = '" + this.cmbs_jigyousyo_cd. Selectedvalue.tostring ()
+ "' and Uke_date = '" + this.dtps_uke_date. Value.tostring ("Yyyy/mm/dd")
+ "' and Torihikisaki_bio_cd = '" + this.cmbe_torihikisaki_bio_cd. Selectedvalue.tostring () + "'");
if (drarr.count () = = 0)
{
Int_rot_no = 0;
}
Else
{
Int_rot_no = Drarr.max (s = = Convert.ToInt32 (s.field<string> ("Rot_no"));
}
String Szrotno = This.int_rot_no. ToString ("00");//Format conversion
DataRow dr = This.dthaisyadata.rows[this.dthaisyadata.rows.count-1];
"ロットno";
dr["rot_no"] = int_rot_no + 1;
Rot_no_select = (int_rot_no + 1). ToString ();
Front End 2
datarow[] Drarr = This.dtHaisyaData.Select ();
if (drarr.count () = = 0)
{
Int_rot = 0;
}
Else
{
Int_rot = Drarr.max (s = = Convert.ToInt32 (s.field<decimal> ("ROWNUM"));
}
DataRow drnew = This.dtHaisyaData.NewRow ();
drnew["ACTION_FLG"] = consts.str_action_mode_a;
drnew["ROWNUM"] = Int_rot + 1;
Sql:
SELECT Lpad (NVL (MAX (To_number (rot_no) + 1, 1), 2, ' 0 ') as Rot_no
From T_haisya
WHERE uke_date = to_date (@UKE_DATE, ' yyyy/mm/dd ')--date of entry
and JIGYOUSYO_CD = @JIGYOUSYO_CD--コード
and TORIHIKISAKI_BIO_CD = @TORIHIKISAKI_BIO_CD--コード first (バイオマス)
The front end of C # Mining and the writing of SQL