public DataSet QueryByBillNo(string BillNo) { using (PersistentManager persistentManager = new PersistentManager()) { EntryBillMasterDao dao = new EntryBillMasterDao(); string sql = string.Format("select {0} from {1} WHERE BILLNO='{2}'", strQueryFields, strTableView, BillNo); return(dao.GetData(sql)); } }
public DataTable QueryNotNull2() { using (PersistentManager persistentManager = new PersistentManager()) { EntryBillMasterDao dao = new EntryBillMasterDao(); string sql = string.Format(@"select CELLCODE , CELLNAME ,FROZEN_IN_QTY,MAX_QUANTITY-QUANTITY-FROZEN_IN_QTY as ALLOWINQUANTITY ,ASSIGNEDPRODUCT,CURRENTPRODUCT,UNITCODE,ISACTIVE from WMS_WH_CELL where AREATYPE='2' AND MAX_QUANTITY-QUANTITY-FROZEN_IN_QTY>0 AND ISACTIVE='1'order by CELLCODE"); return(dao.GetData(sql).Tables[0]); } }
public string GetNewBillNo() { using (PersistentManager persistentManager = new PersistentManager()) { EntryBillMasterDao dao = new EntryBillMasterDao(); DataSet ds = dao.GetData(string.Format("select TOP 1 BILLNO FROM WMS_IN_BILLMASTER where BILLNO LIKE '{0}%' order by BILLNO DESC", System.DateTime.Now.ToString("yyMMdd"))); if (ds.Tables[0].Rows.Count == 0) { return(System.DateTime.Now.ToString("yyMMdd") + "0001" + "E"); } else { int i = Convert.ToInt32(ds.Tables[0].Rows[0][0].ToString().Substring(6, 4)); i++; string newcode = i.ToString(); for (int j = 0; j < 4 - i.ToString().Length; j++) { newcode = "0" + newcode; } return(System.DateTime.Now.ToString("yyMMdd") + newcode + "E"); } } }