Esempio n. 1
0
        private void 保存ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            modST.Address            = _address.Text.Trim();
            modST.BanKName           = _bank.Text.Trim();
            modST.BankNO             = _bankID.Text.Trim();
            modST.BankUserName       = _bankUser.Text.Trim();
            modST.CompanyName        = _comName.Text.Trim();
            modST.Fax                = _fax.Text.Trim();
            modST.LinkMan            = _linkMan.Text.Trim();
            modST.Mobile             = _Mobile.Text.Trim();
            modST.Phone              = _phone.Text.Trim();
            modST.Sell4Depot         = _ceSell.Checked;
            modST.Direct2Depot       = _ceDirect.Checked;
            modST.AutoClient         = _ceAutoClient.Checked;
            modST.BoxOrPic           = _chBoxOrPic.Checked;
            modST.CustOder           = _ceCustom.Checked;
            modST.NotPermissions     = _chNotPermissions.Checked;
            modST.DepotAllowNegative = _ceDepotAllowNegative.Checked;
            modST.IsChangedSales     = _ceIsChangedSales.Checked;
            modST.Registration       = _tbRegistration.Text.Trim().PadLeft(2, '0');
            if (modST.Registration != string.Empty)
            {
                try
                {
                    int day = Convert.ToInt32(modST.Registration);
                    if (day > 28)
                    {
                        MessageBox.Show("日期填写不正确");
                        return;
                    }
                }
                catch
                {
                    MessageBox.Show("日期填写不正确");
                    return;
                }
            }
            try
            {
                modST.OderOne = Convert.ToInt32(_mbOderOne.Text);
            }
            catch
            {
                modST.OderOne = 9;
            }
            try
            {
                modST.OderTwo = Convert.ToInt32(_mbOderTwo.Text);
            }
            catch
            {
                modST.OderTwo = 15;
            }
            try
            {
                modST.OderThree = Convert.ToInt32(_mbOrderThree.Text);
            }
            catch
            {
                modST.OderThree = 19;
            }
            if (_coBackDepot.SelectedIndex > -1)
            {
                modST.BackDepotWorking = Convert.ToInt32(_coBackDepot.SelectedValue);
            }
            else
            {
                modST.BackDepotWorking = 0;
            }
            if (_coNumType.SelectedIndex > -1)
            {
                modST.NumType = _coNumType.SelectedIndex;
            }
            else
            {
                modST.NumType = 0;
            }
            if (_coSellMoney.SelectedIndex > -1)
            {
                modST.SellMoney = _coSellMoney.SelectedIndex;
            }
            else
            {
                modST.SellMoney = 0;
            }
            modST.AutoCaicBoardWages = _ceAutoCaicBoardWages.Checked;
            if (_coDefaultRaw.SelectedIndex > -1)
            {
                modST.DefaultRawDepot = Convert.ToInt32(_coDefaultRaw.SelectedValue);
            }
            else
            {
                modST.DefaultRawDepot = 0;
            }
            if (_coDefaultDepot.SelectedIndex > -1)
            {
                modST.DefaultDepot = Convert.ToInt32(_coDefaultDepot.SelectedValue);
            }
            else
            {
                modST.DefaultDepot = 0;
            }
            modST.IsShowMoney   = _ceIsShowMoney.Checked;
            modST.CompanyByUser = _ceCompanyByUser.Checked;
            try
            {
                modST.DoubleNotDefaultWTNum = Convert.ToDecimal(_teDoubleNotDefaultWTNum.Text);
            }
            catch
            {
                modST.DoubleNotDefaultWTNum = 0;
            }
            try
            {
                modST.OrderDays = Convert.ToInt32(_meOrderDays.Text);
            }
            catch
            {
                modST.OrderDays = 0;
            }
            modST.OrderNeedEat        = _ceOrderNeedEat.Checked;
            modST.IsCheckNoWork       = _ceIsCheckNoWork.Checked;
            modST.IsCanEditAmount     = _ceIsCanEditAmount.Checked;
            modST.IsAutoClose         = _ceIsAutoClose.Checked;
            modST.IsTicketNotNeedCaic = _ceIsTicketNotNeedCaic.Checked;
            modST.IsShowOutEmp        = _ceIsShowOutEmp.Checked;
            modST.MaterielByTask      = _chMaterielByTask.Checked;
            modST.SumByWorking        = _ceSumByWorking.Checked;
            if (ID > 0)
            {
                bllST.Update(modST);
            }
            else
            {
                modST.ID = ID = bllST.Add(modST);
            }
            DataTable dtTem = bllOT.GetList("(Name='物料使用条码出入仓')").Tables[0];

            dtTem.Rows[0]["Value"] = _chb物料使用条码出入仓.Checked;
            bllOT.UpdateByDt(dtTem);

            dtTem = bllOT.GetList("(Name='成品需按货架存放')").Tables[0];
            dtTem.Rows[0]["Value"] = _chb成品需按货架存放.Checked;
            bllOT.UpdateByDt(dtTem);

            dtTem = bllOT.GetList("(Name='分组显示为部位')").Tables[0];
            dtTem.Rows[0]["Value"] = _chb分组显示为部位.Checked;
            bllOT.UpdateByDt(dtTem);

            dtTem = bllOT.GetList("(Name='备份文件夹位置')").Tables[0];
            dtTem.Rows[0]["Value"] = _teBackUpDir.Text;
            bllOT.UpdateByDt(dtTem);

            MessageBox.Show("保存成功!");
            BaseClass.dsSysTem = bllST.GetList("(ID=" + ID + ")");
            ReaderCard.BasicTable.BackDepotWorkingID = modST.BackDepotWorking;
            ReaderCard.BasicTable.DefaultDepot       = modST.DefaultDepot;
            ReaderCard.BasicTable.IsShowMoney        = modST.IsShowMoney;
            ReaderCard.BasicTable.modST = ReaderCard.BasicTable.bllST.GetModel(ReaderCard.BasicTable.bllST.GetMaxId() - 1);
            FileTransportService fts = new FileTransportService();

            fts.SetDataTable();
            //ReaderCard.BasicTable.AttendanceNID = BaseClass.dsSysTem.Tables[0].Rows[0]["AttendanceNID"].ToString();
            //ReaderCard.BasicTable.NID = ReaderCard.BasicTable.AttendanceNID.Split(',');
        }