public static void InsertEntity(T_WMS_ATSCELL_CJ_HIS entity)
 {
     using (Entities dataEntity = new Entities())
     {
         decimal id = 0;
         // DataTable dt = Query("select S_wms_storagearea_inout.nextval from dual", null);
         id = dataEntity.ExecuteStoreQuery <decimal>("select S_wms_atscell_cj_his.nextval from dual").First(); //decimal.Parse(dt.Rows[0][0].ToString());
         //entity = id + "";
         entity.ID         = id;
         entity.CREATETIME = DateTime.Now;
         // entity.STATUS = 10;
         dataEntity.T_WMS_ATSCELL_CJ_HIS.AddObject(entity);
         dataEntity.SaveChanges();
     }
 }
Example #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (cbAdress.SelectedIndex == -1)
            {
                MessageBox.Show("请选择出库口");
                return;
            }
            if (tbChooseName.Tag == null)
            {
                MessageBox.Show("请选择出库品牌");
                return;
            }
            INF_JOBDOWNLOAD job = new INF_JOBDOWNLOAD();

            job.TARGET     = address[cbAdress.SelectedIndex];
            job.SOURCE     = ((List <String>)tbChooseName.Tag)[2].ToString();
            job.BARCODE    = AtsCellInfoService.GetCellInfo(job.SOURCE).PALLETNO;
            job.PLANQTY    = int.Parse(((List <String>)tbChooseName.Tag)[1].ToString());
            job.JOBTYPE    = 50;//搬运任务
            job.PRIORITY   = 50;
            job.CREATEDATE = DateTime.Now;
            job.BRANDID    = ((List <String>)tbChooseName.Tag)[0].ToString();
            job.TUTYPE     = 4;
            job.INPUTTYPE  = 10;
            using (TransactionScope ts = new TransactionScope())
            {
                InfJobDownLoadService.InsertEntity(job);

                T_WMS_ATSCELL_CJ_HIS his = new T_WMS_ATSCELL_CJ_HIS();
                his.CELLNO        = job.SOURCE;
                his.QTY           = job.PLANQTY;
                his.INBOUNDTIME   = AtsCellInfoService.GetCellInfo(his.CELLNO).CREATETIME;
                his.CIGARETTECODE = job.BRANDID;
                his.CIGARETTENAME = ItemService.GetItemByCode(his.CIGARETTECODE).ITEMNAME;
                his.INBOUNDID     = AtsCellInfoService.GetCellInfo(his.CELLNO).INBOUNDID;
                his.BARCODE       = ItemService.GetItemByCode(his.CIGARETTECODE).BIGBOX_BAR;
                AtsCellCJService.InsertEntity(his);
                AtsCellService.UpdateAtsCell(job.SOURCE, 30);//更新cellno状态
                ts.Complete();
            }
            MessageBox.Show("出库完成");
        }