コード例 #1
0
        protected void btnСalcCostOnBeginYear_OnClick(object sender, EventArgs e)
        {
            int year = Convert.ToInt32(Session[Constants.SessionVariables.NameParamYear]);
            var calculationActions = new CalculationActions();

            string resultCalcCost = calculationActions.CalcCostOnEndYear(year+1);

            gridCalcCostOnEndYear.DataBind();
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "btnСalcCostOnBeginYear", "alert('" + resultCalcCost + "')", true);
        }
コード例 #2
0
        protected void GridAmortizationPosting_Onit(object sender, EventArgs e)
        {
            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 calculationActions = new CalculationActions();


            int resultCheckCalcCurrent = calculationActions.CheckCalcOtherPeriod(month, year, idArm);
            if (resultCheckCalcCurrent == 0)
                gridAmortizationPosting.Columns["CommandColumn"].Visible = false;
            else
                gridAmortizationPosting.Columns["CommandColumn"].Visible = true;
        }
コード例 #3
0
ファイル: Postings.aspx.cs プロジェクト: kosenv/NMActiveMSFO
        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);
        }
コード例 #4
0
        protected void btnСalculationAll_OnClick(object sender, EventArgs e)
        {
     
            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 calculationActions = new CalculationActions();

            int resultCheckCalc = calculationActions.CheckCalcOtherPeriod(month, year, idArm);
            if (resultCheckCalc == 0)
            {
                gridFondCalculation.DataBind();
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(),
                        "btnСalculationAllCheckCalc", "alert('" + MessageErrorCheckOtherPeriod + "')", true);
                return;
            }

            int resultCheckCalcCurrent = calculationActions.CheckCalcCurrentPeriod(month, year, idArm);
            if (resultCheckCalcCurrent == 0)
            {
                gridFondCalculation.DataBind();
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(),
                        "btnСalculationAllCheckCalc", "alert('" + MessageErrorCheckCurrentPeriod + "')", true);
                return;
            }


         
            int resultCheckReload = calculationActions.FondMoveCheckReload(month,year,idArm);
            if (resultCheckReload == 0)
            {
                gridFondCalculation.DataBind();
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(),
                        "btnСalculationAllCheckCalc", "alert('" + MessageErrorDeleteOldFondMoveCalc + "')", true);
                return;
            }


            int resultCalcAm = calculationActions.CalcAmortization(month, year, idArm);
            if (resultCalcAm == 0)
            {
                gridFondCalculation.DataBind();
                 ScriptManager.RegisterClientScriptBlock(this, this.GetType(), 
                        "btnСalculationAllCheckCalc", "alert('" + MessageErrorCaclAmortizationCalc + "')", true);
                return;
            }



            int resultFondMove = calculationActions.LoadCalcFondMoveMsfo(month, year, idArm);
            if (resultFondMove == 0)
            {
                gridFondCalculation.DataBind();
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), 
                        "btnСalculationAllCheckCalc", "alert('" + MessageErrorLoadFondMoveCalc + "')", true);
                return;
            }

            gridFondCalculation.DataBind();
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "btnСalculationAllResultCalc", "alert('" + MessageSuccesfullyCalc + "')", true);
            
        }