Exemple #1
0
        public ActionResult SummaryType()
        {
            ViewBag.Title = HtmlExtensions.Lang("Financing_SummaryType_Title");

            FormsAuthenticationTicket authentication = CommonFuntion.GetAuthenticationTicket();
            int mana_id = authentication == null ? 0 : Convert.ToInt32(authentication.Name);

            List <t_summary>        summary_list    = new List <t_summary>();
            InterfaceSummaryService summary_service = new SummaryService();

            try
            {
                summary_list = summary_service.SearchByManagerID(mana_id).ToList();
            }
            catch
            {
            }
#if login_debug
            t_summary add1 = new t_summary();
            add1.mana_id   = 1;
            add1.summ_desc = "123";
            add1.summ_id   = 1;
            summary_list.Add(add1);
#endif
            ViewBag.DATA = JsonConvert.SerializeObject(summary_list);
            return(View());
        }
Exemple #2
0
        private string CheckRecordAdjust(int mana_id, AdjustRecordModel model)
        {
            string result = "";

            InterfaceSummaryService summary_service = new SummaryService();
            List <t_summary>        summary_list    = new List <t_summary>();

            try
            {
                summary_list = summary_service.SearchByManagerID(mana_id).ToList();
            }
            catch
            {
            }

            foreach (int id in model.summ_id)
            {
                t_summary summary = summary_list.Where(M => M.summ_id == id).FirstOrDefault();
                if (summary == null)
                {
                    result = HtmlExtensions.Lang("_Error_Comm_Para");
                }
            }
            return(result);
        }
Exemple #3
0
        public ActionResult RecordDetail()
        {
            ViewBag.Title = HtmlExtensions.Lang("Financing_RecordDetail_Title");

            FormsAuthenticationTicket authentication = CommonFuntion.GetAuthenticationTicket();
            int mana_id = authentication == null ? 0 : Convert.ToInt32(authentication.Name);

            InterfaceRecordTypeService    record_type_service    = new RecordTypeService();
            InterfaceSummaryService       summary_service        = new SummaryService();
            InterfaceSummaryRecordService summary_record_service = new SummaryRecordService();

            List <t_record_type>    record_type_list    = new List <t_record_type>();
            List <t_summary>        summary_list        = new List <t_summary>();
            List <t_summary_record> summary_record_list = new List <t_summary_record>();

            try
            {
                record_type_list    = record_type_service.Table().ToList();
                summary_list        = summary_service.SearchByManagerID(mana_id).ToList();
                summary_record_list = summary_record_service.SearchByManagerID(mana_id).ToList();
            }
            catch
            {
            }
            ViewBag.RECORD_TYPE    = JsonConvert.SerializeObject(record_type_list);
            ViewBag.SUMMARY        = JsonConvert.SerializeObject(summary_list);
            ViewBag.SUMMARY_RECORD = CreateRecordDetailCount(summary_list, summary_record_list);
            return(View());
        }
Exemple #4
0
        private string CreateShowSummaryRecord(int mana_id, List <t_summary_record> summary_record_list)
        {
            List <object> list = new List <object>();

            InterfaceRecordTypeService record_type_service = new RecordTypeService();
            InterfaceSummaryService    summary_service     = new SummaryService();
            InterfaceLoanTypeService   loan_type_service   = new LoanTypeService();

            List <t_record_type> record_type_list = new List <t_record_type>();
            List <t_summary>     summary_list     = new List <t_summary>();
            List <t_loan_type>   loan_type_list   = new List <t_loan_type>();

            try
            {
                record_type_list = record_type_service.Table().ToList();
                summary_list     = summary_service.SearchByManagerID(mana_id).ToList();
                loan_type_list   = loan_type_service.Table().ToList();
            }
            catch
            {
            }

            foreach (t_summary_record foreach_data in summary_record_list)
            {
                t_record_type find_record_type = record_type_list.Where(M => M.reco_code == foreach_data.reco_type_code).FirstOrDefault();
                t_summary     find_summary     = summary_list.Where(M => M.summ_id == foreach_data.summ_id).FirstOrDefault();

                //转账处理
                t_summary find_tran_summary = null;
                if (foreach_data.summ_tran_id != 0)
                {
                    foreach_data.amount = -foreach_data.amount;
                    find_tran_summary   = summary_list.Where(M => M.summ_id == foreach_data.summ_tran_id).FirstOrDefault();
                }
                string tran_summary_desc = find_tran_summary == null ? "" : "->" + find_tran_summary.summ_desc;

                //借贷处理
                t_loan_type loan_type = loan_type_list.Where(M => M.loan_code == foreach_data.loan_type_code).FirstOrDefault();
                string      loan_desc = loan_type == null ? "" : "(" + loan_type.loan_desc + ")";

                if (find_record_type != null && find_summary != null)
                {
                    var insert = new
                    {
                        summary_record_id = foreach_data.summ_reco_id,
                        add_date          = foreach_data.add_time.ToString("yyyy-MM-dd HH:mm:ss"),
                        record_type_desc  = find_record_type.reco_desc + loan_desc,
                        summary_desc      = find_summary.summ_desc + tran_summary_desc,
                        amount            = foreach_data.amount,
                        remark            = foreach_data.remark,
                        is_deal           = foreach_data.is_deal
                    };
                    list.Add(insert);
                }
            }
            return(JsonConvert.SerializeObject(list));
        }
Exemple #5
0
        public ActionResult SummaryType(AddSummaryTypeModel model)
        {
            FormsAuthenticationTicket authentication = CommonFuntion.GetAuthenticationTicket();
            int mana_id = authentication == null ? 0 : Convert.ToInt32(authentication.Name);

            string check_result = CheckSummary(model);

            if (!string.IsNullOrEmpty(check_result))
            {
                ViewBag.SubmitError = check_result;
            }

            InterfaceSummaryService summary_service = new SummaryService();

            if (ModelState.IsValid && string.IsNullOrEmpty(check_result))
            {
                t_summary add_summary = new t_summary();
                add_summary.summ_desc = model.add_summary;
                add_summary.mana_id   = mana_id;
                add_summary.sort_by   = 10000;
                try
                {
                    summary_service.Insert(add_summary);
                }
                catch
                {
                }
            }
            else
            {
                List <t_summary> summary_list = new List <t_summary>();
                try
                {
                    summary_list = summary_service.SearchByManagerID(mana_id).ToList();
                }
                catch
                {
                }
                ViewBag.DATA = JsonConvert.SerializeObject(summary_list);
                return(View());
            }
            return(RedirectToAction("SummaryType", "Financing"));
        }
Exemple #6
0
        public ActionResult RecordAdjust()
        {
            ViewBag.Title = HtmlExtensions.Lang("Financing_RecordAdjust_Title");

            FormsAuthenticationTicket authentication = CommonFuntion.GetAuthenticationTicket();
            int mana_id = authentication == null ? 0 : Convert.ToInt32(authentication.Name);

            InterfaceSummaryService       summary_service        = new SummaryService();
            InterfaceSummaryRecordService summary_record_service = new SummaryRecordService();

            List <t_summary>        summary_list        = new List <t_summary>();
            List <t_summary_record> summary_record_list = new List <t_summary_record>();

            try
            {
                summary_list        = summary_service.SearchByManagerID(mana_id).ToList();
                summary_record_list = summary_record_service.SearchByManagerID(mana_id).ToList();
            }
            catch
            {
            }
            ViewBag.DATA = CreateRecordAdjustCount(summary_list, summary_record_list);
            return(View());
        }
Exemple #7
0
        public ActionResult Record()
        {
            ViewBag.Title = HtmlExtensions.Lang("Financing_Record_Title");

            FormsAuthenticationTicket authentication = CommonFuntion.GetAuthenticationTicket();
            int mana_id = authentication == null ? 0 : Convert.ToInt32(authentication.Name);

            InterfaceRecordTypeService record_type_service = new RecordTypeService();
            InterfaceSummaryService    summary_service     = new SummaryService();
            InterfaceLoanTypeService   loan_type_service   = new LoanTypeService();

            List <t_record_type> record_type_list = new List <t_record_type>();
            List <t_summary>     summary_list     = new List <t_summary>();
            List <t_loan_type>   loan_type_list   = new List <t_loan_type>();

            try
            {
                record_type_list = record_type_service.Table().ToList();
                summary_list     = summary_service.SearchByManagerID(mana_id).ToList();
                loan_type_list   = loan_type_service.Table().ToList();
            }
            catch
            {
            }
#if login_debug
            t_record_type type1 = new t_record_type();
            type1.reco_type_id = 1;
            type1.reco_desc    = "支出";
            type1.reco_code    = 1;
            record_type_list.Add(type1);
            t_record_type type2 = new t_record_type();
            type2.reco_type_id = 2;
            type2.reco_desc    = "收入";
            type2.reco_code    = 2;
            record_type_list.Add(type2);
            t_record_type type3 = new t_record_type();
            type3.reco_type_id = 3;
            type3.reco_desc    = "转账";
            type3.reco_code    = 3;
            record_type_list.Add(type3);
            t_record_type type4 = new t_record_type();
            type4.reco_type_id = 4;
            type4.reco_desc    = "借贷";
            type4.reco_code    = 4;
            record_type_list.Add(type4);

            t_summary summary1 = new t_summary();
            summary1.mana_id   = 1;
            summary1.summ_desc = "Summary";
            summary1.summ_id   = 1;
            summary_list.Add(summary1);

            t_loan_type loan1 = new t_loan_type();
            loan1.loan_type_id = 10;
            loan1.loan_desc    = "借入";
            loan1.loan_code    = 41;
            loan_type_list.Add(loan1);
            t_loan_type loan2 = new t_loan_type();
            loan2.loan_type_id = 11;
            loan2.loan_desc    = "借出";
            loan2.loan_code    = 42;
            loan_type_list.Add(loan2);
            t_loan_type loan3 = new t_loan_type();
            loan3.loan_type_id = 12;
            loan3.loan_desc    = "还款";
            loan3.loan_code    = 43;
            loan_type_list.Add(loan3);
            t_loan_type loan4 = new t_loan_type();
            loan4.loan_type_id = 13;
            loan4.loan_desc    = "收款";
            loan4.loan_code    = 44;
            loan_type_list.Add(loan4);
#endif
            ViewBag.RECORD_TYPE = JsonConvert.SerializeObject(record_type_list);
            ViewBag.SUMMARY     = JsonConvert.SerializeObject(summary_list);
            ViewBag.LOAN_TYPE   = JsonConvert.SerializeObject(loan_type_list);

            return(View());
        }