public frmService(Model.Service model) { InitializeComponent(); BLL.Service bllService = new BLL.Service(); Model.Service modelService = bllService.GetModel(model.GUID); _model = modelService; _guid = _model.customer; }
/// <summary> /// 修改信息初始化 /// </summary> private void GetUpdate() { this.Text = "编辑服务记录"; BLL.Service bll = new BLL.Service(); Model.Service model = bll.GetModel(_model.GUID); //赋值 BLL.Argument bllArgument = new BLL.Argument(); DataTable dt = bllArgument.GetList("type = '服务编号'").Tables[0]; string str = dt.Rows[0][1].ToString(); txtNO.Text = str + model.sNO; dtpAccept.Value = model.acceptDate ?? DateTime.Now; if (_guid != Guid.Empty) { GetCustomerGroupAndSelected(_guid); } cbxType.Text = model.type; //服务内容 if (!string.IsNullOrEmpty(model.content) && model.content.Contains('ス')) { string[] content = model.content.Split('ス'); if (content.Length == 2) { txtFault.Text = content[0]; txtSolution.Text = content[1]; } } txtResult.Text = model.result; cbxEvaluate.Text = model.evaluate; txtMaterial.Text = model.material; txtMaterialMoney.Text = string.Format("{0:F2}", model.materialMoney); txtServiceMoney.Text = string.Format("{0:F2}", model.serviceMoney); txtSum.Text = string.Format("{0:F2}", model.materialMoney + model.serviceMoney); cbxPayStatus.Text = model.payStatus; dtpSolution.Value = model.solutionDate ?? DateTime.Now; cbxTraffic.Text = model.traffic; cbxEmployee.Text = model.employee; }