Esempio n. 1
0
        public OutputUpdateW(WeighingBill bill)
        {
            InitializeComponent();

            mWeighingBill = bill;
            if (mWeighingBill == null)
            {
                isInsert = true;
            }
        }
 private void InFactoryRB_Checked(object sender, RoutedEventArgs e)
 {
     if (this.IsLoaded)
     {
         mSendWeighingBill = null;
         mWeighingBill     = null;
         isInsert          = true;
         BuildCurrWeighingBill();
     }
 }
 public PrintBillW(WeightingBillType type, WeighingBill bill, bool autoPrint = false)
 {
     InitializeComponent();
     mType         = type;
     mWeighingBill = bill;
     isAutoPrint   = autoPrint;
     if (autoPrint == true)
     {
         this.Visibility = Visibility.Hidden;
     }
 }
Esempio n. 4
0
 private void FinishListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (this.FinishListView.SelectedIndex < 0)
     {
         return;
     }
     CurrentWeighingBillIsSendBill = false;
     mWeighingBill = this.FinishListView.SelectedItem as WeighingBill;
     ShowCurrentPanel();
     this.FinishGrid.DataContext = mWeighingBill;
 }
 public InputBuluW()
 {
     InitializeComponent();
     mWeighingBill = new WeighingBill()
     {
         id                  = Guid.NewGuid().ToString(),
         type                = (int)WeightingBillType.RK,
         receiveNumber       = CommonFunction.GetWeighingNumber(WeightingBillType.RK, true, "BL"),
         affiliatedCompanyId = App.currentCompany.id,
         receiveStatus       = 1
     };
 }
 private void RefreshCurrBillData()
 {
     if (mSendCarBilll != null)
     {
         this.SendBillInFactoryBtn.Visibility = Visibility.Collapsed;
     }
     else if (mWeighingBill != null)
     {
         mWeighingBill = WeighingBillModel.GetById(mWeighingBill.id);
         this.NoFinishGrid.DataContext = mWeighingBill;
     }
 }
 private void SelectSendBillInFactory(WeighingBill bill)
 {
     if (bill == null)
     {
         this.InFactoryRB.IsChecked = true;
     }
     else
     {
         mSendWeighingBill = bill;
         BuildCurrWeighingBill();
     }
 }
Esempio n. 8
0
 private void SendBollListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (this.SendBillListView.SelectedIndex < 0)
     {
         return;
     }
     CurrentWeighingBillIsSendBill = true;
     mWeighingBill = null;
     mWeighingBill = this.SendBillListView.SelectedItem as WeighingBill;
     this.SendBillGrid.DataContext = mWeighingBill;
     ShowCurrentPanel();
 }
 public OutputBuLuW()
 {
     InitializeComponent();
     mWeighingBill = new WeighingBill()
     {
         id                  = Guid.NewGuid().ToString(),
         type                = (int)WeightingBillType.CK,
         sendNumber          = CommonFunction.GetWeighingNumber(WeightingBillType.CK, true, "BL"),
         affiliatedCompanyId = App.currentCompany.id,
         sendStatus          = 1,
     };
 }
 private void OutFactoryRb_Checked(object sender, RoutedEventArgs e)
 {
     if (IsLoaded)
     {
         isInsert = false;
         //如果点击了车辆出场,就要将传过来的发货单置空
         mSendWeighingBill = null;
         new CarOutFactoryW(WeightingBillType.RK)
         {
             SelectAction = new Action <WeighingBill>(this.SelectCarOutFactory)
         }.ShowDialog();
     }
 }
 private void DeleteNofinishedBtn_Click(object sender, RoutedEventArgs e)
 {
     if (WeighingBillModel.Delete(mWeighingBill) == 1)
     {
         MessageBox.Show("删除成功!");
         this.mWeighingBill = null;
         ShowCurrentPanel();
         RefreshRightData();
     }
     else
     {
         MessageBox.Show("删除失败!");
     }
 }
 public InputWindow(WeighingBill bill = null, bool isSend = false)
 {
     InitializeComponent();
     if (isSend == true)
     {
         mSendWeighingBill = bill;
     }
     else
     {
         mWeighingBill = bill;
         if (mWeighingBill != null)
         {
             isInsert     = false;
             isOutFactory = true;
             this.OutFactoryRb.IsChecked = true;
         }
     }
 }
 /// <summary>
 /// 更新发货单
 /// </summary>
 private void UpdateSendBill()
 {
     if (mSendWeighingBill != null)
     {
         try
         {
             String condition = @WeighingBillEnum.id.ToString() + " = " + Constract.valueSplit + mWeighingBill.relativeBillId + Constract.valueSplit +
                                " and " + WeighingBillEnum.type.ToString() + "=" + ((int)WeightingBillType.CK);
             String set = WeighingBillEnum.relative_bill_id.ToString() + "=" + Constract.valueSplit + mWeighingBill.id + Constract.valueSplit;
             string sql = DatabaseOPtionHelper.GetInstance().getUpdateSql(DataTabeName.weighing_bill.ToString(), set, condition);
             DatabaseOPtionHelper.GetInstance().update(sql);
         }
         catch (Exception e)
         {
             ConsoleHelper.writeLine("Update Send Bill failure:" + e.Message);
         }
     }
     else if (mWeighingBill.relativeBillId != null)
     {
         String where = WeighingBillEnum.id.ToString() + "=" + Constract.valueSplit + mWeighingBill.relativeBillId + Constract.valueSplit;
         String sql = DatabaseOPtionHelper.GetInstance().getSelectSql(DataTabeName.weighing_bill.ToString(), null, where);
         List <WeighingBill> list = DatabaseOPtionHelper.GetInstance().select <WeighingBill>(sql);
         WeighingBill        wb   = null;
         if (list.Count > 0)
         {
             wb = list[0];
         }
         else
         {
             return;
         }
         CommonFunction.MargeToSend(ref wb, mWeighingBill);
         try
         {
             DatabaseOPtionHelper.GetInstance().update(wb);
         }
         catch (Exception e)
         {
             ConsoleHelper.writeLine("UpdateSendBill failure:" + e.Message);
         }
     }
 }
 public static void MargeToSend(ref WeighingBill send, WeighingBill receiver)
 {
     send.relativeBillId       = receiver.id;
     send.receiveUserId        = receiver.sendUserId;
     send.receiveUserName      = receiver.sendUserName;
     send.receiveInTime        = receiver.sendInTime;
     send.receiveOutTime       = receiver.sendOutTime;
     send.receiveMaterialId    = receiver.sendMaterialId;
     send.receiveMaterialName  = receiver.sendMaterialName;
     send.receiveNumber        = receiver.sendNumber;
     send.receiveRemark        = receiver.sendRemark;
     send.receiveCompanyId     = receiver.sendCompanyId;
     send.receiveCompanyName   = receiver.sendCompanyName;
     send.receiveGrossWeight   = receiver.sendGrossWeight;
     send.receiveTraeWeight    = receiver.sendTraeWeight;
     send.receiveNetWeight     = receiver.sendNetWeight;
     send.decuationWeight      = receiver.decuationWeight;
     send.decuationDescription = receiver.decuationDescription;
     send.differenceWeight     = receiver.differenceWeight;
 }
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="weighing"></param>
        /// <param name="istrue">是否真的删除</param>
        /// <returns></returns>
        public static int Delete(WeighingBill weighing, bool istrue = false)
        {
            int res = 0;

            if (weighing == null)
            {
                return(0);
            }
            if (istrue == true)
            {
                res = DatabaseOPtionHelper.GetInstance().delete(weighing, true);
            }
            else
            {
                weighing.isDelete   = 1;
                weighing.deleteTime = MyHelper.DateTimeHelper.getCurrentDateTime();
                res = DatabaseOPtionHelper.GetInstance().update(weighing);
            }
            return(res);
        }
 /// <summary>
 /// 将派车单的信息同步到当前的磅单
 /// </summary>
 /// <param name="send">派车单</param>
 /// <param name="weighingBill">磅单</param>
 public static void SendCardMargeToWeighing(SendCarBill send, ref WeighingBill weighingBill)
 {
     weighingBill.sendCarBillId      = send.id;
     weighingBill.sendCarBillNumber  = send.number;
     weighingBill.sendCarUser        = send.userName;
     weighingBill.sendCompanyId      = send.sendCompanyId;
     weighingBill.sendCompanyName    = send.sendCompanyName;
     weighingBill.sendYardId         = send.sendYardId;
     weighingBill.sendYardName       = send.sendYardName;
     weighingBill.receiveCompanyId   = send.receiveCompanyId;
     weighingBill.receiveCompanyName = send.receiveCompanyName;
     weighingBill.receiveYardId      = send.receiveYardId;
     weighingBill.receiveYardName    = send.receiveYardName;
     weighingBill.sendMaterialId     = send.materialId;
     weighingBill.sendMaterialName   = send.materialName;
     weighingBill.carId         = send.carId;
     weighingBill.plateNumber   = send.plateNumber;
     weighingBill.driver        = send.driver;
     weighingBill.driverMobile  = send.driverMobile;
     weighingBill.receiveRemark = weighingBill.receiveRemark + " " + send.remark;
 }
 private void AfterUpdate(WeighingBill bill)
 {
     if (bill == null)
     {
         this.Close();
     }
     else
     {
         mWeighingBill = bill;
         if (InPanel.Visibility == Visibility.Visible)
         {
             this.InGrid.DataContext = null;
             this.InGrid.DataContext = mWeighingBill;
         }
         else
         {
             this.OutGrid.DataContext = null;
             this.OutGrid.DataContext = this.InGrid.DataContext = mWeighingBill;
         }
     }
 }
 public WeihgingBillDetailW(WeighingBill bill)
 {
     InitializeComponent();
     mWeighingBill = bill;
     if (mWeighingBill == null)
     {
         this.Close();
     }
     if (mWeighingBill.type == (int)WeightingBillType.CK)
     {
         mType = WeightingBillType.CK;
     }
     else if (mWeighingBill.type == (int)WeightingBillType.RK)
     {
         mType = WeightingBillType.RK;
     }
     else
     {
         this.Close();
     }
 }
        /// <summary>
        /// 构建当前的磅单
        /// </summary>
        private void BuildCurrWeighingBill()
        {
            if (mWeighingBill == null)
            {
                // in factoty
                isOutFactory           = false;
                currBillNumber         = CommonFunction.GetWeighingNumber(WeightingBillType.RK);
                this.BillNumberTb.Text = currBillNumber;

                mWeighingBill = new WeighingBill()
                {
                    id                  = Guid.NewGuid().ToString(),
                    type                = (int)WeightingBillType.RK,
                    receiveUserId       = App.currentUser.id,
                    receiveUserName     = App.currentUser.name,
                    receiveNumber       = currBillNumber,
                    affiliatedCompanyId = App.currentCompany.id,
                    receiveStatus       = 0,
                };
                #region 恢复控件状态
                this.SupplyCb.Text          = string.Empty;
                this.ReceiverCompanyCb.Text = string.Empty;
                this.CarNumberCb.Text       = string.Empty;
                this.DriverTbox.Text        = string.Empty;
                this.PhoneTbox.Text         = string.Empty;
                this.SendYardCb.Text        = string.Empty;
                this.ReceiverYardCb.Text    = string.Empty;
                this.MaterialNameCb.Text    = string.Empty;

                this.SendGrossWeightTbox.Text = "0.0";
                this.SendTraeWeightTbox.Text  = "0.0";
                this.SendNetWeightTbox.Text   = "0.0";

                this.SendNetWeightTbox.IsEnabled = true;
                this.MaterialNameCb.IsEnabled    = true;
                this.SupplyCb.IsEnabled          = true;
                this.ReceiverCompanyCb.IsEnabled = true;
                this.CarNumberCb.IsEnabled       = true;
                this.SendYardCb.IsEnabled        = true;
                this.ReceiverYardCb.IsEnabled    = true;

                #endregion
                if (mSendWeighingBill != null)
                {
                    //有发货单 最后要将收货信息合并到发货的信息上。
                    CommonFunction.MargeToReciver(ref mWeighingBill, mSendWeighingBill);
                    #region 将发货信息显示到控件上面
                    this.SupplyCb.Text                = mWeighingBill.sendCompanyName;
                    this.SendYardCb.Text              = mWeighingBill.sendYardName;
                    this.CarNumberCb.Text             = mWeighingBill.plateNumber;
                    this.DriverTbox.Text              = mWeighingBill.driver;
                    this.PhoneTbox.Text               = mWeighingBill.driverMobile;
                    this.ReceiverCompanyCb.Text       = mWeighingBill.receiveCompanyName;
                    this.ReceiverYardCb.Text          = mWeighingBill.receiveYardName;
                    this.MaterialNameCb.Text          = mWeighingBill.sendMaterialName;
                    mWeighingBill.receiveMaterialName = mSendWeighingBill.sendMaterialName;
                    mWeighingBill.receiveMaterialId   = mSendWeighingBill.sendMaterialId;
                    this.SendGrossWeightTbox.Text     = mWeighingBill.sendGrossWeight.ToString();
                    this.SendTraeWeightTbox.Text      = mWeighingBill.sendTraeWeight.ToString();
                    this.SendNetWeightTbox.Text       = mWeighingBill.sendNetWeight.ToString();
                    this.SendNetWeightTbox.IsEnabled  = false;
                    this.CarNumberCb.IsEnabled        = false;
                    this.SupplyCb.IsEnabled           = false;
                    this.SendYardCb.IsEnabled         = false;
                    #endregion
                    // 货物名称,收货信息 不一样时
                    if (ConfigurationHelper.GetConfig(ConfigItemName.softwareVersion.ToString()) == SoftwareVersion.netConnection.ToString())
                    {
                        if ("false" == ConfigurationHelper.GetConfig(ConfigItemName.allowDiffrenceMaterialWeighing.ToString()))
                        {
                            isAllowDiffrenceMaterial = false;
                            //mWeighingBill.receiveMaterialId = mSendWeighingBill.sendMaterialId;
                            //mWeighingBill.receiveMaterialName = mSendWeighingBill.sendMaterialName;
                            //this.MaterialNameCb.Text = mSendWeighingBill.sendMaterialName;
                            this.MaterialNameCb.IsEnabled = false;
                        }
                        else
                        {
                            isAllowDiffrenceMaterial      = true;
                            this.MaterialNameCb.IsEnabled = true;
                        }
                        if ("false" == MyHelper.ConfigurationHelper.GetConfig(ConfigItemName.allowDiffrenceCompany.ToString()))
                        {
                            isAllowDiffrenceCompany          = false;
                            this.ReceiverCompanyCb.IsEnabled = false;
                        }
                        else
                        {
                            isAllowDiffrenceCompany          = true;
                            this.ReceiverCompanyCb.IsEnabled = true;
                        }
                        if ("false" == MyHelper.ConfigurationHelper.GetConfig(ConfigItemName.allowDiffrenceReceiveYard.ToString()))
                        {
                            isAllowDiffrenceReceiveYard   = false;
                            this.ReceiverYardCb.IsEnabled = false;
                        }
                        else
                        {
                            isAllowDiffrenceReceiveYard   = true;
                            this.ReceiverYardCb.IsEnabled = true;
                        }
                    }
                }
            }
            else
            {
                //out factoty
                isOutFactory = true;
                mWeighingBill.receiveStatus = 1;
                #region 设置控件状态
                this.BillNumberTb.Text            = mWeighingBill.receiveNumber;
                this.SupplyCb.Text                = mWeighingBill.sendCompanyName;
                this.ReceiverCompanyCb.Text       = mWeighingBill.receiveCompanyName;
                this.CarNumberCb.Text             = mWeighingBill.plateNumber;
                this.DriverTbox.Text              = mWeighingBill.driver;
                this.PhoneTbox.Text               = mWeighingBill.driverMobile;
                this.SendYardCb.Text              = mWeighingBill.sendYardName;
                this.ReceiverYardCb.Text          = mWeighingBill.receiveYardName;
                this.MaterialNameCb.Text          = mWeighingBill.receiveMaterialName;
                this.ReceivedGrossWeightTbox.Text = mWeighingBill.receiveGrossWeight.ToString();
                this.SendGrossWeightTbox.Text     = mWeighingBill.sendGrossWeight.ToString();
                this.SendTraeWeightTbox.Text      = mWeighingBill.sendTraeWeight.ToString();
                this.SendNetWeightTbox.Text       = mWeighingBill.sendNetWeight.ToString();
                this.ReceivedRemardCombox.Text    = mWeighingBill.receiveRemark;
                this.SendNetWeightTbox.IsEnabled  = false;
                //互联版本,出场时是否允许修信息
                if ("false" == ConfigurationHelper.GetConfig(ConfigItemName.outFactoryAllowUpdate.ToString()))
                {
                    this.SendNetWeightTbox.IsEnabled = false;
                    this.SupplyCb.IsEnabled          = false;
                    this.ReceiverCompanyCb.IsEnabled = false;
                    this.CarNumberCb.IsEnabled       = false;
                    this.SendYardCb.IsEnabled        = false;
                    this.ReceiverYardCb.IsEnabled    = false;
                    this.MaterialNameCb.IsEnabled    = false;
                }
                #endregion
            }
        }
Esempio n. 20
0
        /// <summary>
        /// 构建当前的磅单
        /// </summary>
        private void BuildCurrWeighingBill()
        {
            if (mWeighingBill == null)
            {
                // in factoty
                isOutFactory           = false;
                currBillNumber         = CommonFunction.GetWeighingNumber(WeightingBillType.CK);
                this.BillNumberTb.Text = currBillNumber;

                mWeighingBill = new WeighingBill()
                {
                    id                  = Guid.NewGuid().ToString(),
                    type                = (int)WeightingBillType.CK,
                    sendUserId          = App.currentUser.id,
                    sendUserName        = App.currentUser.name,
                    sendNumber          = currBillNumber,
                    affiliatedCompanyId = App.currentCompany.id,
                    sendStatus          = 0,
                };
                #region 恢复控件状态
                this.SupplyCb.Text          = string.Empty;
                this.ReceiverCompanyCb.Text = string.Empty;
                this.CarNumberCb.Text       = string.Empty;
                this.DriverTbox.Text        = string.Empty;
                this.PhoneTbox.Text         = string.Empty;
                this.SendYardCb.Text        = string.Empty;
                this.ReceiverYardCb.Text    = string.Empty;
                this.MaterialNameCb.Text    = string.Empty;

                this.SendGrossWeightTbox.Text = "0";
                this.SendTraeWeightTbox.Text  = "0";
                this.SendNetWeightTbox.Text   = "0";

                this.MaterialNameCb.IsEnabled    = true;
                this.SupplyCb.IsEnabled          = true;
                this.ReceiverCompanyCb.IsEnabled = true;
                this.CarNumberCb.IsEnabled       = true;
                this.SendYardCb.IsEnabled        = true;
                this.ReceiverYardCb.IsEnabled    = true;

                #endregion
                if (mSendCarBill != null)
                {
                    //有派车单
                    CommonFunction.SendCardMargeToWeighing(mSendCarBill, ref mWeighingBill);

                    #region 将派车信息显示到控件上面
                    this.SupplyCb.Text          = mWeighingBill.sendCompanyName;
                    this.SendYardCb.Text        = mWeighingBill.sendYardName;
                    this.CarNumberCb.Text       = mWeighingBill.plateNumber;
                    this.DriverTbox.Text        = mWeighingBill.driver;
                    this.PhoneTbox.Text         = mWeighingBill.driverMobile;
                    this.ReceiverCompanyCb.Text = mWeighingBill.receiveCompanyName;
                    this.ReceiverYardCb.Text    = mWeighingBill.receiveYardName;
                    this.MaterialNameCb.Text    = mWeighingBill.sendMaterialName;
                    this.SendRemardCombox.Text  = mWeighingBill.receiveRemark;

                    this.MaterialNameCb.IsEnabled = false;
                    this.CarNumberCb.IsEnabled    = false;
                    this.SupplyCb.IsEnabled       = false;
                    this.SendYardCb.IsEnabled     = false;
                    #endregion
                }
            }
            else
            {
                //out factoty
                isOutFactory             = true;
                mWeighingBill.sendStatus = 1;
                #region 设置控件状态
                this.BillNumberTb.Text      = mWeighingBill.sendNumber;
                this.SupplyCb.Text          = mWeighingBill.sendCompanyName;
                this.ReceiverCompanyCb.Text = mWeighingBill.receiveCompanyName;
                this.CarNumberCb.Text       = mWeighingBill.plateNumber;
                this.DriverTbox.Text        = mWeighingBill.driver;
                this.PhoneTbox.Text         = mWeighingBill.driverMobile;
                this.SendYardCb.Text        = mWeighingBill.sendYardName;
                this.ReceiverYardCb.Text    = mWeighingBill.receiveYardName;
                this.MaterialNameCb.Text    = mWeighingBill.sendMaterialName;

                this.SendGrossWeightTbox.Text = mWeighingBill.sendGrossWeight.ToString();
                this.SendTraeWeightTbox.Text  = mWeighingBill.sendTraeWeight.ToString();
                this.SendNetWeightTbox.Text   = mWeighingBill.sendNetWeight.ToString();
                this.SendRemardCombox.Text    = mWeighingBill.sendRemark;

                //出场时是否允许修信息
                if ("false" == ConfigurationHelper.GetConfig(ConfigItemName.outFactoryAllowUpdate.ToString()))
                {
                    this.SupplyCb.IsEnabled          = false;
                    this.ReceiverCompanyCb.IsEnabled = false;
                    this.CarNumberCb.IsEnabled       = false;
                    this.SendYardCb.IsEnabled        = false;
                    this.ReceiverYardCb.IsEnabled    = false;
                    this.MaterialNameCb.IsEnabled    = false;
                }
                #endregion
            }
        }
        public InputUpdateW(WeighingBill bill)
        {
            InitializeComponent();

            mWeighingBill = bill;
        }