Пример #1
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "application/json; charset=utf-8";

            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
            NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();

            NFMT.User.BLL.CorporationBLL bll = new NFMT.User.BLL.CorporationBLL();
            result = bll.LoadAuthSelfCorp(user);

            List<NFMT.User.Model.Corporation> corps = new List<NFMT.User.Model.Corporation>();

            if (result.ResultStatus == 0)
            {
                corps = result.ReturnValue as List<NFMT.User.Model.Corporation>;
            }

            //合约过滤
            int contractId = 0;
            if (!string.IsNullOrEmpty(context.Request.QueryString["ContractId"]))
                int.TryParse(context.Request.QueryString["ContractId"], out contractId);

            //合约抬头过滤
            IEnumerable<NFMT.User.Model.Corporation> ecs = new List<NFMT.User.Model.Corporation>();
            if (contractId > 0)
            {
                NFMT.Contract.BLL.ContractCorporationDetailBLL corpBLL = new NFMT.Contract.BLL.ContractCorporationDetailBLL();
                result = corpBLL.LoadCorpListByContractId(user, contractId,true);
                if (result.ResultStatus != 0)
                    context.Response.End();

                List<NFMT.Contract.Model.ContractCorporationDetail> contractCorps = result.ReturnValue as List<NFMT.Contract.Model.ContractCorporationDetail>;
                var corpIds = contractCorps.Select(c => c.CorpId).ToList();
                ecs = corps.Where(c => corpIds.Contains(c.CorpId));
                corps = ecs.ToList();
            }

            int subId = 0;
            if (!string.IsNullOrEmpty(context.Request.QueryString["SubId"]))
                int.TryParse(context.Request.QueryString["SubId"], out subId);
            if (subId > 0)
            {
                NFMT.Contract.BLL.SubCorporationDetailBLL subCorpBLL = new NFMT.Contract.BLL.SubCorporationDetailBLL();
                result = subCorpBLL.Load(user, subId, true);
                if (result.ResultStatus != 0)
                    context.Response.End();

                List<NFMT.Contract.Model.SubCorporationDetail> subCorps = result.ReturnValue as List<NFMT.Contract.Model.SubCorporationDetail>;
                var corpIds = subCorps.Select(c => c.CorpId).ToList();
                ecs = corps.Where(c => corpIds.Contains(c.CorpId));
                corps = ecs.ToList();
            }

            string jsonStr = Newtonsoft.Json.JsonConvert.SerializeObject(corps);
            context.Response.Write(jsonStr);
        }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string redirectUrl = string.Format("{0}User/CorporationList.aspx", NFMT.Common.DefaultValue.NftmSiteName);
                NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
                NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();

                Utility.VerificationUtility ver = new Utility.VerificationUtility();
                ver.JudgeOperate(this.Page, 16, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.冻结, NFMT.Common.OperateEnum.解除冻结 });

                this.navigation1.Routes.Add("企业管理", redirectUrl);
                this.navigation1.Routes.Add("客户明细", string.Empty);

                NFMT.User.BLL.CorporationDetailBLL corporationDetailBLL = new NFMT.User.BLL.CorporationDetailBLL();
                //int detailId = 0;
                int corpId = 0;
                //if (!string.IsNullOrEmpty(Request.QueryString["detailId"]) && int.TryParse(Request.QueryString["detailId"], out detailId))
                //{
                //    result = corporationDetailBLL.Get(user, detailId);
                //    NFMT.User.Model.CorporationDetail corporationDetail = result.ReturnValue as NFMT.User.Model.CorporationDetail;
                //    if (corporationDetail == null)
                //        Response.Redirect(redirectUrl);
                //    corpId = corporationDetail.CorpId;
                //}

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

                NFMT.User.BLL.CorporationBLL corporationBLL = new NFMT.User.BLL.CorporationBLL();
                result = corporationBLL.Get(user, corpId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                corporation = result.ReturnValue as NFMT.User.Model.Corporation;
                if (corporation == null)
                    Response.Redirect(redirectUrl);

                result = corporationDetailBLL.GetByCorpId(user, corpId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                corpDetail = result.ReturnValue as NFMT.User.Model.CorporationDetail;
                if (corpDetail == null)
                    Response.Redirect(redirectUrl);

                System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
                string json = serializer.Serialize(corporation);
                this.hidModel.Value = json;
            }
        }
Пример #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Utility.VerificationUtility ver = new Utility.VerificationUtility();
                ver.JudgeOperate(this.Page, 80, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.录入 });

                this.navigation1.Routes.Add("员工部门分配-部门列表", string.Format("{0}User/DeptList.aspx", NFMT.Common.DefaultValue.NftmSiteName));
                this.navigation1.Routes.Add("员工分配", string.Empty);

                int deptId = 0;
                if (string.IsNullOrEmpty(Request.QueryString["deptId"]))
                    Response.Redirect("DeptList.aspx");

                if(!int.TryParse(Request.QueryString["deptId"],out deptId))
                    Response.Redirect("DeptList.aspx");

                NFMT.User.BLL.DepartmentBLL bll = new NFMT.User.BLL.DepartmentBLL();
                NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
                NFMT.Common.ResultModel result = bll.Get(user,deptId);
                if(result.ResultStatus!=0)
                    Response.Redirect("DeptList.aspx");
                NFMT.User.Model.Department dept = result.ReturnValue as NFMT.User.Model.Department;

                if(dept == null || dept.DeptId ==0)
                    Response.Redirect("DeptList.aspx");

                NFMT.User.BLL.CorporationBLL corpBll = new NFMT.User.BLL.CorporationBLL();
                result = corpBll.Get(user, dept.CorpId);
                if(result.ResultStatus !=0)
                    Response.Redirect("DeptList.aspx");
                NFMT.User.Model.Corporation corp = result.ReturnValue as NFMT.User.Model.Corporation;
                if (corp == null || corp.CorpId == 0 || !corp.IsSelf)
                    Response.Redirect("DeptList.aspx");

                //设置部门信息
                this.spnDeptCode.InnerHtml = dept.DeptCode;
                this.spnDeptName.InnerHtml = dept.DeptName;
                this.spnCorpName.InnerHtml = corp.CorpName;

                NFMT.Data.StyleEnum style = NFMT.Data.StyleEnum.部门类型;
                NFMT.Data.Model.BDStyleDetail detail = NFMT.Data.DetailProvider.Details(style)[dept.DeptType];
                this.spnDeptType.InnerHtml = detail.DetailName;

                this.hidDeptId.Value = dept.DeptId.ToString();

            }
        }
Пример #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
            string directUrl = string.Format("{0}User/CorporationList.aspx", NFMT.Common.DefaultValue.NftmSiteName);

            if (!IsPostBack)
            {
                Utility.VerificationUtility ver = new Utility.VerificationUtility();
                ver.JudgeOperate(this.Page, 16, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.修改 });

                this.navigation1.Routes.Add("企业管理", directUrl);
                this.navigation1.Routes.Add("企业修改", string.Empty);

                this.hidStyleId.Value = ((int)NFMT.Data.StyleEnum.公司类型).ToString();

                if (string.IsNullOrEmpty(Request.QueryString["id"]))
                    Response.Redirect(directUrl);

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

                this.hidId.Value = id.ToString();

                NFMT.User.BLL.CorporationBLL corpBLL = new NFMT.User.BLL.CorporationBLL();
                var result = corpBLL.Get(user, id);
                if (result.ResultStatus != 0)
                    Response.Redirect(directUrl);

                NFMT.User.Model.Corporation corp = result.ReturnValue as NFMT.User.Model.Corporation;
                if (corp != null)
                {
                    this.hidBlocId.Value = corp.ParentId.ToString();
                    this.txbCorpCode.Value = corp.CorpCode;
                    this.txbCorpName.Value = corp.CorpName;
                    this.txbCorpEName.Value = corp.CorpEName;
                    this.txbTaxPlayer.Value = corp.TaxPayerId.ToString();
                    this.txbCorpFName.Value = corp.CorpFullName;
                    this.txbCorpFEName.Value = corp.CorpFullEName;
                    this.txbCorpAddress.Value = corp.CorpAddress;
                    this.txbCorpEAddress.Value = corp.CorpEAddress;
                    this.txbCorpTel.Value = corp.CorpTel;
                    this.txbCorpFax.Value = corp.CorpFax;
                    this.txbCorpZip.Value = corp.CorpZip;
                    this.hidCorpType.Value = corp.CorpType.ToString();
                }
            }
        }
Пример #5
0
        public void ProcessRequest(HttpContext context)
        {
            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;

            NFMT.User.BLL.CorporationBLL bll = new NFMT.User.BLL.CorporationBLL();
            var result = bll.Load(user);

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

            List<NFMT.User.Model.Corporation> cp = result.ReturnValue as List<NFMT.User.Model.Corporation>;

            string jsonStr = Newtonsoft.Json.JsonConvert.SerializeObject(cp);
            context.Response.Write(jsonStr);
        }
Пример #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string redirectUrl = string.Format("{0}Funds/ReceivableCorpReadyCorpList.aspx", NFMT.Common.DefaultValue.NftmSiteName);
            NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();
            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;

            if (!IsPostBack)
            {
                this.navigation1.Routes.Add("公司收款分配", string.Format("{0}Funds/ReceivableCorpList.aspx", NFMT.Common.DefaultValue.NftmSiteName));
                this.navigation1.Routes.Add("可收款分配公司列表", redirectUrl);
                this.navigation1.Routes.Add("公司收款分配新增", string.Empty);

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

                this.hidCorpId.Value = corpId.ToString();

                NFMT.User.BLL.CorporationBLL corporationBLL = new NFMT.User.BLL.CorporationBLL();
                result = corporationBLL.Get(user, corpId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                NFMT.User.Model.Corporation corp = result.ReturnValue as NFMT.User.Model.Corporation;
                if (corp != null)
                {
                    this.hidBlocId.Value = corp.ParentId.ToString();

                    NFMT.User.Model.Bloc bloc = NFMT.User.UserProvider.Blocs.SingleOrDefault(a => a.BlocId == corp.ParentId);
                    if (bloc != null)
                        this.spanBlocId.InnerText = bloc.BlocName;

                    this.spanCorpCode.InnerText = corp.CorpCode;
                    this.spanCorpName.InnerText = corp.CorpName;
                    this.spanTaxPlayer.InnerText = corp.TaxPayerId;
                    this.spanCorpAddress.InnerText = corp.CorpAddress;
                    this.spanCorpTel.InnerText = corp.CorpTel;
                    this.spanCorpFax.InnerText = corp.CorpFax;
                    this.spanCorpZip.InnerText = corp.CorpZip;
                }
            }
        }
Пример #7
0
        public void ProcessRequest(HttpContext context)
        {
            NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();
            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
            context.Response.ContentType = "text/plain";

            string corpStr = context.Request.Form["corp"];

            if (string.IsNullOrEmpty(corpStr))
            {
                context.Response.Write("公司内容为空");
                context.Response.End();
            }

            try
            {
                System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
                NFMT.User.Model.Corporation corp = serializer.Deserialize<NFMT.User.Model.Corporation>(corpStr);
                if (corp == null)
                {
                    context.Response.Write("数据错误");
                    context.Response.End();
                }
                NFMT.User.BLL.CorporationBLL bll = new NFMT.User.BLL.CorporationBLL();
                result = bll.Update(user, corp);
                if (result.ResultStatus == 0)
                {
                    result.Message = "修改成功";
                }
            }
            catch (Exception ex)
            {
                result.ResultStatus = -1;
                result.Message = ex.Message;
            }

            context.Response.Write(result.Message);
        }
Пример #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string redirectUrl = string.Format("{0}User/CorporationList.aspx", NFMT.Common.DefaultValue.NftmSiteName);
                NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
                NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();

                Utility.VerificationUtility ver = new Utility.VerificationUtility();
                ver.JudgeOperate(this.Page, 16, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.修改 });

                this.navigation1.Routes.Add("企业管理", redirectUrl);
                this.navigation1.Routes.Add("客户修改", string.Empty);

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

                NFMT.User.BLL.CorporationBLL corporationBLL = new NFMT.User.BLL.CorporationBLL();
                result = corporationBLL.Get(user, corpId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                corporation = result.ReturnValue as NFMT.User.Model.Corporation;
                if (corporation == null)
                    Response.Redirect(redirectUrl);

                NFMT.User.BLL.CorporationDetailBLL corporationDetailBLL = new NFMT.User.BLL.CorporationDetailBLL();
                result = corporationDetailBLL.GetByCorpId(user, corpId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                corpDetail = result.ReturnValue as NFMT.User.Model.CorporationDetail;
                if (corpDetail == null)
                    Response.Redirect(redirectUrl);
            }
        }
Пример #9
0
        public void ProcessRequest(HttpContext context)
        {
            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;

            context.Response.ContentType = "text/plain";

            int blocId = 0;
            string taxPlayer = context.Request.Form["taxPlayer"];
            string corpCode = context.Request.Form["corpCode"];
            string corpName = context.Request.Form["corpName"];
            string corpEName = context.Request.Form["corpEName"];
            string corpFName = context.Request.Form["corpFName"];
            string corpFEName = context.Request.Form["corpFEName"];
            string corpAddress = context.Request.Form["corpAddress"];
            string corpEAddress = context.Request.Form["corpEAddress"];
            string corpTel = context.Request.Form["corpTel"];
            string corpFax = context.Request.Form["corpFax"];
            string corpZip = context.Request.Form["corpZip"];
            int corpType = 0;

            string resultStr = "添加失败";
            if (string.IsNullOrEmpty(corpCode))
            {
                resultStr = "企业代码不能为空";
                context.Response.Write(resultStr);
                context.Response.End();
            }

            if (string.IsNullOrEmpty(corpName))
            {
                resultStr = "企业名称不能为空";
                context.Response.Write(resultStr);
                context.Response.End();
            }

            if (!string.IsNullOrEmpty(context.Request.Form["blocId"]))
            {
                if (!int.TryParse(context.Request.Form["blocId"], out blocId))
                {
                    resultStr = "所属集团转换错误";
                    context.Response.Write(resultStr);
                    context.Response.End();
                }
            }

            if (string.IsNullOrEmpty(context.Request.Form["taxPlayer"]))
            {
                resultStr = "纳税人识别号不能为空";
                context.Response.Write(resultStr);
                context.Response.End();
            }

            if (!string.IsNullOrEmpty(context.Request.Form["corpType"]))
            {
                if (!int.TryParse(context.Request.Form["corpType"], out corpType))
                {
                    resultStr = "企业类型转换错误";
                    context.Response.Write(resultStr);
                    context.Response.End();
                }
            }

            NFMT.Common.ResultModel result = null;
            NFMT.User.Model.Bloc bloc = null;
            NFMT.User.BLL.BlocBLL blocBLL = new NFMT.User.BLL.BlocBLL();

            if (blocId != 0)
            {
                result = blocBLL.Get(user, blocId);
                if (result.ResultStatus != 0)
                {
                    resultStr = "获取集团错误";
                    context.Response.Write(resultStr);
                    context.Response.End();
                }

                bloc = result.ReturnValue as NFMT.User.Model.Bloc;
            }

            NFMT.User.Model.Corporation corp = new NFMT.User.Model.Corporation()
            {
                ParentId = blocId,
                CorpCode = corpCode,
                CorpName = corpName,
                CorpEName = corpEName,
                TaxPayerId = taxPlayer,
                CorpFullName = corpFName,
                CorpFullEName = corpFEName,
                CorpAddress = corpAddress,
                CorpEAddress = corpEAddress,
                CorpTel = corpTel,
                CorpFax = corpFax,
                CorpZip = corpZip,
                CorpType = corpType,
                IsSelf = bloc != null ? bloc.IsSelf : false
            };

            NFMT.User.BLL.CorporationBLL corpBLL = new NFMT.User.BLL.CorporationBLL();
            result = corpBLL.Insert(user, corp);
            resultStr = result.Message;

            context.Response.Write(resultStr);
        }
Пример #10
0
        public void ProcessRequest(HttpContext context)
        {
            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;

            int status = -1, blocId = 0;
            int pageIndex = 0, pageSize = 10;
            string orderStr = string.Empty, whereStr = string.Empty;

            string CorpCode = context.Request["Code"];//公司代码
            string CorpName = context.Request["Name"];//公司名称

            if (!string.IsNullOrEmpty(context.Request["s"]))
                int.TryParse(context.Request["s"], out status);//状态查询条件

            if (!string.IsNullOrEmpty(context.Request["blocId"]))
                int.TryParse(context.Request["blocId"], out blocId);//归属集团查询条件

            int isSelf = -1;
            if (!string.IsNullOrEmpty(context.Request["self"]))
            {
                if (!int.TryParse(context.Request["self"], out isSelf))
                    isSelf = -1;
            }

            //jqwidgets jqxGrid
            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 "IsSelf":
                        sortDataField = "C.IsSelf";
                        break;
                }

                orderStr = string.Format("{0} {1}", sortDataField, sortOrder);
            }

            NFMT.User.BLL.CorporationBLL corporationBLL = new NFMT.User.BLL.CorporationBLL();
            NFMT.Common.SelectModel select = corporationBLL.GetSelectModel(pageIndex, pageSize, orderStr, status, CorpCode, CorpName, blocId, isSelf);
            NFMT.Common.ResultModel result = corporationBLL.Load(user, select);

            context.Response.ContentType = "application/json; charset=utf-8";
            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>();

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

            string jsonStr = Newtonsoft.Json.JsonConvert.SerializeObject(dic, new Newtonsoft.Json.Converters.DataTableConverter());
            context.Response.Write(jsonStr);
        }