Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Utility.VerificationUtility ver = new Utility.VerificationUtility();
                ver.JudgeOperate(this.Page, 52, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.修改 });

                string redirectUrl = "PayApplyList.aspx";

                this.navigation1.Routes.Add("付款申请列表", redirectUrl);
                this.navigation1.Routes.Add("付款申请新增--关联发票", string.Empty);

                this.PayMatterStyle = (int)NFMT.Data.StyleEnum.付款事项;
                this.PayModeStyle = (int)NFMT.Data.StyleEnum.PayMode;

                NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;

                int payApplyId = 0;
                if (string.IsNullOrEmpty(Request.QueryString["id"]) || !int.TryParse(Request.QueryString["id"], out payApplyId))
                    Response.Redirect(redirectUrl);

                //获取付款申请
                NFMT.Funds.BLL.PayApplyBLL payApplyBLL = new NFMT.Funds.BLL.PayApplyBLL();
                NFMT.Common.ResultModel result = payApplyBLL.Get(user, payApplyId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                this.curPayApply = result.ReturnValue as NFMT.Funds.Model.PayApply;
                if (this.curPayApply == null || this.curPayApply.PayApplyId <= 0)
                    Response.Redirect(redirectUrl);

                //获取主申请
                NFMT.Operate.BLL.ApplyBLL applyBLL = new NFMT.Operate.BLL.ApplyBLL();
                result = applyBLL.Get(user, this.curPayApply.ApplyId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                this.curApply = result.ReturnValue as NFMT.Operate.Model.Apply;
                if (this.curApply == null || this.curApply.ApplyId <= 0)
                    Response.Redirect(redirectUrl);

                NFMT.Authority.CorpAuth auth = new NFMT.Authority.CorpAuth();
                auth.AuthColumnNames.Add("inv.InCorpId");

                NFMT.Common.SelectModel select = payApplyBLL.GetInvoiceListByApplySelect(1, 100, "si.SIId desc", this.curPayApply.PayApplyId);
                result = payApplyBLL.Load(user, select, auth);
                int totalRows = result.AffectCount;
                System.Data.DataTable dt = result.ReturnValue as System.Data.DataTable;
                this.JsonStr = Newtonsoft.Json.JsonConvert.SerializeObject(dt, new Newtonsoft.Json.Converters.DataTableConverter());

            }
        }
        public void ProcessRequest(HttpContext context)
        {
            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;

            int pageIndex = 1, pageSize = 10;
            string orderStr = string.Empty, whereStr = string.Empty;

            int status = 0;
            if (!string.IsNullOrEmpty(context.Request.QueryString["s"]))
            {
                if (!int.TryParse(context.Request.QueryString["s"], out status))
                    status = 0;
            }

            int bank = 0;
            if (!string.IsNullOrEmpty(context.Request.QueryString["b"]))
            {
                if (!int.TryParse(context.Request.QueryString["b"], out bank))
                    bank = 0;
            }

            int empId = 0;
            if (!string.IsNullOrEmpty(context.Request.QueryString["e"]))
            {
                if (!int.TryParse(context.Request.QueryString["e"], out empId))
                    empId = 0;
            }

            DateTime fromDate = NFMT.Common.DefaultValue.DefaultTime;
            if (!string.IsNullOrEmpty(context.Request.QueryString["f"]))
            {
                if (!DateTime.TryParse(context.Request.QueryString["f"], out fromDate))
                    fromDate = NFMT.Common.DefaultValue.DefaultTime;
            }

            DateTime toDate = NFMT.Common.DefaultValue.DefaultTime;
            if (!string.IsNullOrEmpty(context.Request.QueryString["t"]))
            {
                if (!DateTime.TryParse(context.Request.QueryString["t"], out toDate))
                    toDate = NFMT.Common.DefaultValue.DefaultTime;
            }

            if (!string.IsNullOrEmpty(context.Request.QueryString["pagenum"]))
                int.TryParse(context.Request.QueryString["pagenum"], out pageIndex);
            pageIndex++;
            if (!string.IsNullOrEmpty(context.Request.QueryString["pagesize"]))
                int.TryParse(context.Request.QueryString["pagesize"], out pageSize);

            if (!string.IsNullOrEmpty(context.Request.QueryString["sortdatafield"]) && !string.IsNullOrEmpty(context.Request.QueryString["sortorder"]))
            {
                string sortDataField = context.Request.QueryString["sortdatafield"].Trim();
                string sortOrder = context.Request.QueryString["sortorder"].Trim();

                switch (sortDataField)
                {
                    case "CashInId":
                        sortDataField = "ci.CashInId";
                        break;
                    case "CashInDate":
                        sortDataField = "ci.CashInDate";
                        break;
                    case "InnerCorp":
                        sortDataField = "c.CorpName";
                        break;
                    case "CashInBala":
                        sortDataField = "ci.CashInBala";
                        break;
                    case "BankName":
                        sortDataField = "b.BankName";
                        break;
                    case "OutCorp":
                        sortDataField = "ci.PayCorpName";
                        break;
                    case "StatusName":
                        sortDataField = "bd.StatusName";
                        break;
                    case "CanAllotBala":
                        sortDataField = "ci.CashInBala";
                        break;
                }
                orderStr = string.Format("{0} {1}", sortDataField, sortOrder);
            }

            NFMT.Funds.BLL.CashInBLL bll = new NFMT.Funds.BLL.CashInBLL();
            NFMT.Common.SelectModel select = bll.GetCanAllotSelectModel(pageIndex, pageSize, orderStr, fromDate, toDate, empId, bank, status);

            NFMT.Common.IAuthority authority = new NFMT.Authority.CorpAuth();
            authority.AuthColumnNames.Add("ci.CashInCorpId");

            NFMT.Common.ResultModel result = bll.Load(user, select, authority);

            context.Response.ContentType = "application/json; charset=utf-8";
            if (result.ResultStatus != 0)
            {
                context.Response.Write(result.Message);
                context.Response.End();
            }

            System.Data.DataTable dt = result.ReturnValue as System.Data.DataTable;
            System.Collections.Generic.Dictionary<string, object> dic = new System.Collections.Generic.Dictionary<string, object>();

            dic.Add("count", result.AffectCount);
            dic.Add("data", dt);

            string postData = Newtonsoft.Json.JsonConvert.SerializeObject(dic);

            context.Response.Write(postData);
        }
Exemplo n.º 3
0
        public void ProcessRequest(HttpContext context)
        {
            int pageIndex = 1, pageSize = 10;
            string orderStr = string.Empty, whereStr = string.Empty;

            DateTime fromDate = NFMT.Common.DefaultValue.DefaultTime;
            DateTime toDate = NFMT.Common.DefaultValue.DefaultTime;
            int status = 0;

            if (!string.IsNullOrEmpty(context.Request["s"]))
                int.TryParse(context.Request["s"], out status);
            if (!string.IsNullOrEmpty(context.Request.QueryString["fd"]))
            {
                if (!DateTime.TryParse(context.Request.QueryString["fd"], out fromDate))
                    fromDate = NFMT.Common.DefaultValue.DefaultTime;
            }
            if (!string.IsNullOrEmpty(context.Request.QueryString["td"]))
            {
                toDate = !DateTime.TryParse(context.Request.QueryString["td"], out toDate) ? NFMT.Common.DefaultValue.DefaultTime : toDate.AddDays(1);
            }

            int recCorpId = 0;
            int applyDeptId = 0;
            if (string.IsNullOrEmpty(context.Request.QueryString["ad"]) || !int.TryParse(context.Request.QueryString["ad"].Trim(), out applyDeptId))
            {
                applyDeptId = 0;
            }

            if (string.IsNullOrEmpty(context.Request.QueryString["rc"]) || !int.TryParse(context.Request.QueryString["rc"].Trim(), out recCorpId))
            {
                recCorpId = 0;
            }

            if (!string.IsNullOrEmpty(context.Request.QueryString["pagenum"]))
                int.TryParse(context.Request.QueryString["pagenum"], out pageIndex);
            pageIndex++;
            if (!string.IsNullOrEmpty(context.Request.QueryString["pagesize"]))
                int.TryParse(context.Request.QueryString["pagesize"], out pageSize);

            if (!string.IsNullOrEmpty(context.Request.QueryString["sortdatafield"]) && !string.IsNullOrEmpty(context.Request.QueryString["sortorder"]))
            {
                string sortDataField = context.Request.QueryString["sortdatafield"].Trim();
                string sortOrder = context.Request.QueryString["sortorder"].Trim();

                switch (sortDataField)
                {
                    case "ApplyTime":
                        sortDataField = "app.ApplyTime";
                        break;
                    case "ApplyNo":
                        sortDataField = "app.ApplyNo";
                        break;
                    case "PayMatterName":
                        sortDataField = "pa.PayMatter";
                        break;
                    case "PayModeName":
                        sortDataField = "pa.PayMode";
                        break;
                    case "RecCorpName":
                        sortDataField = "recCor.CorpName ";
                        break;
                    case "ApplyBala":
                        sortDataField = "pa.ApplyBala";
                        break;
                    case "Name":
                        sortDataField = "emp.Name";
                        break;
                    case "DeptName":
                        sortDataField = "dep.DeptName";
                        break;
                    case "StatusName":
                        sortDataField = "app.ApplyStatus";
                        break;
                }
                orderStr = string.Format("{0} {1}", sortDataField, sortOrder);
            }

            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;

            NFMT.Funds.BLL.PayApplyBLL bll = new NFMT.Funds.BLL.PayApplyBLL();
            NFMT.Common.SelectModel select = bll.GetSelectModel(pageIndex, pageSize, orderStr, fromDate, toDate, status, applyDeptId, recCorpId);

            NFMT.Authority.CorpAuth auth = new NFMT.Authority.CorpAuth();
            auth.AuthColumnNames.Add("app.ApplyCorp");
            NFMT.Common.ResultModel result = bll.Load(user, select,auth);

            context.Response.ContentType = "text/plain";
            if (result.ResultStatus != 0)
            {
                context.Response.Write(result.Message);
                context.Response.End();
            }

            int totalRows = result.AffectCount;
            System.Data.DataTable dt = result.ReturnValue as System.Data.DataTable;

            Dictionary<string, object> dic = new Dictionary<string, object>();
            dic.Add("count", totalRows);
            dic.Add("data", dt);

            string postData = Newtonsoft.Json.JsonConvert.SerializeObject(dic, new Newtonsoft.Json.Converters.DataTableConverter());

            context.Response.Write(postData);
        }
Exemplo n.º 4
0
        public ResultModel LoadAuthSelfCorp(UserModel user)
        {
            ResultModel result = new ResultModel();

            try
            {
                NFMT.Authority.CorpAuth auth = new NFMT.Authority.CorpAuth();
                auth.AuthColumnNames.Add("corp.CorpId");
                result = auth.CreateAuthorityStr(user);

                string cmdText = string.Format("select corp.* from dbo.Corporation corp where corp.IsSelf=1 and corp.CorpStatus ={0} {1}", (int)StatusEnum.已生效, result.ReturnValue.ToString());

                DataTable dt = SqlHelper.ExecuteDataTable(ConnectString, cmdText, null, CommandType.Text);

                List<Corporation> corporations = new List<Corporation>();

                foreach (DataRow dr in dt.Rows)
                {
                    Corporation corporation = new Corporation();
                    corporation.CorpId = Convert.ToInt32(dr["CorpId"]);

                    if (dr["ParentId"] != DBNull.Value)
                    {
                        corporation.ParentId = Convert.ToInt32(dr["ParentId"]);
                    }
                    if (dr["CorpCode"] != DBNull.Value)
                    {
                        corporation.CorpCode = Convert.ToString(dr["CorpCode"]);
                    }
                    if (dr["CorpName"] != DBNull.Value)
                    {
                        corporation.CorpName = Convert.ToString(dr["CorpName"]);
                    }
                    if (dr["CorpEName"] != DBNull.Value)
                    {
                        corporation.CorpEName = Convert.ToString(dr["CorpEName"]);
                    }
                    if (dr["TaxPayerId"] != DBNull.Value)
                    {
                        corporation.TaxPayerId = dr["TaxPayerId"].ToString();
                    }
                    if (dr["CorpFullName"] != DBNull.Value)
                    {
                        corporation.CorpFullName = Convert.ToString(dr["CorpFullName"]);
                    }
                    if (dr["CorpFullEName"] != DBNull.Value)
                    {
                        corporation.CorpFullEName = Convert.ToString(dr["CorpFullEName"]);
                    }
                    if (dr["CorpAddress"] != DBNull.Value)
                    {
                        corporation.CorpAddress = Convert.ToString(dr["CorpAddress"]);
                    }
                    if (dr["CorpEAddress"] != DBNull.Value)
                    {
                        corporation.CorpEAddress = Convert.ToString(dr["CorpEAddress"]);
                    }
                    if (dr["CorpTel"] != DBNull.Value)
                    {
                        corporation.CorpTel = Convert.ToString(dr["CorpTel"]);
                    }
                    if (dr["CorpFax"] != DBNull.Value)
                    {
                        corporation.CorpFax = Convert.ToString(dr["CorpFax"]);
                    }
                    if (dr["CorpZip"] != DBNull.Value)
                    {
                        corporation.CorpZip = Convert.ToString(dr["CorpZip"]);
                    }
                    if (dr["CorpType"] != DBNull.Value)
                    {
                        corporation.CorpType = Convert.ToInt32(dr["CorpType"]);
                    }
                    if (dr["CorpStatus"] != DBNull.Value)
                    {
                        corporation.CorpStatus = (Common.StatusEnum)Enum.Parse(typeof(Common.StatusEnum), dr["CorpStatus"].ToString());
                    }
                    if (dr["CreatorId"] != DBNull.Value)
                    {
                        corporation.CreatorId = Convert.ToInt32(dr["CreatorId"]);
                    }
                    if (dr["CreateTime"] != DBNull.Value)
                    {
                        corporation.CreateTime = Convert.ToDateTime(dr["CreateTime"]);
                    }
                    if (dr["LastModifyId"] != DBNull.Value)
                    {
                        corporation.LastModifyId = Convert.ToInt32(dr["LastModifyId"]);
                    }
                    if (dr["LastModifyTime"] != DBNull.Value)
                    {
                        corporation.LastModifyTime = Convert.ToDateTime(dr["LastModifyTime"]);
                    }
                    corporations.Add(corporation);
                }

                result.AffectCount = dt.Rows.Count;
                result.Message = "获取列表成功";
                result.ResultStatus = 0;
                result.ReturnValue = corporations;
            }
            catch (Exception ex)
            {
                result.Message = ex.Message;
            }

            return result;
        }
        public void ProcessRequest(HttpContext context)
        {
            int pageIndex = 1, pageSize = 10;
            string orderStr = string.Empty, whereStr = string.Empty;

            if (!string.IsNullOrEmpty(context.Request.QueryString["pagenum"]))
                int.TryParse(context.Request.QueryString["pagenum"], out pageIndex);
            pageIndex++;
            if (!string.IsNullOrEmpty(context.Request.QueryString["pagesize"]))
                int.TryParse(context.Request.QueryString["pagesize"], out pageSize);

            if (!string.IsNullOrEmpty(context.Request.QueryString["sortdatafield"]) && !string.IsNullOrEmpty(context.Request.QueryString["sortorder"]))
            {
                string sortDataField = context.Request.QueryString["sortdatafield"].Trim();
                string sortOrder = context.Request.QueryString["sortorder"].Trim();

                switch (sortDataField)
                {
                    case "InvoiceId":
                        sortDataField = "inv.InvoiceId";
                        break;
                    case "SIId":
                        sortDataField = "si.SIId";
                        break;
                    case "InvoiceDate":
                        sortDataField = "inv.InvoiceDate";
                        break;
                    case "InvoiceNo":
                        sortDataField = "inv.InvoiceNo";
                        break;
                    case "OutCorpName":
                        sortDataField = "inv.OutCorpName ";
                        break;
                    case "InCorpName":
                        sortDataField = "inv.InCorpName";
                        break;
                    case "InvoiceBala":
                        sortDataField = "inv.InvoiceBala";
                        break;
                    case "CurrencyName":
                        sortDataField = "cur.CurrencyName";
                        break;
                    case "LastBala":
                        sortDataField = "ISNULL(inv.InvoiceBala,0) - ISNULL(ipar.SumBala,0)";
                        break;
                    case "DeptName":
                        sortDataField = "dept.DeptName";
                        break;
                }
                orderStr = string.Format("{0} {1}", sortDataField, sortOrder);
            }

            string ids = context.Request.QueryString["ids"];
            string refIds = context.Request.QueryString["refIds"];

            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;

            NFMT.Funds.BLL.PayApplyBLL bll = new NFMT.Funds.BLL.PayApplyBLL();
            NFMT.Common.SelectModel select = bll.GetInvoiceListSelect(pageIndex, pageSize, orderStr,ids,refIds);

            NFMT.Authority.CorpAuth auth = new NFMT.Authority.CorpAuth();
            auth.AuthColumnNames.Add("inv.InCorpId");
            NFMT.Common.ResultModel result = bll.Load(user, select,auth);

            context.Response.ContentType = "text/plain";
            if (result.ResultStatus != 0)
            {
                context.Response.Write(result.Message);
                context.Response.End();
            }

            int totalRows = result.AffectCount;
            System.Data.DataTable dt = result.ReturnValue as System.Data.DataTable;

            Dictionary<string, object> dic = new Dictionary<string, object>();
            dic.Add("count", totalRows);
            dic.Add("data", dt);

            string postData = Newtonsoft.Json.JsonConvert.SerializeObject(dic, new Newtonsoft.Json.Converters.DataTableConverter());

            context.Response.Write(postData);
        }
Exemplo n.º 6
0
        public void ProcessRequest(HttpContext context)
        {
            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;

            int pageIndex = 1, pageSize = 10;
            string orderStr = string.Empty, whereStr = string.Empty;

            int status = 0;
            if (!string.IsNullOrEmpty(context.Request.QueryString["s"]))
            {
                if (!int.TryParse(context.Request.QueryString["s"], out status))
                    status = 0;
            }

            int applyPerson = 0;
            if (!string.IsNullOrEmpty(context.Request.QueryString["a"]))
            {
                if (!int.TryParse(context.Request.QueryString["a"], out applyPerson))
                    applyPerson = 0;
            }

            DateTime fromDate = NFMT.Common.DefaultValue.DefaultTime;
            if (!string.IsNullOrEmpty(context.Request.QueryString["f"]))
            {
                if (!DateTime.TryParse(context.Request.QueryString["f"], out fromDate))
                    fromDate = NFMT.Common.DefaultValue.DefaultTime;
            }

            DateTime toDate = NFMT.Common.DefaultValue.DefaultTime;
            if (!string.IsNullOrEmpty(context.Request.QueryString["t"]))
            {
                if (!DateTime.TryParse(context.Request.QueryString["t"], out toDate))
                    toDate = NFMT.Common.DefaultValue.DefaultTime;
            }

            if (!string.IsNullOrEmpty(context.Request.QueryString["pagenum"]))
                int.TryParse(context.Request.QueryString["pagenum"], out pageIndex);
            pageIndex++;
            if (!string.IsNullOrEmpty(context.Request.QueryString["pagesize"]))
                int.TryParse(context.Request.QueryString["pagesize"], out pageSize);

            if (!string.IsNullOrEmpty(context.Request.QueryString["sortdatafield"]) && !string.IsNullOrEmpty(context.Request.QueryString["sortorder"]))
                orderStr = string.Format("{0} {1}", context.Request.QueryString["sortdatafield"].Trim(), context.Request.QueryString["sortorder"].Trim());

            NFMT.WareHouse.BLL.PledgeApplyBLL bll = new NFMT.WareHouse.BLL.PledgeApplyBLL();
            NFMT.Common.SelectModel select = bll.GetSelectModel(pageIndex, pageSize, orderStr, applyPerson, status, fromDate, toDate);

            NFMT.Common.IAuthority authority = new NFMT.Authority.CorpAuth();
            authority.AuthColumnNames.Add("app.ApplyCorp");

            NFMT.Common.ResultModel result = bll.Load(user, select,authority);

            context.Response.ContentType = "application/json; charset=utf-8";
            if (result.ResultStatus != 0)
            {
                context.Response.Write(result.Message);
                context.Response.End();
            }

            System.Data.DataTable dt = result.ReturnValue as System.Data.DataTable;
            System.Collections.Generic.Dictionary<string, object> dic = new System.Collections.Generic.Dictionary<string, object>();

            dic.Add("count", result.AffectCount);
            dic.Add("data", dt);

            string postData = Newtonsoft.Json.JsonConvert.SerializeObject(dic);

            context.Response.Write(postData);
        }