private void ProcessFromRequest(eEditMode editMode) { switch (editMode) { case eEditMode.新增: EditMode = editMode; ClearFromControls(); this.txt_Code.Text = "<自动生成>"; this.dbi_Sequence.Value = commonDAO.GetMineNewSort(this.SelCmcsMine); HelperUtil.ControlReadOnly(pnlMain, false); break; case eEditMode.修改: EditMode = editMode; InitObjectInfo(); HelperUtil.ControlReadOnly(pnlMain, false); break; case eEditMode.查看: EditMode = editMode; InitObjectInfo(); HelperUtil.ControlReadOnly(pnlMain, true); break; case eEditMode.除: EditMode = editMode; DelTreeNode(); ClearFromControls(); HelperUtil.ControlReadOnly(pnlMain, true); break; } }
/// <summary> /// 窗体加载绑定数据 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void FrmCarModel_Oper_Load(object sender, EventArgs e) { label_warn.ForeColor = Color.Red; this.CmcsCarModel = Dbers.GetInstance().SelfDber.Get <CmcsCarModel>(this.PId); if (this.CmcsCarModel != null) { txt_ModelName.Text = CmcsCarModel.ModelName; dbi_LeftObstacle1.Value = this.CmcsCarModel.LeftObstacle1; dbi_LeftObstacle2.Value = this.CmcsCarModel.LeftObstacle2; dbi_LeftObstacle3.Value = this.CmcsCarModel.LeftObstacle3; dbi_LeftObstacle4.Value = this.CmcsCarModel.LeftObstacle4; dbi_LeftObstacle5.Value = this.CmcsCarModel.LeftObstacle5; dbi_LeftObstacle6.Value = this.CmcsCarModel.LeftObstacle6; dbi_RightObstacle1.Value = this.CmcsCarModel.RightObstacle1; dbi_RightObstacle2.Value = this.CmcsCarModel.RightObstacle2; dbi_RightObstacle3.Value = this.CmcsCarModel.RightObstacle3; dbi_RightObstacle4.Value = this.CmcsCarModel.RightObstacle4; dbi_RightObstacle5.Value = this.CmcsCarModel.RightObstacle5; dbi_RightObstacle6.Value = this.CmcsCarModel.RightObstacle6; dbi_CarriageLength.Value = this.CmcsCarModel.CarriageLength; dbi_CarriageWidth.Value = this.CmcsCarModel.CarriageWidth; dbi_CarriageBottomToFloor.Value = this.CmcsCarModel.CarriageBottomToFloor; txt_ReMark.Text = CmcsCarModel.ReMark; } if (this.EditMode == eEditMode.查看) { btnSubmit.Enabled = false; HelperUtil.ControlReadOnly(panelEx2, true); } }
private void FrmSaleFuelTransport_Oper_Load(object sender, EventArgs e) { if (!String.IsNullOrEmpty(id)) { this.cmcsSaleFuelTransport = Dbers.GetInstance().SelfDber.Get <CmcsSaleFuelTransport>(this.id); if (!String.IsNullOrEmpty(this.cmcsSaleFuelTransport.TransportSalesId)) { cmcsTransportSales = Dbers.GetInstance().SelfDber.Get <CmcsTransportSales>(this.cmcsSaleFuelTransport.TransportSalesId); } txt_SerialNumber.Text = cmcsSaleFuelTransport.SerialNumber; txt_CarNumber.Text = cmcsSaleFuelTransport.CarNumber; txt_TransportSalesNum.Text = cmcsSaleFuelTransport.TransportSalesNum; txt_TransportNo.Text = cmcsSaleFuelTransport.TransportNo; txt_SupplierName.Text = cmcsSaleFuelTransport.SupplierName; txt_LoadArea.Text = cmcsSaleFuelTransport.LoadArea; txt_TransportCompanyName.Text = cmcsSaleFuelTransport.TransportCompanyName; dbi_GrossWeight.Value = (double)cmcsSaleFuelTransport.GrossWeight; dbi_TareWeight.Value = (double)cmcsSaleFuelTransport.TareWeight; dbi_SuttleWeight.Value = (double)cmcsSaleFuelTransport.SuttleWeight; txt_InFactoryTime.Text = cmcsSaleFuelTransport.InFactoryTime.Year == 1 ? "" : cmcsSaleFuelTransport.InFactoryTime.ToString(); txt_GrossTime.Text = cmcsSaleFuelTransport.GrossTime.Year == 1 ? "" : cmcsSaleFuelTransport.GrossTime.ToString(); txt_TareTime.Text = cmcsSaleFuelTransport.TareTime.Year == 1 ? "" : cmcsSaleFuelTransport.TareTime.ToString(); txt_OutFactoryTime.Text = cmcsSaleFuelTransport.OutFactoryTime.Year == 1 ? "" : cmcsSaleFuelTransport.OutFactoryTime.ToString(); txt_LoadTime.Text = cmcsSaleFuelTransport.LoadTime.Year == 1 ? "" : cmcsSaleFuelTransport.LoadTime.ToString(); txt_Remark.Text = cmcsSaleFuelTransport.Remark; chb_IsFinish.Checked = (cmcsSaleFuelTransport.IsFinish == 1); chb_IsUse.Checked = (cmcsSaleFuelTransport.IsUse == 1); } if (!edit) { btnSubmit.Enabled = false; HelperUtil.ControlReadOnly(panelEx2, true); } }
/// <summary> /// 窗体加载绑定数据 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void FrmBuyFuelTransportDeduct_Oper_Load(object sender, EventArgs e) { cmb_DeductType.Items.Add("扣矸"); cmb_DeductType.Items.Add("扣水"); cmb_DeductType.Items.Add("其他"); cmb_DeductType.SelectedIndex = 0; if (this.EditMode == eEditMode.修改) { this.CmcsBuyFuelTransportDeduct = Dbers.GetInstance().SelfDber.Get <CmcsBuyFuelTransportDeduct>(this.PId); if (CmcsBuyFuelTransportDeduct != null) { cmb_DeductType.SelectedItem = CmcsBuyFuelTransportDeduct.DeductType; dbi_DeductWeight.Value = (double)CmcsBuyFuelTransportDeduct.DeductWeight; txt_OperUser.Text = CmcsBuyFuelTransportDeduct.OperUser; txt_OperDate.Text = CmcsBuyFuelTransportDeduct.OperDate.ToString(); } } if (this.EditMode == eEditMode.查看) { btnSubmit.Enabled = false; HelperUtil.ControlReadOnly(panelEx2, true); } }
/// <summary> /// 窗体加载绑定数据 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void FrmSupplier_Oper_Load(object sender, EventArgs e) { cmb_CreditRank.SelectedIndex = 0; cmb_Type.SelectedIndex = 0; this.CmcsSupplier = Dbers.GetInstance().SelfDber.Get <CmcsSupplier>(this.PId); if (this.CmcsSupplier != null) { txt_Code.Text = CmcsSupplier.Code; txt_Name.Text = CmcsSupplier.Name; HelperUtil.SelectedComboBoxItem(cmb_CreditRank, CmcsSupplier.CreditRank); txt_ShortName.Text = CmcsSupplier.ShortName; HelperUtil.SelectedComboBoxItem(cmb_Type, CmcsSupplier.Type); txt_RepIdentity.Text = CmcsSupplier.RepIdentity; txt_OrganizationCode.Text = CmcsSupplier.OrganizationCode; db_RegisterFund.Value = CmcsSupplier.RegisterFund; txt_LicenceNum.Text = CmcsSupplier.LicenceNum; txt_Operallver.Text = CmcsSupplier.Operallver; txt_TaxregCode.Text = CmcsSupplier.TaxregCode; txt_LinkMan.Text = CmcsSupplier.LinkMan; txt_LinkTel.Text = CmcsSupplier.LinkTel; txt_Facsimile.Text = CmcsSupplier.Facsimile; txt_Email.Text = CmcsSupplier.Email; txt_PostalCode.Text = CmcsSupplier.PostalCode; txt_Address.Text = CmcsSupplier.Address; txt_Remark.Text = CmcsSupplier.Remark; chb_IsUse.Checked = (CmcsSupplier.IsStop == 0); } if (this.EditMode == eEditMode.查看) { btnSubmit.Enabled = false; HelperUtil.ControlReadOnly(panelEx2, true); } }
private void FrmGoodsTransport_Oper_Load(object sender, EventArgs e) { cmb_GoodsTypeName.DataSource = Dbers.GetInstance().SelfDber.Entities <CmcsGoodsType>(" where ParentId is not null order by OrderNumber"); cmb_GoodsTypeName.DisplayMember = "GoodsName"; cmb_GoodsTypeName.ValueMember = "Id"; cmb_GoodsTypeName.SelectedIndex = 0; this.CmcsGoodsTransport = Dbers.GetInstance().SelfDber.Get <CmcsGoodsTransport>(this.PId); if (this.CmcsGoodsTransport != null) { txt_SerialNumber.Text = CmcsGoodsTransport.SerialNumber; txt_CarNumber.Text = CmcsGoodsTransport.CarNumber; txt_SupplyUnitName.Text = CmcsGoodsTransport.SupplyUnitName; txt_ReceiveUnitName.Text = CmcsGoodsTransport.ReceiveUnitName; dbi_FirstWeight.Value = (double)CmcsGoodsTransport.FirstWeight; dbi_SecondWeight.Value = (double)CmcsGoodsTransport.SecondWeight; cmb_GoodsTypeName.Text = CmcsGoodsTransport.GoodsTypeName; dbi_SuttleWeight.Value = (double)CmcsGoodsTransport.SuttleWeight; txt_InFactoryTime.Text = CmcsGoodsTransport.InFactoryTime.Year == 1 ? "" : CmcsGoodsTransport.InFactoryTime.ToString(); txt_OutFactoryTime.Text = CmcsGoodsTransport.OutFactoryTime.Year == 1 ? "" : CmcsGoodsTransport.OutFactoryTime.ToString(); txt_FirstTime.Text = CmcsGoodsTransport.FirstTime.Year == 1 ? "" : CmcsGoodsTransport.FirstTime.ToString(); txt_SecondTime.Text = CmcsGoodsTransport.SecondTime.Year == 1 ? "" : CmcsGoodsTransport.SecondTime.ToString(); txt_Remark.Text = CmcsGoodsTransport.Remark; chb_IsFinish.Checked = (CmcsGoodsTransport.IsFinish == 1); chb_IsUse.Checked = (CmcsGoodsTransport.IsUse == 1); } if (this.EditMode == eEditMode.查看) { btnSubmit.Enabled = false; HelperUtil.ControlReadOnly(panelEx2, true); } }
private void ProcessFromRequest(eEditMode editMode) { switch (editMode) { case eEditMode.新增: CurrEditMode = editMode; ClearFromControls(); HelperUtil.ControlReadOnly(pnlMain, false); chb_IsUse.Checked = true; dbi_Sequence.Value = commonDAO.GetFuelKindSort(); break; case eEditMode.修改: CurrEditMode = editMode; InitObjectInfo(); HelperUtil.ControlReadOnly(pnlMain, false); break; case eEditMode.查看: CurrEditMode = editMode; InitObjectInfo(); HelperUtil.ControlReadOnly(pnlMain, true); break; case eEditMode.除: CurrEditMode = editMode; DelTreeNode(); ClearFromControls(); HelperUtil.ControlReadOnly(pnlMain, true); break; } }
private void ProcessFromRequest(eEditMode editMode) { switch (editMode) { case eEditMode.新增: CurrEditMode = editMode; ClearFromControls(); HelperUtil.ControlReadOnly(pnlMain, false); break; case eEditMode.修改: CurrEditMode = editMode; InitObjectInfo(); HelperUtil.ControlReadOnly(pnlMain, false); break; case eEditMode.查看: CurrEditMode = editMode; InitObjectInfo(); HelperUtil.ControlReadOnly(pnlMain, true); break; case eEditMode.除: CurrEditMode = editMode; DelTreeNode(); ClearFromControls(); HelperUtil.ControlReadOnly(pnlMain, true); break; } }
/// <summary> /// 窗体加载绑定数据 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void FrmBuyFuelTransport_Oper_Load(object sender, EventArgs e) { //绑定煤种信息 cmbFuelName_BuyFuel.DisplayMember = "Name"; cmbFuelName_BuyFuel.ValueMember = "Id"; cmbFuelName_BuyFuel.DataSource = Dbers.GetInstance().SelfDber.Entities <CmcsFuelKind>("where IsStop=0 and ParentId is not null"); cmbFuelName_BuyFuel.SelectedIndex = 0; BindStepName(); this.CmcsBuyFuelTransport = Dbers.GetInstance().SelfDber.Get <CmcsBuyFuelTransport>(this.PId); if (this.CmcsBuyFuelTransport != null) { txt_SerialNumber.Text = CmcsBuyFuelTransport.SerialNumber; txt_CarNumber.Text = CmcsBuyFuelTransport.CarNumber; CmcsInFactoryBatch cmcsinfactorybatch = Dbers.GetInstance().SelfDber.Get <CmcsInFactoryBatch>(CmcsBuyFuelTransport.InFactoryBatchId); if (cmcsinfactorybatch != null) { txt_InFactoryBatchNumber.Text = cmcsinfactorybatch.Batch; } txt_SupplierName.Text = CmcsBuyFuelTransport.SupplierName; txt_TransportCompanyName.Text = CmcsBuyFuelTransport.TransportCompanyName; txt_MineName.Text = CmcsBuyFuelTransport.MineName; cmbFuelName_BuyFuel.Text = CmcsBuyFuelTransport.FuelKindName; dbi_TicketWeight.Value = (double)CmcsBuyFuelTransport.TicketWeight; dbi_GrossWeight.Value = (double)CmcsBuyFuelTransport.GrossWeight; dbi_TareWeight.Value = (double)CmcsBuyFuelTransport.TareWeight; dbi_DeductWeight.Value = (double)CmcsBuyFuelTransport.DeductWeight; dbi_SuttleWeight.Value = (double)CmcsBuyFuelTransport.SuttleWeight; txt_UnloadArea.Text = CmcsBuyFuelTransport.UnLoadArea; //txt_InFactoryTime.Text = CmcsBuyFuelTransport.InFactoryTime.Year == 1 ? "" : CmcsBuyFuelTransport.InFactoryTime.ToString(); //txt_SamplingTime.Text = CmcsBuyFuelTransport.SamplingTime.Year == 1 ? "" : CmcsBuyFuelTransport.SamplingTime.ToString(); //txt_GrossTime.Text = CmcsBuyFuelTransport.GrossTime.Year == 1 ? "" : CmcsBuyFuelTransport.GrossTime.ToString(); //txt_UploadTime.Text = CmcsBuyFuelTransport.UploadTime.Year == 1 ? "" : CmcsBuyFuelTransport.UploadTime.ToString(); //txt_TareTime.Text = CmcsBuyFuelTransport.TareTime.Year == 1 ? "" : CmcsBuyFuelTransport.TareTime.ToString(); //txt_OutFactoryTime.Text = CmcsBuyFuelTransport.OutFactoryTime.Year == 1 ? "" : CmcsBuyFuelTransport.OutFactoryTime.ToString(); txt_InFactoryTime.Value = CmcsBuyFuelTransport.InFactoryTime; txt_SamplingTime.Value = CmcsBuyFuelTransport.SamplingTime; txt_GrossTime.Value = CmcsBuyFuelTransport.GrossTime; txt_UploadTime.Value = CmcsBuyFuelTransport.UploadTime; txt_TareTime.Value = CmcsBuyFuelTransport.TareTime; txt_OutFactoryTime.Value = CmcsBuyFuelTransport.OutFactoryTime; txt_Remark.Text = CmcsBuyFuelTransport.Remark; chb_IsFinish.Checked = (CmcsBuyFuelTransport.IsFinish == 1); chb_IsUse.Checked = (CmcsBuyFuelTransport.IsUse == 1); cmbStepName.Text = CmcsBuyFuelTransport.StepName; ShowDeduct(this.CmcsBuyFuelTransport.Id); } if (this.EditMode == eEditMode.查看) { btnSubmit.Enabled = false; HelperUtil.ControlReadOnly(panelEx2, true); } }
private void FrmProvinceAbbreviation_Oper_Load(object sender, EventArgs e) { this.cmcsProvinceAbbreviation = Dbers.GetInstance().SelfDber.Get <CmcsProvinceAbbreviation>(this.PId); if (this.cmcsProvinceAbbreviation != null) { txt_PaName.Text = cmcsProvinceAbbreviation.PaName; } if (this.EditMode == eEditMode.查看) { btnSubmit.Enabled = false; HelperUtil.ControlReadOnly(panelEx2, true); } }
private void FrmAppletLog_Oper_Load(object sender, EventArgs e) { if (this.noSampler != null) { this.CmcsMine = CommonDAO.GetInstance().SelfDber.Get <CmcsMine>(noSampler.MineId); dtpStartTime.Value = noSampler.StartTime; dtpEndTime.Value = noSampler.EndTime; } if (this.EditMode == eEditMode.查看) { btnSubmit.Enabled = false; HelperUtil.ControlReadOnly(panelEx2, true); } }
/// <summary> /// 窗体加载绑定数据 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void FrmEPCCard_Oper_Load(object sender, EventArgs e) { this.CmcsepcCard = Dbers.GetInstance().SelfDber.Get <CmcsEPCCard>(this.PId); if (this.CmcsepcCard != null) { txt_CardNumber.Text = CmcsepcCard.CardNumber; txt_TagId.Text = CmcsepcCard.TagId; } if (this.EditMode == eEditMode.查看) { btnSubmit.Enabled = false; HelperUtil.ControlReadOnly(panelEx2, true); } }
/// <summary> /// 窗体加载绑定数据 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void FrmSupplier_Oper_Load(object sender, EventArgs e) { this.CmcsSupplier = Dbers.GetInstance().SelfDber.Get <CmcsSupplier>(this.PId); if (this.CmcsSupplier != null) { txt_Code.Text = CmcsSupplier.Code; txt_Name.Text = CmcsSupplier.Name; chb_IsUse.Checked = (CmcsSupplier.IsStop == 0); } if (this.EditMode == eEditMode.查看) { btnSubmit.Enabled = false; HelperUtil.ControlReadOnly(panelEx2, true); } }
/// <summary> /// 窗体加载绑定数据 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void FrmSupplyReceive_Oper_Load(object sender, EventArgs e) { this.CmcsSupplyReceive = Dbers.GetInstance().SelfDber.Get <CmcsSupplyReceive>(this.PId); if (this.CmcsSupplyReceive != null) { txt_UnitName.Text = CmcsSupplyReceive.UnitName; chb_IsUse.Checked = (CmcsSupplyReceive.IsValid == 1); txt_ReMark.Text = CmcsSupplyReceive.Remark; } if (this.EditMode == eEditMode.查看) { btnSubmit.Enabled = false; HelperUtil.ControlReadOnly(panelEx2, true); } }
private void FrmAppletConfig_Oper_Load(object sender, EventArgs e) { this.cmcsAppletConfig = Dbers.GetInstance().SelfDber.Get <CmcsAppletConfig>(this.PId); if (this.cmcsAppletConfig != null) { txt_AppIdentifier.Text = cmcsAppletConfig.AppIdentifier; txt_ConfigName.Text = cmcsAppletConfig.ConfigName; txt_ConfigValue.Text = cmcsAppletConfig.ConfigValue; } if (this.EditMode == eEditMode.查看) { btnSubmit.Enabled = false; HelperUtil.ControlReadOnly(panelEx2, true); } }
private void FrmGoodsPlan_Oper_Load(object sender, EventArgs e) { this.cmcsGoodsPlan = Dbers.GetInstance().SelfDber.Get <CmcsGoodsPlan>(this.PId); if (this.cmcsGoodsPlan != null) { txtCarNumber_Goods.Text = cmcsGoodsPlan.CarNumber; txtSupplyUnitName_Goods.Text = cmcsGoodsPlan.SupplyUnitName; txtReceiveUnitName_Goods.Text = cmcsGoodsPlan.ReceiveUnitName; txtGoodsTypeName_Goods.Text = cmcsGoodsPlan.GoodsTypeName; txtRemark_Goods.Text = cmcsGoodsPlan.Remark; } if (this.EditMode == eEditMode.查看) { btnSubmit.Enabled = false; HelperUtil.ControlReadOnly(panelEx2, true); } }
/// <summary> /// 窗体加载绑定数据 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void FrmTransportCompany_Oper_Load(object sender, EventArgs e) { this.CmcsTransportCompany = Dbers.GetInstance().SelfDber.Get <CmcsTransportCompany>(this.PId); if (this.CmcsTransportCompany != null) { txt_Code.Text = CmcsTransportCompany.Code; txt_Name.Text = CmcsTransportCompany.Name; txt_ShortName.Text = CmcsTransportCompany.ShortName; txt_OrganizationCode.Text = CmcsTransportCompany.OrganizationCode; chb_IsUse.Checked = (CmcsTransportCompany.IsStop == 0); txt_Remark.Text = CmcsTransportCompany.Remark; } if (this.EditMode == eEditMode.查看) { btnSubmit.Enabled = false; HelperUtil.ControlReadOnly(panelEx2, true); } }
private void FrmSaleFuelTransport_Oper_Load(object sender, EventArgs e) { //绑定煤种信息 cmbFuelName_SaleFuel.DisplayMember = "Name"; cmbFuelName_SaleFuel.ValueMember = "Id"; cmbFuelName_SaleFuel.DataSource = Dbers.GetInstance().SelfDber.Entities <CmcsFuelKind>("where IsStop=0 and ParentId is not null"); cmbFuelName_SaleFuel.SelectedIndex = 0; //绑定流程节点 BindStepName(); this.CmcsSaleFuelTransport = Dbers.GetInstance().SelfDber.Get <CmcsSaleFuelTransport>(this.PId); if (this.CmcsSaleFuelTransport != null) { if (!String.IsNullOrEmpty(this.CmcsSaleFuelTransport.TransportSalesId)) { cmcsTransportSales = Dbers.GetInstance().SelfDber.Get <CmcsTransportSales>(this.CmcsSaleFuelTransport.TransportSalesId); } txt_SerialNumber.Text = CmcsSaleFuelTransport.SerialNumber; txt_CarNumber.Text = CmcsSaleFuelTransport.CarNumber; txt_SupplierName.Text = CmcsSaleFuelTransport.SupplierName; txt_LoadArea.Text = CmcsSaleFuelTransport.LoadArea; txt_TransportCompanyName.Text = CmcsSaleFuelTransport.TransportCompanyName; dbi_GrossWeight.Value = (double)CmcsSaleFuelTransport.GrossWeight; dbi_TareWeight.Value = (double)CmcsSaleFuelTransport.TareWeight; dbi_SuttleWeight.Value = (double)CmcsSaleFuelTransport.SuttleWeight; txt_InFactoryTime.Text = CmcsSaleFuelTransport.InFactoryTime.Year == 1 ? "" : CmcsSaleFuelTransport.InFactoryTime.ToString(); txt_GrossTime.Text = CmcsSaleFuelTransport.GrossTime.Year == 1 ? "" : CmcsSaleFuelTransport.GrossTime.ToString(); txt_TareTime.Text = CmcsSaleFuelTransport.TareTime.Year == 1 ? "" : CmcsSaleFuelTransport.TareTime.ToString(); txt_OutFactoryTime.Text = CmcsSaleFuelTransport.OutFactoryTime.Year == 1 ? "" : CmcsSaleFuelTransport.OutFactoryTime.ToString(); txt_LoadTime.Text = CmcsSaleFuelTransport.LoadTime.Year == 1 ? "" : CmcsSaleFuelTransport.LoadTime.ToString(); txt_Remark.Text = CmcsSaleFuelTransport.Remark; chb_IsFinish.Checked = (CmcsSaleFuelTransport.IsFinish == 1); chb_IsUse.Checked = (CmcsSaleFuelTransport.IsUse == 1); cmbStepName.Text = CmcsSaleFuelTransport.StepName; } if (this.EditMode == eEditMode.查看) { btnSubmit.Enabled = false; HelperUtil.ControlReadOnly(panelEx2, true); } }
private void FrmSupplierAssignSampler_Oper_Load(object sender, EventArgs e) { cmbSampler.Items.Add("01"); cmbSampler.Items.Add("02"); cmbSampler.Items.Add("03"); cmbSampler.SelectedIndex = 0; this.cmcsSupplierAssignSampler = Dbers.GetInstance().SelfDber.Get <CmcsSupplierAssignSampler>(this.PId); if (this.cmcsSupplierAssignSampler != null) { txtSupplierName.Text = cmcsSupplierAssignSampler.SupplierName; cmbSampler.SelectedItem = cmcsSupplierAssignSampler.Sampler; txtRemark_Goods.Text = cmcsSupplierAssignSampler.Remark; } if (this.EditMode == eEditMode.查看) { btnSubmit.Enabled = false; HelperUtil.ControlReadOnly(panelEx2, true); } }
/// <summary> /// 窗体加载绑定数据 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void FrmAutotruck_Oper_Load(object sender, EventArgs e) { label_warn.ForeColor = Color.Red; cmb_CarType.Items.Add(eCarType.入厂煤.ToString()); cmb_CarType.Items.Add(eCarType.其他物资.ToString()); cmb_CarType.Items.Add(eCarType.转煤车辆.ToString()); cmb_CarType.SelectedIndex = 0; this.CmcsAutotruck = Dbers.GetInstance().SelfDber.Get <CmcsAutotruck>(this.PId); if (this.CmcsAutotruck != null) { txt_CarNumber.Text = CmcsAutotruck.CarNumber; cmb_CarType.SelectedItem = CmcsAutotruck.CarType; txt_Driver.Text = CmcsAutotruck.Driver; txt_CellPhoneNumber.Text = CmcsAutotruck.CellPhoneNumber; chb_IsUse.Checked = (CmcsAutotruck.IsUse == 1); dbi_LeftObstacle1.Value = CmcsAutotruck.LeftObstacle1; dbi_LeftObstacle2.Value = CmcsAutotruck.LeftObstacle2; dbi_LeftObstacle3.Value = CmcsAutotruck.LeftObstacle3; dbi_LeftObstacle4.Value = CmcsAutotruck.LeftObstacle4; dbi_LeftObstacle5.Value = CmcsAutotruck.LeftObstacle5; dbi_LeftObstacle6.Value = CmcsAutotruck.LeftObstacle6; dbi_CarriageLength.Value = CmcsAutotruck.CarriageLength; dbi_CarriageWidth.Value = CmcsAutotruck.CarriageWidth; dbi_CarriageBottomToFloor.Value = CmcsAutotruck.CarriageBottomToFloor; txt_ReMark.Text = CmcsAutotruck.ReMark; this.CmcsEPCCard = Dbers.GetInstance().SelfDber.Get <CmcsEPCCard>(CmcsAutotruck.EPCCardId); if (this.CmcsEPCCard != null) { txt_EPCCardNumber.Text = cmcsEPCCard.CardNumber; } } if (this.EditMode == eEditMode.查看) { btnSubmit.Enabled = false; HelperUtil.ControlReadOnly(panelEx2, true); } }
private void ProcessFromRequest(eEditMode editMode) { if (editMode != eEditMode.查看 && SelFuelKind == null) { MessageBoxEx.Show("请先选择一个节点!", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } switch (editMode) { case eEditMode.新增: CurrEditMode = editMode; ClearFromControls(); HelperUtil.ControlReadOnly(pnlMain, false); break; case eEditMode.修改: if (this.SelFuelKind.Id == "-1") { MessageBoxEx.Show("根节点不允许修改!", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } CurrEditMode = editMode; InitObjectInfo(); HelperUtil.ControlReadOnly(pnlMain, false); break; case eEditMode.查看: CurrEditMode = editMode; InitObjectInfo(); HelperUtil.ControlReadOnly(pnlMain, true); break; case eEditMode.除: CurrEditMode = editMode; DelTreeNode(); ClearFromControls(); HelperUtil.ControlReadOnly(pnlMain, true); break; } }