Exemplo n.º 1
0
        /// <summary>
        /// 获取图表年初余额
        /// </summary>
        /// <returns></returns>
        public Dictionary <string, List <decimal> > getAccountingService()
        {
            //获取token
            string token = FinanceToken.getFinanceCheckToken().getToken();
            //返回的map
            Dictionary <string, List <decimal> > result = null;

            if (account != null)
            {
                //创建实例
                result = new Dictionary <string, List <decimal> >();
                //获取集合
                List <Charts> resultList = common.getAccounting(account.company);
                //年初借金数组
                List <decimal> loadList = new List <decimal>();
                //年初贷金数组
                List <decimal> borrowedList = new List <decimal>();
                //循环填入
                foreach (Charts chart in resultList)
                {
                    loadList.Add(chart.sum_load);
                    borrowedList.Add(chart.sum_borrowed);
                }
                //return
                result.Add("sum_load", loadList);
                result.Add("sum_borrowed", borrowedList);
            }

            return(result);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 获取图表利润合计
        /// </summary>
        /// <returns></returns>
        public Dictionary <string, List <decimal> > getProfitService(string start_date, string stop_date)
        {
            //获取token
            string token = FinanceToken.getFinanceCheckToken().getToken();
            //返回的map
            Dictionary <string, List <decimal> > result = null;

            if (account != null)
            {
                //创建实例
                result = new Dictionary <string, List <decimal> >();
                //获取集合
                List <Charts> resultList = common.getProfit(account.company, start_date, stop_date);
                //年初借金数组
                List <decimal> sumYear = new List <decimal>();
                //年初贷金数组
                List <decimal> sumMonth = new List <decimal>();
                //循环填入
                foreach (Charts chart in resultList)
                {
                    sumYear.Add(chart.sum_year);
                    sumMonth.Add(chart.sum_month);
                }
                //return
                result.Add("sumYear", sumYear);
                result.Add("sumMonth", sumMonth);
            }
            return(result);
        }
Exemplo n.º 3
0
 //构造方法
 public FinancingService()
 {
     try {
         //获取token
         string token = FinanceToken.getFinanceCheckToken().getToken();
         //获取对象
         account = FinanceToken.getFinanceCheckToken().checkToken(token);
         //实例化model层
         commonModel = new CommonModel();
     }catch {
         throw new InvalidOperationException("身份验证不通过");
     }
 }
Exemplo n.º 4
0
 //构造方法
 public VoucherWordService()
 {
     try {
         //获取token
         string token = FinanceToken.getFinanceCheckToken().getToken();
         //获取对象
         account = FinanceToken.getFinanceCheckToken().checkToken(token);
         //实例化model层
         voucherWordModel = new VoucherWordModel();
         commonModel      = new CommonModel();
     }catch {
         throw new Exception("身份验证不通过");
     }
 }
 //构造方法
 public User_ManagementService()
 {
     try
     {
         //获取token
         string token = FinanceToken.getFinanceCheckToken().getToken();
         //获取对象
         account = FinanceToken.getFinanceCheckToken().checkToken(token);
         //实例化model层
         user_managementmodel = new User_ManagementModel();
     }
     catch
     {
         throw new InvalidOperationException("身份验证不通过");
     }
 }
Exemplo n.º 6
0
        public string examineVoucherSummary(string idsJson, string @do)
        {
            try
            {
                //创建service层实例
                voucherSummaryService = new VoucherSummaryService();
                //获取用户service层实例
                AccountService accountService = new AccountService(true);

                Account account = new Account();
                //处理json
                string token = FinanceToken.getFinanceCheckToken().getToken();
                //获取对象
                account = FinanceToken.getFinanceCheckToken().checkToken(token);
                string examineName = account.name;

                //检查操作密码
                if (!accountService.checkDo(@do))
                {
                    return(FinanceResultData.getFinanceResultData().fail(402, null, "操作密码错误"));
                }

                //处理json
                int[] ids = FinanceJson.getFinanceJson().toObject <int[]>(idsJson);
                //审核
                if (voucherSummaryService.examineVoucherSummary(ids, examineName))
                {
                    return(FinanceResultData.getFinanceResultData().success(200, null, "成功"));
                }
                else
                {
                    return(FinanceResultData.getFinanceResultData().fail(500, null, "错误"));
                }
            }
            catch (InvalidOperationException ex)
            {
                //身份验证不通过
                return(FinanceResultData.getFinanceResultData().fail(401, null, ex.Message));
            }
            catch (Exception ex)
            {
                //未知的错误
                return(FinanceResultData.getFinanceResultData().fail(500, null, "未知的错误"));
            }
        }
Exemplo n.º 7
0
 //实例化
 public AccountService(Boolean isLogin)
 {
     //实例化model层
     am = new AccountModel();
     if (isLogin)
     {
         try
         {
             //获取token
             string token = FinanceToken.getFinanceCheckToken().getToken();
             //获取对象
             account = FinanceToken.getFinanceCheckToken().checkToken(token);
         }
         catch
         {
             throw new InvalidOperationException("身份验证不通过");
         }
     }
 }
Exemplo n.º 8
0
        /// <summary>
        /// 获取图表凭证金额
        /// </summary>
        /// <returns></returns>
        public Dictionary <string, decimal> getSummaryService(string start_date, string stop_date)
        {
            //获取token
            string token = FinanceToken.getFinanceCheckToken().getToken();
            //返回的map
            Dictionary <string, decimal> result = null;

            if (account != null)
            {
                //创建实例
                result = new Dictionary <string, decimal>();
                //获取集合
                List <Charts> resultList = common.getSummary(account.company, start_date, stop_date);
                //return
                if (resultList.Count == 2)
                {
                    result.Add("sum_borrowed", resultList[1].sum);
                    result.Add("sum_load", resultList[0].sum);
                }
                else
                {
                    if (resultList.Count == 0)
                    {
                        result.Add("sum_borrowed", 0);
                        result.Add("sum_load", 0);
                    }
                    else if (resultList[0].direction = true)
                    {
                        result.Add("sum_borrowed", resultList[0].sum);
                        result.Add("sum_load", 0);
                    }
                    else
                    {
                        result.Add("sum_borrowed", 0);
                        result.Add("sum_load", resultList[0].sum);
                    }
                }
            }

            return(result);
        }
Exemplo n.º 9
0
        /// <summary>
        /// 获取图表资产负债
        /// </summary>
        /// <returns></returns>
        public Dictionary <string, List <decimal> > getLiabilitiesService(string start_date, string stop_date)
        {
            //获取token
            string token = FinanceToken.getFinanceCheckToken().getToken();
            //返回的map
            Dictionary <string, List <decimal> > result = null;

            if (account != null)
            {
                //创建实例
                result = new Dictionary <string, List <decimal> >();
                //获取集合
                List <Charts> resultList = common.getLiabilities(account.company, start_date, stop_date);
                //年初借金数组
                List <decimal> yearStart = new List <decimal>();
                //年初贷金数组
                List <decimal> yaerEnd = new List <decimal>();
                //循环填入
                Boolean isFirst = true;
                foreach (Charts chart in resultList)
                {
                    if (isFirst)
                    {
                        yearStart.Add(chart.sum_load - chart.sum_borrowed);
                        yaerEnd.Add(chart.sum_load - chart.sum_borrowed + chart.sum_money);
                        isFirst = false;
                    }
                    else
                    {
                        yearStart.Add(chart.sum_borrowed - chart.sum_load);
                        yaerEnd.Add(chart.sum_borrowed - chart.sum_load + chart.sum_money);
                    }
                }
                //return
                result.Add("yearStart", yearStart);
                result.Add("yearEnd", yaerEnd);
            }
            return(result);
        }
Exemplo n.º 10
0
        public string quanxianGet()
        {
            try
            {
                Account account = new Account();

                //创建service层实例
                user_managementservice = new User_ManagementService();
                //处理json
                string token = FinanceToken.getFinanceCheckToken().getToken();
                //获取对象
                account = FinanceToken.getFinanceCheckToken().checkToken(token);
                string bianhao = account.bianhao;

                quanxian quanxianitem = user_managementservice.quanxianGetService(bianhao);

                if (quanxianitem != null)
                {
                    return(FinanceResultData.getFinanceResultData().success(200, quanxianitem, "成功"));
                }
                else
                {
                    return(FinanceResultData.getFinanceResultData().fail(500, null, "删除失败"));
                }
            }
            catch (InvalidOperationException ex)
            {
                //身份验证不通过
                return(FinanceResultData.getFinanceResultData().fail(401, null, ex.Message));
            }
            catch (Exception ex)
            {
                //未知的错误
                return(FinanceResultData.getFinanceResultData().fail(500, null, "未知的错误"));
            }
        }
Exemplo n.º 11
0
        /// <summary>
        /// 获取图表现金流量
        /// </summary>
        /// <returns></returns>
        public Dictionary <string, List <decimal> > getFlowService(string start_date, string stop_date)
        {
            //获取token
            string token = FinanceToken.getFinanceCheckToken().getToken();
            //返回的map
            Dictionary <string, List <decimal> > result = null;

            if (account != null)
            {
                //创建实例
                result = new Dictionary <string, List <decimal> >();
                //年初借金数组
                List <decimal> sumYear = new List <decimal>();
                //年初贷金数组
                List <decimal> sumMonth = new List <decimal>();
                //投资结余
                ManagementModel management = new ManagementModel();
                //筹资结余
                InvestmentModel investment = new InvestmentModel();
                //经营结余
                FinancingModel financing = new FinancingModel();

                //今年结余
                sumYear.Add(management.getManagementYear(account.company, start_date, stop_date));
                sumYear.Add(investment.getInvestmentYear(account.company, start_date, stop_date));
                sumYear.Add(financing.getFinancingYear(account.company, start_date, stop_date));
                //当月结余
                sumMonth.Add(management.getManagementMonth(account.company, start_date, stop_date));
                sumMonth.Add(investment.getInvestmentMonth(account.company, start_date, stop_date));
                sumMonth.Add(financing.getFinancingMonth(account.company, start_date, stop_date));
                //return
                result.Add("sumYear", sumYear);
                result.Add("sumMonth", sumMonth);
            }
            return(result);
        }
Exemplo n.º 12
0
        protected void HtmlBtn_Click(object sender, EventArgs e)
        {
            string servename      = DropDownList1.SelectedItem.Text;//这是获取选中的文本值
            string gs_name        = DropDownList2.SelectedItem.Text;
            string username       = Request.Form["username"];
            string txtSAPPassword = Request.Form["password"];

            if (servename.ToString() == "云合人事管理系统")
            {
                Session.Timeout     = 10000;
                Session["username"] = username;
                Session["gs_name"]  = gs_name;

                if (gs_name != null || username != null || txtSAPPassword != null)
                {
                    if (gs_name != null && username != null && txtSAPPassword != null)
                    {
                        string connStr = ConfigurationManager.AppSettings["yao"];
                        conn = new SqlConnection(connStr);
                        //conn = new SqlConnection(connStr);
                        if (conn.State == ConnectionState.Closed)
                        {
                            conn.Open();
                        }
                        //str = conn.BeginTransaction();
                        string sqlStr = "select id from gongzi_renyuan where L='" + gs_name + "' and I='" + username + "' and J='" + txtSAPPassword + "';";
                        cmd = new SqlCommand(sqlStr, conn);
                        int id = Convert.ToInt32(cmd.ExecuteScalar());
                        if (id != 0)
                        {
                            string[] a = gs_name.Split('_');
                            Session["gongsi"] = a[0];
                            Session["id1"]    = id;
                            Server.Transfer("../Personnel/index.aspx");
                        }
                        else
                        {
                            Response.Write("<script id='alert'>alert('输入密码有误,请重试')</script>");
                        }
                        conn.Close();
                    }
                }
            }
            else if (servename.ToString() == "云合未来进销存系统")
            {
                UserModel          userModel = new UserModel();
                string             msg       = "";
                yh_jinxiaocun_user user;
                try
                {
                    user = userModel.login(gs_name.Trim(), username.Trim(), txtSAPPassword.Trim());
                }
                catch
                {
                    Response.Write("<script>alert('网络超时,请稍后再试。')</script>");
                    return;
                }

                if (user != null)
                {
                    if (user.Btype.Equals("锁定"))
                    {
                        msg = "用户已被锁定!";
                    }

                    else
                    {
                        Session.Timeout = 10000;
                        Session["user"] = user;
                        Response.Redirect("~/frmMain.aspx");
                        return;
                    }
                }
                else
                {
                    msg = "用户名密码错误!";
                }
                Response.Write("<script id='alert'>alert('" + msg + "')</script>");
            }
            else if (servename.ToString() == "云合未来财务系统")
            {
                AccountService accountService = new AccountService(false);
                string         token          = accountService.login(gs_name.Trim(), username.Trim(), txtSAPPassword.Trim());
                if (token.Equals(""))
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "提示", "alert('用户名密码错误!')", true);
                }
                else
                {
                    FinanceToken.getFinanceCheckToken().setToken(token);
                    Response.Redirect("../finance/web/view/index.aspx");
                }
            }
            else if (servename.ToString().Equals("云合排产管理系统"))
            {
                try
                {
                    if (!UserInfoService.login(username.Trim(), txtSAPPassword.Trim(), gs_name.Trim()))
                    {
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "提示", "alert('用户名密码错误!')", true);
                    }
                    else
                    {
                        Response.Redirect("../scheduling/web/index.html");
                    }
                }
                catch (Exception ex) {
                    Response.Write(ex.Message);
                }
            }
        }