public string GetMAXBLLNO() { string sql = "select BILL_NO from LH_V2 where SCAN_NO=(select max(SCAN_NO) from LH_V2 where HY_NAME=@HY_NAME)"; Hashtable ht = new Hashtable(); ht["HY_NAME"] = _HYNAME; return(comm.GetStringData(sql, ht)); }
private string GetNewNo(DateTime newInputDate, string ieflag) { string sql = "select max(SNo) from InputWork where InputDate=@InputDate and I_E_FLAG=@I_E_FLAG"; // string sql = "select count(1) from InputWork where InputDate=CONVERT(VARCHAR(10),GETDATE(),120)"; Hashtable ht = new Hashtable(); ht["InputDate"] = newInputDate; ht["I_E_FLAG"] = ieflag; string no = comm.GetStringData(sql, ht); if (string.IsNullOrEmpty(no)) { return("001"); } string noPart = no.Substring(no.Length - 3); int newNo = Convert.ToInt32(noPart) + 1; return(newNo.ToString().PadLeft(3, '0')); }