Ejemplo n.º 1
0
        public void update(int pkey, MaterielTable materiel)
        {
            string update = "UPDATE [dbo].[BASE_MATERIEL_LIST] SET ";

            //update += "[SUPPLIER_TYPE] = " + materiel.materielType + ",";
            update += "[NAME] = '" + materiel.name + "',";
            update += "[NUM] = '" + materiel.num + "',";
            update += "[NAME_SHORT] = '" + materiel.nameShort + "',";
            update += "[MODEL] = '" + materiel.model + "',";
            update += "[MNEMONIC_CODE] = '" + materiel.mnemonicCode + "',";

            update += "[MAX] = " + materiel.max + ",";
            update += "[MIN] = " + materiel.min + ",";
            update += "[WARRANTY] = " + materiel.warramty + ",";
            update += "[STORAGE] = " + materiel.storage + ",";
            update += "[MATERIEL_ATTRIBUTE] = " + materiel.materielAttribute + ",";
            update += "[UNIT] = " + materiel.unit + ",";
            update += "[UNIT_PURCHASE] = " + materiel.unitPurchase + ",";
            update += "[UNIT_SALE] = " + materiel.unitSale + ",";
            update += "[UNIT_STORAGE] = " + materiel.unitStorage + ",";
            update += "[VALUATION] = " + materiel.valuation + ",";
            update += "[BRAND] = '" + materiel.brand + "',";

            update += "[NOTE] = '" + materiel.note + "'";


            update += " WHERE PKEY = " + Convert.ToString(pkey);

            try
            {
                DatabaseAccessFactoryInstance.Instance.ExecuteCommand(FormMain.DB_NAME, update);

                MessageBoxExtend.messageOK("数据修改成功");

                load();
            }
            catch (Exception error)
            {
                MessageBoxExtend.messageWarning(error.Message);
                return;
            }
        }
Ejemplo n.º 2
0
        public void registerInLedger(string billNumber, bool isRedBill)
        {
            /*函数处理逻辑如下:
             * 1、更新单据是否入账标示,把标示修改为1(已入账)
             * 1、如果采购方式为赊购并且发生了运输费用或其他费用,询问用户是否把运输费用或者其他费用计入应付账款
             * 2、根据采购单详细信息,更新库存表,如果发生了运输费用或其他费用,需要把运输费用和其他费用计入物料单价
             * 3、如果单据是根据采购订单生成,更新对应采购订单中的实际入库数量
             */
            m_isRedBill = isRedBill;

            // 更新应付账款
            updateAccountPayableData(billNumber);

            // 更新库存表
            updateMaterielData(billNumber);

            // 如果本张采购入库单是根据某采购订单生成,需要更新采购订单的实际入库数量字段
            updataActualValue(billNumber);

            // 更新是否入账标示
            string update = "UPDATE [dbo].[PURCHASE_IN_ORDER] SET ";

            update += "[ORDERR_IN_LEDGER] = " + DbPublic.getInctance().getCurrentLoginUserID() + ",";
            update += "IN_LEDGER_DATE = '" + DateTime.Now.ToString("yyyyMMdd") + "', IS_IN_LEDGER = 1";
            update += " WHERE BILL_NUMBER = '" + billNumber + "'";

            try
            {
                DatabaseAccessFactoryInstance.Instance.ExecuteCommand(FormMain.DB_NAME, update);

                MessageBoxExtend.messageOK("单据[" + billNumber + "]入账成功");

                load();
            }
            catch (Exception error)
            {
                MessageBoxExtend.messageWarning(error.Message);
                return;
            }

            writeOperatorLog(102, OperatorLogType.Register, billNumber);
        }
Ejemplo n.º 3
0
        public void insert(MaterielProOccupiedOrderTable record, bool isDisplayMessageBox = true)
        {
            MaterielProOccupiedOrderTable oldRecord = new MaterielProOccupiedOrderTable();

            string insert = "INSERT INTO [dbo].[WAREHOUSE_MANAGEMENT_PRO_OCCUPIED]([TRADING_DATE],[BILL_NUMBER],[EXCHANGES_UNIT],[SUM_VALUE],[SUM_MONEY],";

            insert += "[MAKE_ORDER_STAFF],[APPLY_STAFF]) VALUES(";

            // 根据单据编号,判断库中是否已经存在该单据 如果存在单据首先删除单据,然后再执行插入操作
            if (checkBillIsExist(record.billNumber))
            {
                delete(record.billNumber);
            }

            insert += "'" + record.tradingDate + "',";
            insert += "'" + record.billNumber + "',";
            insert += "'" + record.exchangesUnit + "',";
            insert += "'" + record.sumValue + "',";
            insert += "'" + record.sumMoney + "',";

            insert += record.makeOrderStaff + ",";
            insert += record.applyStaffId + ")";

            try
            {
                DatabaseAccessFactoryInstance.Instance.ExecuteCommand(FormMain.DB_NAME, insert);

                if (isDisplayMessageBox)
                {
                    MessageBoxExtend.messageOK("数据保存成功");
                }

                load();
            }
            catch (Exception error)
            {
                MessageBoxExtend.messageWarning(error.Message);
                return;
            }

            writeOperatorLog(306, OperatorLogType.Add, record.billNumber);
        }
Ejemplo n.º 4
0
        public void insert(SupplierTable supplier)
        {
            string insert = "INSERT INTO [dbo].[BASE_SUPPLIER_LIST] ([SUPPLIER_TYPE],[NAME],[NAME_SHORT],[MNEMONIC_CODE],[AREA],";

            insert += "[CREDIT],[VAT_RATE],[CONTACT],[TEL],[FAX],[MOBILE_PHONE],[E-MAIL],[HOME_PAGE],[COMPANY_ADDRESS],[ZIP_CODE],";
            insert += "[BANK_NAME],[BANK_ACCOUNT],[TAX_ACCOUNT],[NOTE],[IS_FORBID]) VALUES(";

            insert += supplier.supplierType + ",";
            insert += "'" + supplier.name + "',";
            insert += "'" + supplier.nameShort + "',";
            insert += "'" + supplier.mnemonicCode + "',";
            insert += "'" + supplier.area + "',";
            insert += supplier.credit + ",";
            insert += supplier.varRate + ",";
            insert += "'" + supplier.contact + "',";
            insert += "'" + supplier.tel + "',";
            insert += "'" + supplier.fax + "',";
            insert += "'" + supplier.mobilePhone + "',";
            insert += "'" + supplier.email + "',";
            insert += "'" + supplier.homePage + "',";
            insert += "'" + supplier.address + "',";
            insert += "'" + supplier.zipCode + "',";
            insert += "'" + supplier.bankName + "',";
            insert += "'" + supplier.bankAccount + "',";
            insert += "'" + supplier.taxAccount + "',";
            insert += "'" + supplier.note + "', 0";
            insert += ")";

            try
            {
                DatabaseAccessFactoryInstance.Instance.ExecuteCommand(FormMain.DB_NAME, insert);

                MessageBoxExtend.messageOK("数据保存成功");

                load();
            }
            catch (Exception error)
            {
                MessageBoxExtend.messageWarning(error.Message);
                return;
            }
        }
        private void save_Click(object sender, EventArgs e)
        {
            m_isSaveSuccessFul = false;

            if ((sender.ToString() == "保存" || sender.ToString() == "审核") &&
                FormProjectInfoChange.getInctance().checkBillIsReview(this.labelBillNumber.Text.ToString()))
            {
                MessageBoxExtend.messageWarning("单据已被审核,所有数据无法进行更改,无法重复保存或审核\r\n请重新登录或手动刷新后查看单据详情");
                return;
            }

            this.ActiveControl = this.toolStrip1;

            // 得到详细的采购信息
            ArrayList dataList = getOrderDetailsValue();

            if (dataList.Count > 0)
            {
                // 采购订单表头和表尾信息
                geTableHadeAndEndValue();

                if (purchaseOrderIsFull(m_currentOrderInfo) && purchaseOrderDetailsIsFull(dataList))
                {
                    FormProjectInfoChange.getInctance().insert(m_currentOrderInfo, false);
                    ProjectManagerDetails.getInctance().insert(dataList);
                    BillNumber.getInctance().inserBillNumber(BillTypeNumber, this.labelMakeDate.Text, this.labelBillNumber.Text.ToString());

                    if (m_billNumber.Length == 0)
                    {
                        MessageBoxExtend.messageOK("数据保存成功");
                    }

                    m_isSaveSuccessFul = true;

                    this.Close();
                }
            }
            else
            {
                MessageBoxExtend.messageWarning("此单据不包含任何交易信息,单据保存失败.");
            }
        }
Ejemplo n.º 6
0
        public void insert(CustomerTypeTable customerType)
        {
            string insert = "INSERT INTO [dbo].[BASE_CUSTOMER_TYPE] ([TYPE_NAME],[DESC]) VALUES (";

            insert += "'" + customerType.name + "',";
            insert += "'" + customerType.desc + "'";
            insert += ")";

            try
            {
                DatabaseAccessFactoryInstance.Instance.ExecuteCommand(FormMain.DB_NAME, insert);
                MessageBoxExtend.messageOK("数据保存成功");
                load();
            }
            catch (Exception error)
            {
                MessageBoxExtend.messageWarning(error.Message);
                return;
            }
        }
Ejemplo n.º 7
0
        private void buttonEnter_Click(object sender, EventArgs e)
        {
            if (AccessAuthorization.getInctance().passwordIsValidate(this.comboBoxUserName.Text.ToString(),
                                                                     this.textBoxPassword.Text.ToString(), out m_currentLoginUser))
            {
                m_loginSuccessful = true;
                DbPublic.getInctance().setCurrentLoginUserName(m_currentLoginUser.staffName);
                DbPublic.getInctance().setCurrentLoginUserID(m_currentLoginUser.pkey);

                // 更新BASE_SYSTEM_CURRENT_LOGIN_USER表
                CurrentLoginUser.getInctance().insert();
                this.Close();
            }
            else
            {
                MessageBoxExtend.messageWarning("密码错误,请重新输入!");
                this.textBoxPassword.Text = "";
                this.textBoxPassword.Focus();
            }
        }
Ejemplo n.º 8
0
        public void update(string billNumber, int reviewStaffID, double balance)
        {
            string update = "UPDATE [dbo].[CASH_CASHSUB_LEDGER] SET ";

            update += "[ORDERR_EVIEW] = " + reviewStaffID;
            update += ", [BALANCE] = " + balance;
            update += ", [IS_REVIEW] = 1";
            update += " WHERE BILL_NUMBER = '" + billNumber + "'";

            try
            {
                DatabaseAccessFactoryInstance.Instance.ExecuteCommand(FormMain.DB_NAME, update);
                load();
            }
            catch (Exception error)
            {
                MessageBoxExtend.messageWarning(error.Message);
                return;
            }
        }
Ejemplo n.º 9
0
        public void updateInStorageValue(string billNumber, string rowNumber, string actualValue)
        {
            string update = "UPDATE [dbo].[PURCHASE_IN_ORDER_DETAILS] SET ";

            update += "IS_IN_STORAGE = 1, ";
            update += "ACTUAL_VALUE = " + Convert.ToInt32(actualValue.ToString());
            update += " WHERE BILL_NUMBER = '" + billNumber + "' AND ROW_NUMBER = '" + rowNumber + "'";

            try
            {
                DatabaseAccessFactoryInstance.Instance.ExecuteCommand(FormMain.DB_NAME, update);

                load();
            }
            catch (Exception error)
            {
                MessageBoxExtend.messageWarning(error.Message);
                return;
            }
        }
Ejemplo n.º 10
0
        public void insert(SupplierOrgStructTable supplierOrgStruct)
        {
            string insert = "INSERT INTO [dbo].[BASE_SUPPLIER_ORG_STRUCT] ([VALUE],[PARENT_PKEY]) VALUES (";

            insert += "'" + supplierOrgStruct.value + "',";
            insert += Convert.ToString(supplierOrgStruct.parentPkey);
            insert += ")";

            try
            {
                DatabaseAccessFactoryInstance.Instance.ExecuteCommand(FormMain.DB_NAME, insert);
                MessageBoxExtend.messageOK("数据保存成功");
                load();
            }
            catch (Exception error)
            {
                MessageBoxExtend.messageWarning(error.Message);
                return;
            }
        }
Ejemplo n.º 11
0
        private void save_Click(object sender, EventArgs e)
        {
            m_isSaveSuccess = false;

            if ((sender.ToString() == "保存" || sender.ToString() == "审核") &&
                SaleOrder.getInctance().checkBillIsReview(this.labelBillNumber.Text.ToString()))
            {
                MessageBoxExtend.messageWarning("单据已被审核,所有数据无法进行更改,无法重复保存或审核\r\n请重新登录或手动刷新后查看单据详情");
                return;
            }

            this.ActiveControl = this.toolStrip1;

            // 得到详细的销售信息
            ArrayList dataList = getSaleOrderDetailsValue();

            if (dataList.Count > 0)
            {
                // 销售订单表头和表尾信息
                SaleOrderTable record = getSaleOrderValue();
                if (purchaseOrderIsFull(record) && purchaseOrderDetailsIsFull(dataList))
                {
                    SaleOrder.getInctance().insert(record, false);
                    SaleOrderDetails.getInctance().insert(dataList);
                    BillNumber.getInctance().inserBillNumber(BillTypeNumber, this.labelTradingDate.Text, this.labelBillNumber.Text.ToString());

                    m_isSaveSuccess = true;

                    if (m_billNumber.Length == 0)
                    {
                        MessageBoxExtend.messageOK("数据保存成功");
                    }

                    this.Close();
                }
            }
            else
            {
                MessageBoxExtend.messageWarning("此单据不包含任何交易信息,单据保存失败.");
            }
        }
Ejemplo n.º 12
0
        public void insert(MaterielTable materiel)
        {
            string insert = "INSERT INTO [dbo].[BASE_MATERIEL_LIST] ([SUPPLIER_TYPE],[NAME],[NUM],[NAME_SHORT],[MODEL],[MNEMONIC_CODE],[BRAND],";

            insert += "[MAX],[MIN],[WARRANTY],[MATERIEL_ATTRIBUTE],[UNIT],[UNIT_PURCHASE],[UNIT_SALE],[UNIT_STORAGE],";
            insert += "[VALUATION],[NOTE],[STORAGE],[IS_FORBID]) VALUES(";

            insert += materiel.materielType + ",";
            insert += "'" + materiel.name + "',";
            insert += "'" + materiel.num + "',";
            insert += "'" + materiel.nameShort + "',";
            insert += "'" + materiel.model + "',";
            insert += "'" + materiel.mnemonicCode + "',";
            insert += "'" + materiel.brand + "',";
            insert += materiel.max + ",";
            insert += materiel.min + ",";
            insert += materiel.warramty + ",";
            insert += materiel.materielAttribute + ",";
            insert += materiel.unit + ",";
            insert += materiel.unitPurchase + ",";
            insert += materiel.unitSale + ",";
            insert += materiel.unit + ",";
            insert += materiel.valuation + ",";
            insert += "'" + materiel.note + "',";
            insert += materiel.storage + ", 0";
            insert += ")";

            try
            {
                DatabaseAccessFactoryInstance.Instance.ExecuteCommand(FormMain.DB_NAME, insert);

                MessageBoxExtend.messageOK("数据保存成功");

                load();
            }
            catch (Exception error)
            {
                MessageBoxExtend.messageWarning(error.Message);
                return;
            }
        }
        private void toolStripButtonReview_Click(object sender, EventArgs e)
        {
            try
            {
                if (m_billNumber.Length > 0)
                {
                    save_Click(sender, e);

                    if (m_isSaveSuccessFul)
                    {
                        FormProjectInfoChange.getInctance().billReview(this.labelBillNumber.Text);
                        MessageBoxExtend.messageOK("单据审核成功");
                    }

                }
            }
            catch (Exception exp)
            {
                MessageBoxExtend.messageError(exp.ToString());
            }
        }
Ejemplo n.º 14
0
        protected bool deleteRecord(string tableName, int pkey, bool isShowMessage = true)
        {
            string delete = "DELETE FROM [dbo].[" + tableName + "] WHERE PKEY = " + Convert.ToString(pkey);

            try
            {
                DatabaseAccessFactoryInstance.Instance.ExecuteCommand(FormMain.DB_NAME, delete);

                if (isShowMessage)
                {
                    MessageBoxExtend.messageOK("数据删除成功");
                }

                return(true);
            }
            catch (Exception error)
            {
                MessageBoxExtend.messageWarning(error.Message);
                return(false);
            }
        }
Ejemplo n.º 15
0
        public bool modifyMaterielType(int m_materielGroupPkey, int pkey)
        {
            string update = "UPDATE [dbo].[BASE_MATERIEL_LIST] SET [SUPPLIER_TYPE] = ";

            update += Convert.ToString(m_materielGroupPkey);
            update += " WHERE PKEY = " + Convert.ToString(pkey);

            try
            {
                DatabaseAccessFactoryInstance.Instance.ExecuteCommand(FormMain.DB_NAME, update);

                load();
            }
            catch (Exception error)
            {
                MessageBoxExtend.messageWarning(error.Message);
                return(false);
            }

            return(true);
        }
Ejemplo n.º 16
0
 private void FormMain_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (m_isExitQuestion)
     {
         if (MessageBoxExtend.messageQuestion("确定退出系统?"))
         {
             // 更新BASE_SYSTEM_CURRENT_LOGIN_USER表
             CurrentLoginUser.getInctance().delete();
             e.Cancel = false;
         }
         else
         {
             e.Cancel = true;
         }
     }
     else
     {
         // 更新BASE_SYSTEM_CURRENT_LOGIN_USER表
         CurrentLoginUser.getInctance().delete();
     }
 }
Ejemplo n.º 17
0
        public void insert(UserOrgStructTable userOrgStruct)
        {
            string insert = "INSERT INTO [dbo].[BASE_USER_ORG_STRUCT] ([DEPARTMENT_OR_STAFF],[VALUE],[PARENT_PKEY]) VALUES (";

            insert += Convert.ToString(userOrgStruct.departmentOrStaff) + ",";
            insert += Convert.ToString(userOrgStruct.value) + ",";
            insert += Convert.ToString(userOrgStruct.parentPkey);
            insert += ")";

            try
            {
                DatabaseAccessFactoryInstance.Instance.ExecuteCommand(FormMain.DB_NAME, insert);
                MessageBoxExtend.messageOK("数据保存成功");
                load();
            }
            catch (Exception error)
            {
                MessageBoxExtend.messageWarning(error.Message);
                return;
            }
        }
Ejemplo n.º 18
0
        private void FormMain_Load(object sender, EventArgs e)
        {
            //检测系统是否已经注册为正版
            if (!DbPublic.getInctance().isGenuineSoftware())
            {
                this.Text = this.Text + "(试用版)";
            }
            else
            {
                // 如果已注册为正版,检测当初注册时硬盘序列号和本次启动机器硬盘序列号是否相同,如果相同则视为正常,否则视同一序列号多人使用
                if (DbPublic.getInctance().getRegisterSoftwareKey() != SettlmentWay.getInctance().getSoftwareKey())
                {
                    MessageBoxExtend.messageWarning("同一软件序列号涉嫌多单位使用,程序将立即退出。\n如需继续使用该系统,请联系软件供应商。");
                    CurrentLoginUser.getInctance().delete();
                    Process.GetCurrentProcess().Kill();
                }
            }

            // 当系统未被初始化时,单据菜单、序时簿菜单不能显示
            this.menuBill.Visible = InitSubSystemSign.getInctance().isFinancialSystemInit() &&
                                    InitSubSystemSign.getInctance().isBusinessSystemInit();
            this.menuSquence.Visible = InitSubSystemSign.getInctance().isFinancialSystemInit() &&
                                       InitSubSystemSign.getInctance().isBusinessSystemInit();

            // 左侧功能按钮初始化
            LoadFunctionZone();
            this.WindowState = FormWindowState.Maximized;

            // 更新状态栏信息
            string statusBarText = DbPublic.getInctance().getCurrentDateStage();

            statusBarText += "                              ";
            statusBarText += "用户:" + DbPublic.getInctance().getCurrentLoginUserName();
            this.toolStripStatusLabel.Text = statusBarText;

            // 2017-5-10 开启一个新的线程,完成数据库备份
            Thread databaseBackTread = new Thread(new ThreadStart(ThreadFuction));

            databaseBackTread.Start();
        }
Ejemplo n.º 19
0
        private void buttonSend_Click(object sender, EventArgs e)
        {
            if (this.textBoxName.Text.Length == 0)
            {
                MessageBoxExtend.messageWarning("企业名称不能为空.");
                return;
            }

            if (this.textBoxPeople.Text.Length == 0)
            {
                MessageBoxExtend.messageWarning("联系人不能为空.");
                return;
            }

            if (this.textBoxPhone.Text.Length == 0)
            {
                MessageBoxExtend.messageWarning("联系电话不能为空.");
                return;
            }

            if (this.textBoxContent.Text.Length == 0)
            {
                MessageBoxExtend.messageWarning("问题描述不能为空.");
                return;
            }

            string emailTitle   = this.textBoxName.Text + "#" + this.textBoxPeople.Text + "#" + this.textBoxPhone.Text;
            string emailContent = this.textBoxContent.Text;

            try
            {
                SMTP.sendEmail(emailTitle, emailContent);
                MessageBoxExtend.messageOK("信息反馈成功");
                this.Close();
            }
            catch (Exception exp)
            {
                MessageBoxExtend.messageError("信息发送失败!\n\n请确认电脑是否已连接到Internet,然后重新.\n如果依然无法发送请联系软件供应商.\n" + exp.ToString());
            }
        }
        private void buttonEnter_Click(object sender, EventArgs e)
        {
            m_startDate = this.dateTimePickerStartDate.Value.ToString("yyyyMMdd");
            m_endDate   = this.dateTimePickerEndDate.Value.ToString("yyyyMMdd");
            m_allReview = Convert.ToString(this.comboBoxReview.SelectedIndex);

            if (radioButtonMateriel.Checked)
            {
                if (this.textBoxName.Text.Length <= 0)
                {
                    m_materielPkey = -1;
                    MessageBoxExtend.messageWarning("输出的物料名称为空, 查询不到对应的物料信息, 请重新输出或点击物料选择按钮");
                    this.textBoxName.Text = "";

                    return;
                }
            }
            else if (radioButtonInterregional.Checked)
            {
                m_materielPkey = -1;

                if (this.textBoxStartID.Text.Length <= 0)
                {
                    MessageBoxExtend.messageWarning("输出的物料开始ID为空, 请重新输出");
                    this.textBoxStartID.Text = "";

                    return;
                }

                if (this.textBoxEndID.Text.Length <= 0)
                {
                    MessageBoxExtend.messageWarning("输出的物料结束ID为空, 请重新输出");
                    this.textBoxEndID.Text = "";

                    return;
                }
            }

            this.Close();
        }
Ejemplo n.º 21
0
 private void checkAccountBillDetaile()
 {
     if (m_billNumber.Length > 0)
     {
         if (m_orderType == OrderType.PurchaseApplyOrder)
         {
             FormPurchaseApply fpa = new FormPurchaseApply(m_billNumber);
             fpa.ShowDialog();
             updateDataGridView();
         }
         else if (m_orderType == OrderType.PurchaseOrder)
         {
             FormPurchaseOrder fpo = new FormPurchaseOrder(m_billNumber);
             fpo.ShowDialog();
             updateDataGridView();
         }
         else if (m_orderType == OrderType.PurchaseIn)
         {
             FormPurchaseInOrder fpo = new FormPurchaseInOrder(m_billNumber);
             fpo.ShowDialog();
             updateDataGridView();
         }
         else if (m_orderType == OrderType.StorageMaterielOut)
         {
             FormMaterielOutOrder fmoo = new FormMaterielOutOrder(m_billNumber);
             fmoo.ShowDialog();
             updateDataGridView();
         }
         else if (m_orderType == OrderType.ChangeApply)
         {
             FormProjectMaterielChangeOrder fmoo = new FormProjectMaterielChangeOrder(m_billNumber);
             fmoo.ShowDialog();
             updateDataGridView();
         }
         else
         {
             MessageBoxExtend.messageWarning("暂时不支持的序时薄类型");
         }
     }
 }
Ejemplo n.º 22
0
        public void updataReceivedInfo(string billNumber, double paymentOK)
        {
            SaleOutOrderTable record      = getSaleInfoFromBillNumber(billNumber);
            double            paymentNoOK = Convert.ToDouble(record.totalMoney.ToString()) - paymentOK;

            string update = "UPDATE [dbo].[SALE_OUT_ORDER] SET ";

            update += "RECEIVED_OK = " + paymentOK + ", ";
            update += "RECEIVED_NO_OK = " + paymentNoOK;
            update += " WHERE BILL_NUMBER = '" + billNumber + "'";

            try
            {
                DatabaseAccessFactoryInstance.Instance.ExecuteCommand(FormMain.DB_NAME, update);
                load();
            }
            catch (Exception error)
            {
                MessageBoxExtend.messageWarning(error.Message);
                return;
            }
        }
Ejemplo n.º 23
0
        private void dataGridViewDataList_CellBeginEdit(object sender, DataGridViewCellCancelEventArgs e)
        {
            if (e.ColumnIndex == (int)DataGridColumnName.MatetielNumber)
            {
                //验证DataGridView是否又空的行
                int nullRowNumber = m_dateGridVeiwListDataList.getExistNullRow(e.RowIndex);

                if (nullRowNumber != -1)
                {
                    MessageBoxExtend.messageWarning("行号[" + Convert.ToString(nullRowNumber + 1) + "]数据为空,请现在空行中输入");
                    dataGridViewDataList.CurrentCell = this.dataGridViewDataList.Rows[nullRowNumber].Cells[(int)DataGridColumnName.MatetielNumber];

                    m_rowIndex    = nullRowNumber;
                    m_columnIndex = e.ColumnIndex;

                    return;
                }
            }

            m_rowIndex    = e.RowIndex;
            m_columnIndex = e.ColumnIndex;
        }
Ejemplo n.º 24
0
        private bool orderInfoIsFull(MaterielOutOrderTable record)
        {
            if (record.departmentID == -1)
            {
                MessageBoxExtend.messageWarning("客户信息不完整,单据保存失败");
                return(false);
            }

            if (record.tradingDate.Length == 0)
            {
                MessageBoxExtend.messageWarning("日期不完整,单据保存失败");
                return(false);
            }

            if (record.materielOutStaffId == -1)
            {
                MessageBoxExtend.messageWarning("领料人信息不完整,单据保存失败");
                return(false);
            }

            return(true);
        }
Ejemplo n.º 25
0
        private bool orderInfoIsFull(MaterielProOccupiedOrderTable record)
        {
            if (record.tradingDate.Length == 0)
            {
                MessageBoxExtend.messageWarning("日期不能为空,单据保存失败");
                return(false);
            }

            if (record.exchangesUnit.Length == 0)
            {
                MessageBoxExtend.messageWarning("用途信息不能为空,单据保存失败");
                return(false);
            }

            if (record.applyStaffId == -1)
            {
                MessageBoxExtend.messageWarning("申请人信息不完整,单据保存失败");
                return(false);
            }

            return(true);
        }
Ejemplo n.º 26
0
        public void update(int pkey, SupplierOrgStructTable supplierOrgStruct)
        {
            string update = "UPDATE [dbo].[BASE_SUPPLIER_ORG_STRUCT] SET ";

            update += "[VALUE] = '" + supplierOrgStruct.value + "',";
            update += "[PARENT_PKEY] = " + Convert.ToString(supplierOrgStruct.parentPkey) + " ";
            update += "WHERE PKEY = " + Convert.ToString(pkey);

            try
            {
                DatabaseAccessFactoryInstance.Instance.ExecuteCommand(FormMain.DB_NAME, update);

                MessageBoxExtend.messageOK("数据修改成功");

                load();
            }
            catch (Exception error)
            {
                MessageBoxExtend.messageWarning(error.Message);
                return;
            }
        }
Ejemplo n.º 27
0
        private bool openExcelFile(string fileName)
        {
            bool isRet = false;

            try
            {
                m_excelApp      = new Microsoft.Office.Interop.Excel.Application();
                m_excelWorkbook = m_excelApp.Workbooks.Open(fileName);
                m_excelSheet    = (Excel.Worksheet)m_excelWorkbook.Sheets["单据模板"];

                m_excelApp.Visible = false;

                isRet = true;
            }
            catch (Exception error)
            {
                MessageBoxExtend.messageWarning("输出导出出错:" + error.Message);
                release();
            }

            return(isRet);
        }
Ejemplo n.º 28
0
        private void ToolStripMenuItemCheckDetailed_Click(object sender, EventArgs e)
        {
            if (dataGridViewDataList.Rows[m_rowIndex].Cells[1].Value.ToString().Length > 0)
            {
                int materielID = Convert.ToInt32(dataGridViewDataList.Rows[m_rowIndex].Cells[1].Value.ToString());

                if (this.labelProject.Text.Length <= 0)
                {
                    if (!MessageBoxExtend.messageQuestion("材料表编号为空, 可能无法显示出材料表中的相关数据, 是否继续查看?"))
                    {
                        return;
                    }
                }

                FormMaterielDetailed fmd = new FormMaterielDetailed(materielID, this.labelProject.Text);
                fmd.ShowDialog();
            }
            else
            {
                MessageBoxExtend.messageWarning("选择行的物料ID为空, 请重新选择");
            }
        }
Ejemplo n.º 29
0
        public void update(int pkey, CustomerTypeTable customerType)
        {
            string update = "UPDATE [dbo].[BASE_CUSTOMER_TYPE] SET ";

            update += "[TYPE_NAME] = '" + customerType.name + "',";
            update += "[DESC] = '" + customerType.desc + "' ";
            update += "WHERE PKEY = " + Convert.ToString(pkey);

            try
            {
                DatabaseAccessFactoryInstance.Instance.ExecuteCommand(FormMain.DB_NAME, update);

                MessageBoxExtend.messageOK("数据修改成功");

                load();
            }
            catch (Exception error)
            {
                MessageBoxExtend.messageWarning(error.Message);
                return;
            }
        }
Ejemplo n.º 30
0
        public void update(int pkey, CustomerTable customer)
        {
            string update = "UPDATE [dbo].[BASE_CUSTOMER_LIST] SET ";

            update += "[SUPPLIER_TYPE] = " + customer.customerType + ",";
            update += "[NAME] = '" + customer.name + "',";
            update += "[NAME_SHORT] = '" + customer.nameShort + "',";
            update += "[MNEMONIC_CODE] = '" + customer.mnemonicCode + "',";
            update += "[AREA] = '" + customer.area + "',";
            update += "[CREDIT] = " + customer.credit + ",";
            update += "[VAT_RATE] = " + customer.varRate + ",";
            update += "[CONTACT] = '" + customer.contact + "',";
            update += "[TEL] = '" + customer.tel + "',";
            update += "[FAX] = '" + customer.fax + "',";
            update += "[MOBILE_PHONE] = '" + customer.mobilePhone + "',";
            update += "[E-MAIL] = '" + customer.email + "',";
            update += "[HOME_PAGE] = '" + customer.homePage + "',";
            update += "[COMPANY_ADDRESS] = '" + customer.address + "',";
            update += "[ZIP_CODE] = '" + customer.zipCode + "',";
            update += "[BANK_NAME] = '" + customer.bankName + "',";
            update += "[BANK_ACCOUNT] = '" + customer.bankAccount + "',";
            update += "[TAX_ACCOUNT] = '" + customer.taxAccount + "',";
            update += "[NOTE] = '" + customer.note + "'";
            update += "WHERE PKEY = " + Convert.ToString(pkey);

            try
            {
                DatabaseAccessFactoryInstance.Instance.ExecuteCommand(FormMain.DB_NAME, update);

                MessageBoxExtend.messageOK("数据修改成功");

                load();
            }
            catch (Exception error)
            {
                MessageBoxExtend.messageWarning(error.Message);
                return;
            }
        }