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();
        }
Exemple #2
0
        public static string Message(int idFondMoveDetails)
        {
            if (idFondMoveDetails == -1)
                return "Операция не выполнена. Т.к. нет данных о движении.";

            var postingActions = new PostingActions();
            var result = postingActions.FondMoveHandPostingMoveAuto(idFondMoveDetails);
            return result;
        }
Exemple #3
0
        private void RecvPostingInBalance(int idPostingFile)
        {
            int month = Convert.ToInt32(Session[Constants.SessionVariables.NameParamMonth]);
            int year = Convert.ToInt32(Session[Constants.SessionVariables.NameParamYear]);
            
            var calculationActions = new CalculationActions();

            int resultCheckCalcNaftan = calculationActions.CheckCalcOtherPeriod(month, year, 0);
            int resultCheckCalcUso = calculationActions.CheckCalcOtherPeriod(month, year, 1);
            int resultCheckCalcPolymir = calculationActions.CheckCalcOtherPeriod(month, year, 3);
            if (resultCheckCalcNaftan == 0 || resultCheckCalcUso == 0 || resultCheckCalcPolymir == 0)
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(),
                        "RecvPostingInBalance", "alert('Сброс проводок запрещен, т.к. следующий период уже расчитан или предыдущий еще не расчитан.')", true);
                return;
            }


            var postingActions = new PostingActions();
            postingActions.RecvPostingInBalance(year,month,idPostingFile);
            UpdateGridPostingLoadBalance();

            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "RecvPostingInBalance", "alert('Сброс проводок произведен.')", true);
        }
        protected void gridHandPosting_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
        {
            int idFondMovePosting = Convert.ToInt32(e.Keys["IdFondMovePosting"]);

            int month = Convert.ToInt32(Session[Constants.SessionVariables.NameParamMonth]);
            int year = Convert.ToInt32(Session[Constants.SessionVariables.NameParamYear]);
            int idArm = Convert.ToInt32(Session[Constants.SessionVariables.NameParamArm]);

            var postingActions = new PostingActions();
            string result = postingActions.FondMoveHandPostings(year, month, idArm, idFondMovePosting, null, null, null, null, 1);
            gridHandPosting.JSProperties["cpEditHandPosting"] = result;

            e.Cancel = true;
            gridHandPosting.CancelEdit();
        }