コード例 #1
0
        private void SaveData()
        {
            SysUsrMaintenanceInfo usrMaintenance = new SysUsrMaintenanceInfo();

            try
            {
                //xtpTa"
                usrMaintenance.TaControlPanel            = ChangeBoolToYesOrNo(chkTaControlPanel.Checked);
                usrMaintenance.TaChangePrice             = ChangeBoolToYesOrNo(chkTaChangePrice.Checked);
                usrMaintenance.TaPriceOff                = ChangeBoolToYesOrNo(chkTaPriceOff.Checked);
                usrMaintenance.TaShowOrderPrtAcctSummary = ChangeBoolToYesOrNo(chkTaShowOrderPrintAcctSum.Checked);
                usrMaintenance.TaShowOrderChangePayment  = ChangeBoolToYesOrNo(chkTaShowOrderChangePaym.Checked);
                usrMaintenance.TaShowOrderEditOrder      = ChangeBoolToYesOrNo(chkTaShowOrderEditOrder.Checked);
                usrMaintenance.TaShowOrderPrtReceipt     = ChangeBoolToYesOrNo(chkTaShowOrderPrtReceipt.Checked);
                usrMaintenance.TaShowOrderExportData     = ChangeBoolToYesOrNo(chkTaShowOrderExportData.Checked);

                //xtpEi"
                usrMaintenance.EiControlPanel            = ChangeBoolToYesOrNo(chkEiControlPanel.Checked);
                usrMaintenance.EiChangePrice             = ChangeBoolToYesOrNo(chkEiChangePrice.Checked);
                usrMaintenance.EiPriceOff                = ChangeBoolToYesOrNo(chkEiPriceOff.Checked);
                usrMaintenance.EiPay                     = ChangeBoolToYesOrNo(chkEiPay.Checked);
                usrMaintenance.EiPrtBill                 = ChangeBoolToYesOrNo(chkEiPrintBill.Checked);
                usrMaintenance.EiRemoveItemAfterPrt      = ChangeBoolToYesOrNo(chkEiRemoveItemAfterPrint.Checked);
                usrMaintenance.EiTableBooking            = ChangeBoolToYesOrNo(chkEiTblBooking.Checked);
                usrMaintenance.EiShowOrderPrtAcctSummary = ChangeBoolToYesOrNo(chkEiShowOrderPrintAcctSum.Checked);
                usrMaintenance.EiShowOrderChangePayment  = ChangeBoolToYesOrNo(chkEiShowOrderChangePaym.Checked);
                usrMaintenance.EiShowOrderEditOrder      = ChangeBoolToYesOrNo(chkEiShowOrderEditOrder.Checked);
                usrMaintenance.EiShowOrderPrtReceipt     = ChangeBoolToYesOrNo(chkEiShowOrderPrintReceipt.Checked);

                //xtpGa"
                usrMaintenance.GaSysConf           = ChangeBoolToYesOrNo(chkGaSysConf.Checked);
                usrMaintenance.GaSysUsrMaint       = ChangeBoolToYesOrNo(chkGaSysUsrMaint.Checked);
                usrMaintenance.GaSysDataManager    = ChangeBoolToYesOrNo(chkGaSysDataManager.Checked);
                usrMaintenance.GaSysCompactDb      = ChangeBoolToYesOrNo(chkGaSysCompactDb.Checked);
                usrMaintenance.GaRptReport         = ChangeBoolToYesOrNo(chkGaRptReport.Checked);
                usrMaintenance.GaRptAccountSummary = ChangeBoolToYesOrNo(chkGaRptAccountSum.Checked);
                usrMaintenance.GaAsSumView         = ChangeBoolToYesOrNo(chkGaAccountSumView.Checked);
                usrMaintenance.GaLogonExit         = ChangeBoolToYesOrNo(chkGaLogExitPos.Checked);
                usrMaintenance.GaWriteAndEnableInv = ChangeBoolToYesOrNo(chkGaWriteAndEnableInventory.Checked);
                usrMaintenance.GaSysComputerAdd    = ChangeBoolToYesOrNo(chkGaSysComputerAdd.Checked);
                usrMaintenance.GaSysShiftCode      = ChangeBoolToYesOrNo(chkGaSysShiftCode.Checked);
                usrMaintenance.GaTaConf            = ChangeBoolToYesOrNo(chkGaTaConf.Checked);
                usrMaintenance.GaEiConf            = ChangeBoolToYesOrNo(chkGaEiConf.Checked);
                usrMaintenance.GaTaPrtSetup        = ChangeBoolToYesOrNo(chkGaTaPrintSetup.Checked);
                usrMaintenance.GaEiPrtSetup        = ChangeBoolToYesOrNo(chkGaEiPrintSetup.Checked);
                usrMaintenance.GaAsPrtSaleRpt      = ChangeBoolToYesOrNo(chkGaAccountSumPrintSaleRpt.Checked);
                usrMaintenance.GaOpenCashDrawer    = ChangeBoolToYesOrNo(chkGaOpenCashDrawer.Checked);

                new SystemData().GetSysUsrMaintenance();
                var lstMaint = CommonData.SysUsrMaintenance.Where(s => s.UsrID == Convert.ToInt32(lueUsrName.EditValue));

                usrMaintenance.UsrID = Convert.ToInt32(lueUsrName.EditValue);

                if (lstMaint.Any())
                {
                    usrMaintenance.ID = lstMaint.FirstOrDefault().ID;
                    _control.UpdateEntity(usrMaintenance);
                }
                else
                {
                    _control.AddEntity(usrMaintenance);
                }
            }
            catch (Exception ex) { LogHelper.Error(this.Name, ex); }

            CommonTool.ShowMessage("Save successful!");
        }
コード例 #2
0
        private void SetData(string sPayName)
        {
            new SystemData().GetSysUsrMaintenance();
            var lstMaint = CommonData.SysUsrMaintenance.Where(s => s.UsrID == Convert.ToInt32(lueUsrName.EditValue));

            if (!lstMaint.Any())
            {
                #region 初始化

                chkTaControlPanel.Checked          = false;
                chkTaChangePrice.Checked           = false;
                chkTaPriceOff.Checked              = false;
                chkTaShowOrderPrintAcctSum.Checked = false;
                chkTaShowOrderChangePaym.Checked   = false;
                chkTaShowOrderEditOrder.Checked    = false;
                chkTaShowOrderPrtReceipt.Checked   = false;
                chkTaShowOrderExportData.Checked   = false;

                chkEiControlPanel.Checked          = false;
                chkEiChangePrice.Checked           = false;
                chkEiPriceOff.Checked              = false;
                chkEiPay.Checked                   = false;
                chkEiPrintBill.Checked             = false;
                chkEiRemoveItemAfterPrint.Checked  = false;
                chkEiTblBooking.Checked            = false;
                chkEiShowOrderPrintAcctSum.Checked = false;
                chkEiShowOrderChangePaym.Checked   = false;
                chkEiShowOrderEditOrder.Checked    = false;
                chkEiShowOrderPrintReceipt.Checked = false;

                chkGaSysConf.Checked                 = false;
                chkGaSysUsrMaint.Checked             = false;
                chkGaSysDataManager.Checked          = false;
                chkGaSysCompactDb.Checked            = false;
                chkGaRptReport.Checked               = false;
                chkGaRptAccountSum.Checked           = false;
                chkGaAccountSumView.Checked          = false;
                chkGaLogExitPos.Checked              = false;
                chkGaWriteAndEnableInventory.Checked = false;
                chkGaSysComputerAdd.Checked          = false;
                chkGaSysShiftCode.Checked            = false;
                chkGaTaConf.Checked                 = false;
                chkGaEiConf.Checked                 = false;
                chkGaTaPrintSetup.Checked           = false;
                chkGaEiPrintSetup.Checked           = false;
                chkGaAccountSumPrintSaleRpt.Checked = false;
                chkGaOpenCashDrawer.Checked         = false;

                #endregion
            }
            else
            {
                SysUsrMaintenanceInfo usrMaintenance = new SysUsrMaintenanceInfo();

                usrMaintenance = lstMaint.FirstOrDefault();

                if (sPayName.Equals("xtpTa"))
                {
                    xtpUsrAccess.TabPages[0].Appearance.Header.BackColor = Color.BurlyWood;
                    xtpUsrAccess.TabPages[1].Appearance.Header.BackColor = new Color();
                    xtpUsrAccess.TabPages[2].Appearance.Header.BackColor = new Color();
                    chkTaControlPanel.Checked          = YesOrNoToBool(usrMaintenance.TaControlPanel);
                    chkTaChangePrice.Checked           = YesOrNoToBool(usrMaintenance.TaChangePrice);
                    chkTaPriceOff.Checked              = YesOrNoToBool(usrMaintenance.TaPriceOff);
                    chkTaShowOrderPrintAcctSum.Checked = YesOrNoToBool(usrMaintenance.TaShowOrderPrtAcctSummary);
                    chkTaShowOrderChangePaym.Checked   = YesOrNoToBool(usrMaintenance.TaShowOrderChangePayment);
                    chkTaShowOrderEditOrder.Checked    = YesOrNoToBool(usrMaintenance.TaShowOrderEditOrder);
                    chkTaShowOrderPrtReceipt.Checked   = YesOrNoToBool(usrMaintenance.TaShowOrderPrtReceipt);
                    chkTaShowOrderExportData.Checked   = YesOrNoToBool(usrMaintenance.TaShowOrderExportData);
                }
                else if (sPayName.Equals("xtpEi"))
                {
                    xtpUsrAccess.TabPages[0].Appearance.Header.BackColor = new Color();
                    xtpUsrAccess.TabPages[1].Appearance.Header.BackColor = Color.BurlyWood;
                    xtpUsrAccess.TabPages[2].Appearance.Header.BackColor = new Color();
                    chkEiControlPanel.Checked          = YesOrNoToBool(usrMaintenance.EiControlPanel);
                    chkEiChangePrice.Checked           = YesOrNoToBool(usrMaintenance.EiChangePrice);
                    chkEiPriceOff.Checked              = YesOrNoToBool(usrMaintenance.EiPriceOff);
                    chkEiPay.Checked                   = YesOrNoToBool(usrMaintenance.EiPay);
                    chkEiPrintBill.Checked             = YesOrNoToBool(usrMaintenance.EiPrtBill);
                    chkEiRemoveItemAfterPrint.Checked  = YesOrNoToBool(usrMaintenance.EiRemoveItemAfterPrt);
                    chkEiTblBooking.Checked            = YesOrNoToBool(usrMaintenance.EiTableBooking);
                    chkEiShowOrderPrintAcctSum.Checked = YesOrNoToBool(usrMaintenance.EiShowOrderPrtAcctSummary);
                    chkEiShowOrderChangePaym.Checked   = YesOrNoToBool(usrMaintenance.EiShowOrderChangePayment);
                    chkEiShowOrderEditOrder.Checked    = YesOrNoToBool(usrMaintenance.EiShowOrderEditOrder);
                    chkEiShowOrderPrintReceipt.Checked = YesOrNoToBool(usrMaintenance.EiShowOrderPrtReceipt);
                }
                else if (sPayName.Equals("xtpGa"))
                {
                    xtpUsrAccess.TabPages[0].Appearance.Header.BackColor = new Color();
                    xtpUsrAccess.TabPages[1].Appearance.Header.BackColor = new Color();
                    xtpUsrAccess.TabPages[2].Appearance.Header.BackColor = Color.BurlyWood;
                    chkGaSysConf.Checked                 = YesOrNoToBool(usrMaintenance.GaSysConf);
                    chkGaSysUsrMaint.Checked             = YesOrNoToBool(usrMaintenance.GaSysUsrMaint);
                    chkGaSysDataManager.Checked          = YesOrNoToBool(usrMaintenance.GaSysDataManager);
                    chkGaSysCompactDb.Checked            = YesOrNoToBool(usrMaintenance.GaSysCompactDb);
                    chkGaRptReport.Checked               = YesOrNoToBool(usrMaintenance.GaRptReport);
                    chkGaRptAccountSum.Checked           = YesOrNoToBool(usrMaintenance.GaRptAccountSummary);
                    chkGaAccountSumView.Checked          = YesOrNoToBool(usrMaintenance.GaAsSumView);
                    chkGaLogExitPos.Checked              = YesOrNoToBool(usrMaintenance.GaLogonExit);
                    chkGaWriteAndEnableInventory.Checked = YesOrNoToBool(usrMaintenance.GaWriteAndEnableInv);
                    chkGaSysComputerAdd.Checked          = YesOrNoToBool(usrMaintenance.GaSysComputerAdd);
                    chkGaSysShiftCode.Checked            = YesOrNoToBool(usrMaintenance.GaSysShiftCode);
                    chkGaTaConf.Checked                 = YesOrNoToBool(usrMaintenance.GaTaConf);
                    chkGaEiConf.Checked                 = YesOrNoToBool(usrMaintenance.GaEiConf);
                    chkGaTaPrintSetup.Checked           = YesOrNoToBool(usrMaintenance.GaTaPrtSetup);
                    chkGaEiPrintSetup.Checked           = YesOrNoToBool(usrMaintenance.GaEiPrtSetup);
                    chkGaAccountSumPrintSaleRpt.Checked = YesOrNoToBool(usrMaintenance.GaAsPrtSaleRpt);
                    chkGaOpenCashDrawer.Checked         = YesOrNoToBool(usrMaintenance.GaOpenCashDrawer);
                }
            }
        }