private void ReSetNumbericUpDownStatus()
        {
            switch (ctDistrict.Text.ToString())
            {
            case "部门":
                BindControlsDecimal.DisableNumbericUpDown(tabPage1);
                ctManagementPerson.Enabled    = true;
                ctTechnicalPerson.Enabled     = true;
                ctAuxiliaryPerson.Enabled     = true;
                ctLowPowerTestOutput.Enabled  = true;
                ctLowPowerPrintOutput.Enabled = true;
                label9.Text  = "大功率操作工";
                label11.Text = "小功率操作工";
                ctLowPowerOperator.Enabled  = true;
                ctBraidingOutput.Enabled    = true;
                ctHighPowerDelivery.Enabled = true;
                ctHighPowerOrder.Enabled    = true;
                ctMidPowerDelivery.Enabled  = true;
                ctMidPowerOrder.Enabled     = true;
                ctLowPowerDelivery.Enabled  = true;
                ctLowPowerOrder.Enabled     = true;
                ctGroupMonitor.Enabled      = false;
                ctAbnormalPerson.Enabled    = false;
                ctAbnormalReason.Enabled    = false;
                break;

            case "包装":
                BindControlsDecimal.DisableNumbericUpDown(tabPage1);
                ctGroupMonitor.Enabled      = true;
                ctManagementPerson.Enabled  = true;
                ctAuxiliaryPerson.Enabled   = true;
                ctHighPowerOperator.Enabled = true;
                ctLowPowerOperator.Enabled  = true;
                label9.Text             = "全检操作工";
                label11.Text            = "合批操作工";
                ctNewOperator.Enabled   = true;
                ctAbsencePerson.Enabled = true;
                ctPackageFullInspectionOutput.Enabled = true;
                ctPackageCombineOutput.Enabled        = true;
                ctAbnormalPerson.Enabled = true;
                break;

            case "测试":
                BindControlsDecimal.DisableNumbericUpDown(tabPage1);
                ctGroupMonitor.Enabled        = true;
                ctManagementPerson.Enabled    = true;
                ctHighPowerOperator.Enabled   = true;
                ctNewOperator.Enabled         = true;
                ctAbsencePerson.Enabled       = true;
                ctHighPowerTestOutput.Enabled = true;
                ctAbnormalPerson.Enabled      = true;
                label9.Text  = "大功率操作工";
                label11.Text = "小功率操作工";
                break;
            }
        }
 protected override void Saving()
 {
     if (IsAdd)
     {
         var obj = AttendanceRate.New;
         BindControlsDecimal.BindControlsToObject(obj, tabPage1);
         obj.OptrType = UserStatics.OptrType;
         obj.Save();
     }
     else if (IsAdd == false)
     {
         var obj = AttendanceRate.FindById(long.Parse(ItemID));
         BindControlsDecimal.BindControlsToObject(obj, tabPage1);
         obj.Save();
     }
 }
Exemple #3
0
 protected override void Saving()
 {
     if (!IsAdd)
     {
         var obj = BaseInfoMaterial.FindById(long.Parse(ItemID));
         BindControlsDecimal.BindControlsToObject(obj, tabPage1);
         BindControlsDecimal.BindControlsToObject(obj, tabPage2);
         obj.Save();
     }
     else
     {
         var obj = BaseInfoMaterial.New;
         BindControlsDecimal.BindControlsToObject(obj, tabPage1);
         BindControlsDecimal.BindControlsToObject(obj, tabPage2);
         obj.OptrType = UserStatics.OptrType;
         obj.Save();
         ItemID  = obj.Id.ToString();
         IsSaved = true;
     }
 }
        protected override void Loading()
        {
            ctDistrict.DataSource    = CommonStatics.GetDict(UserStatics.OptrType, "区域");
            ctDistrict.DisplayMember = "Name";

            ctGroupMonitor.DataSource    = BllAttendanceRate.GetGroupMonitorByWorkShop(UserStatics.OptrType, UserStatics.WorkShop);
            ctGroupMonitor.DisplayMember = "Name";


            if (!IsAdd)
            {
                var obj = AttendanceRate.FindById(long.Parse(ItemID));
                BindControlsDecimal.BindObjectToControls(obj, tabPage1);
                ReSetNumbericUpDownStatus();
            }
            else
            {
                ctInputDate.Value = UserStatics.GetSqlServerDateTime();
            }
        }
Exemple #5
0
        protected override void Loading()
        {
            ctIsAddToInventory.Checked = true;
            ctUnitConvValue.Value      = 1;

            ctCategory.DataSource    = CommonStatics.GetDict(UserStatics.OptrType, "物料分类");
            ctCategory.DisplayMember = "Name";

            ctPurchaseUnitName.DataSource    = CommonStatics.GetDict(UserStatics.OptrType, "单位");
            ctPurchaseUnitName.DisplayMember = "Name";

            ctSaleUnitName.DataSource    = CommonStatics.GetDict(UserStatics.OptrType, "单位");
            ctSaleUnitName.DisplayMember = "Name";


            if (!IsAdd || IsSaved)
            {
                var obj = BaseInfoMaterial.FindById(long.Parse(ItemID));
                BindControlsDecimal.BindObjectToControls(obj, tabPage1);
                BindControlsDecimal.BindObjectToControls(obj, tabPage2);
                bsIngredients.DataSource  = BllBaseInfoMaterialIngredients.GetDestTable(UserStatics.OptrType, ItemID);
                dgvIngredients.DataSource = bsIngredients;
            }
        }