예제 #1
0
        private void FrmBatchOutBoundOrder_Load(object sender, EventArgs e)
        {
            if (this.Result == null)
            {
                var billNo = serviceClient.GetNewBillNo("FQ");
                txtBatchNo.Text = billNo;
                Result          = new LH_MergeBill();
                Result.FBILLNO  = billNo;
                Result.FCARNO   = txtCarNo.Text;
            }

            txtBatchNo.Text = Result.FBILLNO;
            txtCarNo.Text   = Result.FCARNO;

            SetMCUSelectList();
            SetCarriersSelectList();
        }
예제 #2
0
        public bool SaveMergeBill(LH_MergeBill bill, List <string> LHOBODNOS)
        {
            var conn = DBConnectionFactory.GetConnection(DBTypeEnums.ORACLE);

            conn.Open();
            var tran = conn.BeginTransaction();

            try
            {
                bool result = false;
                LH_MergeBillRepository repository = new LH_MergeBillRepository();
                var lhoutorderRepository          = new DefaultRepository <LH_OUTBOUNDORDER>(DBTypeEnums.ORACLE);

                var sql = "SELECT * FROM MERGEBILL WHERE FBILLNO=:FBILLNO";

                var temp = repository.GetSingle(sql, bill);
                if (temp == null)
                {
                    result = repository.Insert(bill, tran);
                }
                else
                {
                    result = repository.Update(bill, new { FBILLNO = bill.FBILLNO });
                }

                sql = $"UPDATE  LH_OUTBOUNDORDER SET FMEGREBILLNO=:FBILLNO,FCARNO=:CARNO WHERE LHODONO IN :LHODONOS";

                result = lhoutorderRepository.Execute(sql, new { FBILLNO = bill.FBILLNO, LHODONOS = LHOBODNOS, CARNO = bill.FCARNO }, tran) == LHOBODNOS.Count;

                tran.Commit();
                conn.Close();

                return(result);
            }
            catch (Exception e)
            {
                tran.Rollback();
                conn.Close();
                LogHelper.Error(e);
                throw;
            }
        }
 public bool SaveLH_MergeBill(LH_MergeBill bill, List <string> LHOBODNOS)
 {
     return(methods.SaveMergeBill(bill, LHOBODNOS));
 }