protected void gridHandPosting_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) { int idFondMoveDetails = Convert.ToInt32(Session["IdFondMoveDetailInEditorNma"]); var fondMoveActions = new FondMoveActions(); var fondMove = fondMoveActions.GetFondMove(idFondMoveDetails); int? idFondMove = null; if (fondMove != null) idFondMove = fondMove.IdFondMove; int month = Convert.ToInt32(Session[Constants.SessionVariables.NameParamMonth]); int year = Convert.ToInt32(Session[Constants.SessionVariables.NameParamYear]); int idArm = Convert.ToInt32(Session[Constants.SessionVariables.NameParamArm]); int debetInt = Convert.ToInt32(e.NewValues["Debet"]); int kreditInt = Convert.ToInt32(e.NewValues["Kredit"]); string debet = debetInt.ToString("000000"); string kredit = kreditInt.ToString("000000"); decimal cost = Convert.ToDecimal(e.NewValues["Cost"]); var postingActions = new PostingActions(); string result = postingActions.FondMoveHandPostings(year, month, idArm, null, idFondMove, debet, kredit, cost, null); gridHandPosting.JSProperties["cpEditHandPosting"] = result; e.Cancel = true; gridHandPosting.CancelEdit(); }
protected void Page_Load(object sender, EventArgs e) { int idFondMoveDetails = Convert.ToInt32(Session["IdFondMoveDetailNma"]); var fondMoveActions = new FondMoveActions(); var fondMove = fondMoveActions.GetFondMove(idFondMoveDetails); if (fondMove.IdOperation == 7) { tabCtrlFondMoveDetail.TabPages[3].Visible = true; int month = Convert.ToInt32(Session[Constants.SessionVariables.NameParamMonth]); int year = Convert.ToInt32(Session[Constants.SessionVariables.NameParamYear]); cmbWriteOffStructure.DataSource = fondMoveActions.GetFondMoveReplaceStructure(month, year, idFondMoveDetails); cmbWriteOffStructure.DataBind(); if (cmbWriteOffStructure.Items.Count != 0 && !Request[NameEventParam].Contains(NameButtonSaveFondReplace)) { int idFondMoveDetailFrom = fondMoveActions.GetIdFondMoveDetailsWriteOffReplaceStructure(fondMove.IdFondMove); if (idFondMoveDetailFrom != 0) if (cmbWriteOffStructure.Items.FindByValue(idFondMoveDetailFrom) !=null) cmbWriteOffStructure.Items.FindByValue(idFondMoveDetailFrom).Selected = true; } } else tabCtrlFondMoveDetail.TabPages[3].Visible = false; }