public void btnSureClick(object sender, EventArgs e) { if (this.tvTitle.CheckedNodes.Count > 0) { string sID = this.tvTitle.CheckedNodes[0].Value; AccountTitleTree oAccount = GlobalClass.AccountTitleTreeSvr.GetAccountTitleTreeById(sID); if (oAccount != null) { hdSelectData.Value = UtilClass.ObjectToJson(oAccount); UtilClass.ExecuteScript(this, "Sure();"); } } }
public void ModelToView() { AccountTitleTree oAccountTitleTree = null; #region 主表 this.txtCode.Text = CurMaster.Code; if (!IsPostBack) { this.txtCreateDate.Text = this.CurMaster.CreateDate.ToString("yyyy-MM-dd"); txtRemark.Text = CurMaster.Descript; txtTheCustomerName.Text = CurMaster.TheCustomerName; if (CurMaster.TheCustomerRelationInfo != null) { hdTheCustomerID.Value = CurMaster.TheCustomerRelationInfo; } if (GatheringType == 1 && !string.IsNullOrEmpty(CurMaster.AccountTitleID)) { this.cmbGatheringType.SelectedValue = CurMaster.AccountTitleID; } } #endregion #region 明细 //管理费用 this.gvDetailSource.DataSource = this.CurMaster.Details; if (!IsReadyOnly) { this.gvDetailSource.EnabledClientDeleteClick = true; //this.gvDetailSource.ClientDeleteClick = "operateGrid"; this.gvDetailSource.EnabledClientNewClick = true; //this.gvDetailSource.ClientNewClick = "operateGrid"; this.gvDetailSource.EnabledClientUpdateClick = true; //this.gvDetailSource.ClientUpdateClick = "operateGrid"; } this.gvDetailSource.EnabledClientDoubleClick = true; this.gvDetailSource.ClientClick = "operateGrid"; this.gvDetailSource.DataBind(); //this.gvMasterSource.IsSelect = true; //this.gvMasterSource.DataSource = this.CurMaster.Details; //this.gvMasterSource.ClientDoubleClick = "dbDetailClick"; //this.gvMasterSource.DataBind(); //this.gvDetail.DataSource = this.CurMaster.Details; //this.gvDetail.DataBind(); #endregion }
public AccountTitleTree GetAccountTitleTree(IList lstAccountTitle, string sCode) { AccountTitleTree oAccountTitleTree = null; foreach (AccountTitleTree oAccount in lstAccountTitle) { if (string.Equals(oAccount.Code, sCode)) { oAccountTitleTree = oAccount; break; } } return(oAccountTitleTree); }
public void ModelToView() { AccountTitleTree oAccountTitleTree = null; #region 主表 this.txtCode.Text = CurMaster.Code; if (!IsPostBack) { txtCreateDate.Text = CurMaster.CreateDate.ToString("yyyy-MM-dd"); this.txtRemark.Text = CurMaster.Descript; this.cmbPaymentType.SelectedValue = CurMaster.AccountTitleID; //this.hdBankAddress.Value = CurMaster.BankAddress; if (CurMaster.TheSupplierRelationInfo != null) { txtSupply.Text = CurMaster.TheSupplierName; hdSupplyID.Value = CurMaster.TheSupplierRelationInfo; this.txtBankAcctNo.Text = CurMaster.BankAccountNo; // CurMaster.TheSupplierRelationInfo.BankAccount; this.txtBankNo.Text = CurMaster.BankName; //CurMaster.TheSupplierRelationInfo.BankName; } else { txtSupply.Text = CurMaster.TheSupplierName; } this.txtBankAcctNo.Text = CurMaster.BankAccountNo; this.txtBankNo.Text = CurMaster.BankName; } #endregion #region 明细 //管理费用 this.gvDetailSource.DataSource = this.CurMaster.Details; if (!IsReadyOnly) { this.gvDetailSource.EnabledClientDeleteClick = true; //this.gvDetailSource.ClientDeleteClick = "operateGrid"; this.gvDetailSource.EnabledClientNewClick = true; //this.gvDetailSource.ClientNewClick = "operateGrid"; this.gvDetailSource.EnabledClientUpdateClick = true; //this.gvDetailSource.ClientUpdateClick = "operateGrid"; } this.gvDetailSource.EnabledClientDoubleClick = true; this.gvDetailSource.ClientClick = "operateGrid"; this.gvDetailSource.DataBind(); #endregion }
public void ViewToModel() { if (ValidateData()) { #region 主表 CurMaster.CreateDate = ClientUtil.ToDateTime(txtCreateDate.Text); CurMaster.Descript = ClientUtil.ToString(this.txtRemark.Text); // CurMaster.BankAddress = ClientUtil.ToString(this.hdBankAddress.Value); CurMaster.IfProjectMoney = PaymentType; if (!string.IsNullOrEmpty(this.hdSupplyID.Value)) { ObjectQuery oQuery = new ObjectQuery(); oQuery.AddCriterion(Expression.Eq("Id", this.hdSupplyID.Value)); IList lst = GlobalClass.CommonMethodSrv.Query(typeof(SupplierRelationInfo), oQuery); SupplierRelationInfo oTheSupplierRelationInfo = (lst != null && lst.Count > 0) ? (lst[0] as SupplierRelationInfo):null; CurMaster.TheSupplierRelationInfo = oTheSupplierRelationInfo == null?"":oTheSupplierRelationInfo.Id; CurMaster.BankAccountNo = oTheSupplierRelationInfo == null ? "" : oTheSupplierRelationInfo.BankAccount; CurMaster.BankName = oTheSupplierRelationInfo == null?"":oTheSupplierRelationInfo.BankName; //CurMaster.BankAddress=CurMaster.TheSupplierRelationInfo. } CurMaster.BankAccountNo = ClientUtil.ToString(this.txtBankAcctNo.Text); CurMaster.BankName = ClientUtil.ToString(this.txtBankNo.Text); CurMaster.TheSupplierName = txtSupply.Text; if (!string.IsNullOrEmpty(cmbPaymentType.SelectedValue)) { AccountTitleTree currAccountTitle = GetAccountTitleTree(cmbPaymentType.SelectedValue); CurMaster.AccountTitleID = currAccountTitle == null ? "" : currAccountTitle.Id; CurMaster.AccountTitleName = currAccountTitle == null ? "" : currAccountTitle.Name; CurMaster.AccountTitleCode = currAccountTitle == null ? "" : currAccountTitle.Code; CurMaster.AccountTitleSyscode = currAccountTitle == null ? "" : currAccountTitle.SysCode; } #endregion #region 明细 //this.gvDetail.DataSource = this.CurMaster.Details; //this.gvDetail.DataBind(); #endregion } }
/// <summary> /// 新建主表 /// </summary> /// <returns></returns> public PaymentMaster NewMaster() { AccountTitleTree oAccountTitleTree = null; PaymentMaster oMaster = new PaymentMaster(); oMaster.CreatePerson = UserInfo.CurrentPersinInfo; oMaster.CreatePersonName = UserInfo.CurrentPersinInfo.Name; oMaster.CreateDate = DateTime.Now; oMaster.OperOrgInfo = UserInfo.CurrentOrgInfo; oMaster.OperOrgInfoName = UserInfo.CurrentOrgInfo.Name; oMaster.OpgSysCode = UserInfo.CurrentOrgInfo.SysCode; oMaster.HandlePerson = UserInfo.CurrentPersinInfo; oMaster.HandlePersonName = UserInfo.CurrentPersinInfo.Name; //oMaster.ProjectId = UserInfo.CurrentProjectInfo.Id; //oMaster.ProjectName = UserInfo.CurrentProjectInfo.Name; oMaster.DocState = DocumentState.Edit; oMaster.IfProjectMoney = this.PaymentType; return(oMaster); }
public void ViewToModel() { if (ValidateData()) { #region 主表 // this.CurMaster.Code = this.txtCode.Text; // this.CurMaster.Descript = this.txtDescript.Text; this.CurMaster.CreateDate = UtilClass.ToDateTime(this.txtCreateDate.Text); this.CurMaster.Descript = this.txtRemark.Text; CurMaster.IfProjectMoney = GatheringType; //单位选择 if (!string.IsNullOrEmpty(this.hdTheCustomerID.Value)) { ObjectQuery oQuery = new ObjectQuery(); oQuery.AddCriterion(Expression.Eq("Id", this.hdTheCustomerID.Value)); IList lst = GlobalClass.CommonMethodSrv.Query(typeof(CustomerRelationInfo), oQuery); CurMaster.TheCustomerRelationInfo = (lst != null && lst.Count > 0) ? (lst[0] as CustomerRelationInfo).Id : null; //CurMaster.TheCustomerName = txtTheCustomerName.Text; } CurMaster.TheCustomerName = txtTheCustomerName.Text; AccountTitleTree currAccountTitle = string.IsNullOrEmpty(this.cmbGatheringType.SelectedValue) ? null : GetAccountTitleTree(this.cmbGatheringType.SelectedValue); CurMaster.AccountTitleID = currAccountTitle == null?"": currAccountTitle.Id; CurMaster.AccountTitleName = currAccountTitle == null ? "" : currAccountTitle.Name; CurMaster.AccountTitleCode = currAccountTitle == null ? "" : currAccountTitle.Code; CurMaster.AccountTitleSyscode = currAccountTitle == null ? "" : currAccountTitle.SysCode; #endregion #region 明细 //this.gvDetail.DataSource = this.CurMaster.Details; //this.gvDetail.DataBind(); #endregion } }
/// <summary> /// 新建主表 /// </summary> /// <returns></returns> public IndirectCostMaster NewMaster() { AccountTitleTree oAccountTitleTree = null; IndirectCostMaster oMaster = new IndirectCostMaster(); oMaster.CreatePerson = UserInfo.CurrentPersinInfo; oMaster.CreatePersonName = UserInfo.CurrentPersinInfo.Name; oMaster.CreateDate = DateTime.Now; oMaster.OperOrgInfo = UserInfo.CurrentOrgInfo; oMaster.OperOrgInfoName = UserInfo.CurrentOrgInfo.Name; oMaster.OpgSysCode = UserInfo.CurrentOrgInfo.SysCode; oMaster.HandlePerson = UserInfo.CurrentPersinInfo; oMaster.HandlePersonName = UserInfo.CurrentPersinInfo.Name; oMaster.DocState = DocumentState.Edit; Hashtable ht = GlobalClass.AccountTitleTreeSvr.GetBasicAccountTitleTree(); //借款 oMaster.BorrowSymbol = new IndirectCostDetail() { Master = oMaster, AccountSymbol = EnumAccountSymbol.借款标志, CostType = EnumCostType.其他 }; if (ht["短期借款"] != null) { oMaster.BorrowSymbol.AccountTitle = ht["短期借款"] as AccountTitleTree; oMaster.BorrowSymbol.AccountTitleCode = oMaster.BorrowSymbol.AccountTitle.Code; oMaster.BorrowSymbol.AccountTitleID = oMaster.BorrowSymbol.AccountTitle.Id; oMaster.BorrowSymbol.AccountTitleName = oMaster.BorrowSymbol.AccountTitle.Name; } //利润 //oMaster.ProfitSymbol = new IndirectCostDetail() { Master = oMaster, AccountSymbol = EnumAccountSymbol.利润标志, CostType = EnumCostType.其他 }; //if (ht["利润"] != null) //{ // oMaster.ProfitSymbol.AccountTitle = ht["利润"] as AccountTitleTree; // oMaster.ProfitSymbol.AccountTitleCode = oMaster.ProfitSymbol.AccountTitle.Code; // oMaster.ProfitSymbol.AccountTitleID = oMaster.ProfitSymbol.AccountTitle.Id; // oMaster.ProfitSymbol.AccountTitleName = oMaster.ProfitSymbol.AccountTitle.Name; //} //财务 oMaster.FinanceCostSymbol = new IndirectCostDetail() { Master = oMaster, AccountSymbol = EnumAccountSymbol.财务费用标志, CostType = EnumCostType.其他 }; if (ht["财务费用"] != null) { oMaster.FinanceCostSymbol.AccountTitle = ht["财务费用"] as AccountTitleTree; oMaster.FinanceCostSymbol.AccountTitleCode = oMaster.FinanceCostSymbol.AccountTitle.Code; oMaster.FinanceCostSymbol.AccountTitleID = oMaster.FinanceCostSymbol.AccountTitle.Id; oMaster.FinanceCostSymbol.AccountTitleName = oMaster.FinanceCostSymbol.AccountTitle.Name; } //上交 oMaster.HandOnSymbol = new IndirectCostDetail() { Master = oMaster, AccountSymbol = EnumAccountSymbol.交标志, CostType = EnumCostType.其他 }; if (ht["货币上交"] != null) { oMaster.HandOnSymbol.AccountTitle = ht["货币上交"] as AccountTitleTree; oMaster.HandOnSymbol.AccountTitleCode = oMaster.HandOnSymbol.AccountTitle.Code; oMaster.HandOnSymbol.AccountTitleID = oMaster.HandOnSymbol.AccountTitle.Id; oMaster.HandOnSymbol.AccountTitleName = oMaster.HandOnSymbol.AccountTitle.Name; } return(oMaster); }
public void ModelToView() { AccountTitleTree oAccountTitleTree = null; #region 主表 if (!IsPostBack) { //this.txtCode.Text = this.CurMaster.Code; this.dpLstYear.Text = this.CurMaster.Year.ToString(); this.dpLstMonth.Text = this.CurMaster.Month.ToString(); //this.txtDescript.Text = this.CurMaster.Descript; this.txtEndTime.Text = this.CurMaster.CreateDate.ToString("yyyy-MM-dd"); //借款标志 //oAccountTitleTree = this.CurMaster.BorrowSymbol.AccountTitle == null ? null : GetAccountTitleTree(this.CurMaster.BorrowSymbol.AccountTitle.Id); this.txtBorrowSymbolMoney.Text = this.CurMaster.BorrowSymbol.Money.ToString("#0.00"); //this.txtBorrowSymbolAccountTtileTreeName.Text = oAccountTitleTree == null ? "" : oAccountTitleTree.Name; //this.hdBorrowSymbolAccountTtileTreeID.Value = oAccountTitleTree == null ? "" : oAccountTitleTree.Id; //财务费用 //oAccountTitleTree = this.CurMaster.FinanceCostSymbol.AccountTitle == null ? null : GetAccountTitleTree(this.CurMaster.FinanceCostSymbol.AccountTitle.Id); this.txtFinanceCostSymbolMoney.Text = this.CurMaster.FinanceCostSymbol.Money.ToString("#0.00"); //this.txtFinanceCostSymbolAccountTtileTreeName.Text = oAccountTitleTree == null ? "" : oAccountTitleTree.Name; //this.hdFinanceCostSymbolAccountTtileTreeID.Value = oAccountTitleTree == null ? "" : oAccountTitleTree.Id; //利润 //oAccountTitleTree = this.CurMaster.ProfitSymbol.AccountTitle == null ? null : GetAccountTitleTree(this.CurMaster.ProfitSymbol.AccountTitle.Id); // this.txtProfitSymbolMoney.Text = this.CurMaster.ProfitSymbol.Money.ToString("#0.00"); //this.txtProfitSymbolAccountTtileTreeName.Text = oAccountTitleTree == null ? "" : oAccountTitleTree.Name; //this.hdProfitSymbolAccountTtileTreeID.Value = oAccountTitleTree == null ? "" : oAccountTitleTree.Id; //上交 // oAccountTitleTree = this.CurMaster.HandOnSymbol.AccountTitle == null ? null : GetAccountTitleTree(this.CurMaster.HandOnSymbol.AccountTitle.Id); this.txtHandOnSymbolMoney.Text = this.CurMaster.HandOnSymbol.Money.ToString("#0.00"); //this.txtHandOnSymbolAccountTtileTreeName.Text = oAccountTitleTree == null ? "" : oAccountTitleTree.Name; //this.hdHandOnSymbolAccountTtileTreeID.Value = oAccountTitleTree == null ? "" : oAccountTitleTree.Id; } #endregion #region 明细 //管理费用 this.gvManageCostSource.DataSource = this.CurMaster.ManageCost; if (!IsReadyOnly) { this.gvManageCostSource.EnabledClientDeleteClick = true; //this.gvManageCostSource.ClientDeleteClick = "operateGrid"; this.gvManageCostSource.EnabledClientNewClick = true; //this.gvManageCostSource.ClientNewClick = "operateGrid"; this.gvManageCostSource.EnabledClientUpdateClick = true; //this.gvManageCostSource.ClientUpdateClick = "operateGrid"; } this.gvManageCostSource.EnabledClientDoubleClick = true; this.gvManageCostSource.ClientClick = "operateGrid"; this.gvManageCostSource.DataBind(); //this.gvMasterSource.IsSelect = true; //this.gvMasterSource.DataSource = this.CurMaster.Details; //this.gvMasterSource.ClientDoubleClick = "dbDetailClick"; //this.gvMasterSource.DataBind(); //this.gvDetail.DataSource = this.CurMaster.Details; //this.gvDetail.DataBind(); #endregion }