private void FeeName_ControlValueChanged(object sender, EventArgs e) { var payment = View.CurrentObject as PatentPayment; if (payment == null) { return; } var paymentcode = PatentPaymentCodeCollection.GetPatentPaymentCodes(payment.n_PayCaseType, payment.n_PatentType).FirstOrDefault(p => p.FeeName == ((PropertyEditor)((CompositeView)View).FindItem("s_FeeName")).ControlValue.ToString()); ((PropertyEditor)((CompositeView)View).FindItem("n_Amount")).PropertyValue = paymentcode?.Amount ?? 0; ((PropertyEditor)((CompositeView)View).FindItem("n_Amount")).ReadValue(); }
private void VCPatentPaymentDetail_ControlValueChanged(object sender, EventArgs e) { var payment = View.CurrentObject as PatentPayment; if (payment == null) { return; } //((PropertyEditor)((CompositeView)View).FindItem("n_PatentType")).WriteValue(); //((PropertyEditor)((CompositeView)View).FindItem("n_PayCaseType")).WriteValue(); View.Model.AsObjectView.ModelClass.FindMember("s_FeeName").PredefinedValues = string.Join(";", PatentPaymentCodeCollection.GetPatentPaymentCodes(payment.n_PayCaseType, payment.n_PatentType).Select(p => p.FeeName)); View.SaveModel(); payment.s_FeeName = string.Empty; payment.n_Amount = 0; }
protected override void OnViewControlsCreated() { base.OnViewControlsCreated(); Frame.GetController <NewObjectViewController>().ObjectCreated += VCPatentPaymentDetail_ObjectCreated; Frame.GetController <ObjectMethodActionsViewController>().Actions["PatentPayment.SetPaid"].Active.SetItemValue("Security", ((PropertyEditor)((CompositeView)View).FindItem("dt_PaidDate")).AllowEdit); saGetInfo.Execute += SaGetInfo_Execute; ((PropertyEditor)((CompositeView)View).FindItem("n_PatentType")).ControlValueChanged += VCPatentPaymentDetail_ControlValueChanged; ((PropertyEditor)((CompositeView)View).FindItem("n_PayCaseType")).ControlValueChanged += VCPatentPaymentDetail_ControlValueChanged; ((PropertyEditor)((CompositeView)View).FindItem("s_FeeName")).ControlValueChanged += FeeName_ControlValueChanged; var payment = View.CurrentObject as PatentPayment; if (payment == null) { return; } View.Model.AsObjectView.ModelClass.FindMember("s_FeeName").PredefinedValues = string.Join(";", PatentPaymentCodeCollection.GetPatentPaymentCodes(payment.n_PayCaseType, payment.n_PatentType).Select(p => p.FeeName)); View.SaveModel(); var sysUser = (SysUser)SecuritySystem.CurrentUser; var bRole = sysUser.IsUserInRole("管理部-质检组") || sysUser.IsUserInRole("管理部-经理"); ((PropertyEditor)((CompositeView)View).FindItem("s_Client")).AllowEdit["Securty"] = bRole; ((PropertyEditor)((CompositeView)View).FindItem("s_ClientNo")).AllowEdit["Securty"] = bRole; ((PropertyEditor)((CompositeView)View).FindItem("s_Applicant")).AllowEdit["Securty"] = bRole; ((PropertyEditor)((CompositeView)View).FindItem("s_ApplicantNo")).AllowEdit["Securty"] = bRole; ((PropertyEditor)((CompositeView)View).FindItem("s_AppNo")).AllowEdit["Securty"] = bRole; ((PropertyEditor)((CompositeView)View).FindItem("dt_PaidDate")).AllowEdit["Securty"] = bRole; ((PropertyEditor)((CompositeView)View).FindItem("n_PayCaseType")).AllowEdit["Securty"] = bRole; ((PropertyEditor)((CompositeView)View).FindItem("n_PatentType")).AllowEdit["Securty"] = bRole; ((PropertyEditor)((CompositeView)View).FindItem("Creator")).AllowEdit["Securty"] = bRole; ((PropertyEditor)((CompositeView)View).FindItem("dt_Created")).AllowEdit["Securty"] = bRole; ((PropertyEditor)((CompositeView)View).FindItem("b_Audited")).AllowEdit["Securty"] = bRole; ((PropertyEditor)((CompositeView)View).FindItem("s_PayerName")).AllowEdit["Securty"] = bRole; }