Beispiel #1
0
 /// <summary>
 /// 手动添加单据主表
 /// </summary>
 /// <param name="infoTableName"></param>
 /// <param name="bill"></param>
 /// <param name="type"></param>
 /// <param name="state"></param>
 /// <param name="operate"></param>
 /// <param name="isUpdate"></param>
 public void InsertBillMaster(string infoTableName, string bill, string type, string state, string operate, bool isUpdate)
 {
     using (PersistentManager persistentManager = new PersistentManager())
     {
         UpdateUploadDao dao = new UpdateUploadDao();
         dao.SetPersistentManager(persistentManager);
         if (isUpdate)
         {
             DataTable table  = dao.QueryBusiBill(infoTableName);
             DataRow   newRow = table.NewRow();
             newRow["STORE_BILL_ID"] = bill.ToString().Trim();
             newRow["DIST_CTR_CODE"] = dao.GetCompany().ToString();
             newRow["AREA_TYPE"]     = "0901";
             newRow["CREATOR_CODE"]  = operate;
             newRow["CREATE_DATE"]   = DateTime.Now.ToString("yyyyMMddHHmmss");
             newRow["IN_OUT_TYPE"]   = "1202";
             newRow["BILL_TYPE"]     = type;
             newRow["BILL_STATUS"]   = state;
             newRow["DISUSE_STATUS"] = "0";
             newRow["IS_IMPORT"]     = "0";
             table.Rows.Add(newRow);
             dao.InsertMaster(infoTableName, table);
         }
         else
         {
             string sql = string.Format("UPDATE {0} SET CREATE_DATE='{2}',BILL_TYPE='{3}',BILL_STATUS='{4}' WHERE STORE_BILL_ID='{5}'",
                                        infoTableName, operate, DateTime.Now.ToString("yyyyMMddHHmmss"), type, state, bill);
             dao.UpdateTable(sql);
         }
     }
 }