Exemplo n.º 1
0
        public Result SaveIncome(Income Inco)
        {
            Result result = new Result();

            if (!Inco.IsValid())
            {
                result.StatusCode = Globals.FAILURE_STATUS_CODE;
                result.StatusDesc = Inco.StatusDesc;
                return(result);
            }

            DataTable dt = dh.ExecuteDataSet("SaveIncomeDetails", new string[] { Inco.CompanyCode, Inco.IncomeID, Inco.Amount, Inco.IncomeDate, Inco.Description, Inco.Type, Inco.ModifiedBy }).Tables[0];

            if (dt.Rows.Count <= 0)
            {
                result.StatusCode = Globals.FAILURE_STATUS_CODE;
                result.StatusDesc = "FAILED: INCOME NOT SAVED";
                return(result);
            }

            result.StatusCode = Globals.SUCCESS_STATUS_CODE;
            result.StatusDesc = Globals.SUCCESS_STATUS_TEXT;
            result.LoanID     = dt.Rows[0][0].ToString();
            return(result);
        }