protected void Page_Load(object sender, EventArgs e)
        {
            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
            string redirectUrl = "CashInAllotList.aspx";
            System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();

            if (!IsPostBack)
            {
                Utility.VerificationUtility ver = new Utility.VerificationUtility();
                ver.JudgeOperate(this.Page, 56, 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) || corpId <= 0)
                    Response.Redirect(redirectUrl);

                NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();

                //公司信息
                NFMT.User.Model.Corporation corp = NFMT.User.UserProvider.Corporations.FirstOrDefault(temp => temp.CorpId == corpId);
                if (corp == null || corp.CorpId <= 0)
                    Response.Redirect(redirectUrl);

                this.curCorp = corp;

                this.curSelectedStr = "{}";
            }
        }
Example #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;
            }
        }
Example #3
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);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
            string redirectUrl = string.Format("{0}Funds/ReceivableCorpList.aspx", NFMT.Common.DefaultValue.NftmSiteName);
            System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();

            if (!IsPostBack)
            {
                this.navigation1.Routes.Add("公司收款分配", redirectUrl);
                this.navigation1.Routes.Add("公司收款分配修改", string.Empty);

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

                NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();

                //获取分配
                NFMT.Funds.BLL.ReceivableAllotBLL allotBLL = new NFMT.Funds.BLL.ReceivableAllotBLL();
                result = allotBLL.Get(user, receivableAllotId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                NFMT.Funds.Model.ReceivableAllot recAllot = result.ReturnValue as NFMT.Funds.Model.ReceivableAllot;
                if (recAllot == null || recAllot.ReceivableAllotId <= 0)
                    Response.Redirect(redirectUrl);

                this.curRecAllot = recAllot;
                this.currencyId = recAllot.CurrencyId;

                //获取分配明细列表
                NFMT.Funds.BLL.RecAllotDetailBLL recAllotDetailBLL = new NFMT.Funds.BLL.RecAllotDetailBLL();
                result = recAllotDetailBLL.Load(user, recAllot.ReceivableAllotId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                List<NFMT.Funds.Model.RecAllotDetail> details = result.ReturnValue as List<NFMT.Funds.Model.RecAllotDetail>;
                if (details == null)
                    Response.Redirect(redirectUrl);

                foreach (NFMT.Funds.Model.RecAllotDetail d in details)
                {
                    if (details.IndexOf(d) != 0)
                    {
                        this.curRids += ",";
                        this.curDids += ",";
                    }

                    this.curRids += d.RecId.ToString();
                    this.curDids += d.DetailId.ToString();
                }

                //获取分配公司明细列表
                NFMT.Funds.BLL.CorpReceivableBLL corpReceivalbleBLL = new NFMT.Funds.BLL.CorpReceivableBLL();
                result = corpReceivalbleBLL.Load(user, recAllot.ReceivableAllotId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                List<NFMT.Funds.Model.CorpReceivable> corpDetails = result.ReturnValue as List<NFMT.Funds.Model.CorpReceivable>;
                if (corpDetails == null)
                    Response.Redirect(redirectUrl);

                //公司信息
                if (corpDetails.Count == 0)
                    Response.Redirect(redirectUrl);

                NFMT.Funds.Model.CorpReceivable corpDetail = corpDetails[0];
                NFMT.User.Model.Corporation corp = NFMT.User.UserProvider.Corporations.FirstOrDefault(temp => temp.CorpId == corpDetail.CorpId);
                if (corp != null && corp.CorpId > 0)
                {
                    this.spanBlocId.InnerHtml = corp.BlocName;
                    this.spanCorpCode.InnerHtml = corp.CorpCode;
                    this.spanCorpName.InnerHtml = corp.CorpName;
                    this.spanTaxPlayer.InnerHtml = corp.TaxPayerId;
                    this.spanCorpAddress.InnerHtml = corp.CorpAddress;
                    this.spanCorpTel.InnerHtml = corp.CorpTel;
                    this.spanCorpFax.InnerHtml = corp.CorpFax;
                    this.spanCorpZip.InnerHtml = corp.CorpZip;

                    this.curCorp = corp;
                }
                this.isShare = corpDetail.IsShare;

                result = corpReceivalbleBLL.GetRowsDetail(user, receivableAllotId,NFMT.Common.StatusEnum.已作废);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                System.Data.DataTable dt = result.ReturnValue as System.Data.DataTable;
                this.curJsonStr = Newtonsoft.Json.JsonConvert.SerializeObject(dt);

                string json = serializer.Serialize(recAllot);
                this.hidModel.Value = json;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
            string redirectUrl = "CashInAllotList.aspx";
            System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();

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

                this.navigation1.Routes.Add("公司收款分配", redirectUrl);
                this.navigation1.Routes.Add("公司收款分配修改", string.Empty);

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

                NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();

                //获取收款分配
                NFMT.Funds.BLL.CashInAllotBLL allotBLL = new NFMT.Funds.BLL.CashInAllotBLL();
                result = allotBLL.Get(user, allotId);

                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                NFMT.Funds.Model.CashInAllot cashInAllot = result.ReturnValue as NFMT.Funds.Model.CashInAllot;
                if (cashInAllot == null || cashInAllot.AllotId <= 0)
                    Response.Redirect(redirectUrl);

                this.curAllot = cashInAllot;

                 //获取公司关联列表
                NFMT.Funds.BLL.CashInCorpBLL corpBLL = new NFMT.Funds.BLL.CashInCorpBLL();
                result = corpBLL.Load(user, allotId);
                if(result.ResultStatus!=0)
                    Response.Redirect(redirectUrl);

                List<NFMT.Funds.Model.CashInCorp> cashInCorps = result.ReturnValue as List<NFMT.Funds.Model.CashInCorp>;
                if (cashInCorps == null || cashInCorps.Count == 0)
                    Response.Redirect(redirectUrl);

                this.isShare = cashInCorps[0].IsShare;

                NFMT.User.Model.Corporation corp = NFMT.User.UserProvider.Corporations.FirstOrDefault(temp => temp.CorpId == cashInCorps[0].CorpId);
                if (corp == null || corp.CorpId <= 0)
                    Response.Redirect(redirectUrl);

                this.curCorp = corp;

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

                NFMT.Funds.BLL.CashInAllotDetailBLL bll = new NFMT.Funds.BLL.CashInAllotDetailBLL();
                NFMT.Common.SelectModel select = bll.GetCurDetailsSelect(pageIndex, pageSize, orderStr,cashInAllot.AllotId);
                result = bll.Load(user, select);

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

                this.curSelectedStr = Newtonsoft.Json.JsonConvert.SerializeObject(dt, new Newtonsoft.Json.Converters.DataTableConverter());

            }
        }
Example #6
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);
        }
Example #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Utility.VerificationUtility ver = new Utility.VerificationUtility();
                ver.JudgeOperate(this.Page, 37, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.查询 });

                NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
                NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();
                string redirectUrl = string.Format("{0}Contract/ContractList.aspx", NFMT.Common.DefaultValue.NftmSiteName);

                //this.navigation1.Routes.Add("合约列表", redirectUrl);
                //this.navigation1.Routes.Add("合约预览", string.Empty);

                int contractId = 0;
                if (string.IsNullOrEmpty(Request.QueryString["id"]) || !int.TryParse(Request.QueryString["id"], out contractId) || contractId <= 0)
                    Utility.JsUtility.WarmAlert(this.Page, "参数错误", redirectUrl);

                //获取合约
                NFMT.Contract.BLL.ContractBLL contractBLL = new NFMT.Contract.BLL.ContractBLL();
                result = contractBLL.Get(user, contractId);
                if (result.ResultStatus != 0)
                    Utility.JsUtility.WarmAlert(this.Page, result.Message, redirectUrl);

                contract = result.ReturnValue as NFMT.Contract.Model.Contract;
                if (contract == null)
                    Utility.JsUtility.WarmAlert(this.Page, "获取合约失败", redirectUrl);

                //获取品种
                asset = NFMT.Data.BasicDataProvider.Assets.SingleOrDefault(a => a.AssetId == contract.AssetId);
                if (asset == null)
                    Utility.JsUtility.WarmAlert(this.Page, "获取品种失败", redirectUrl);

                NFMT.Contract.BLL.ContractCorporationDetailBLL contractCorporationDetailBLL = new NFMT.Contract.BLL.ContractCorporationDetailBLL();

                //采购销售
                if (contract.TradeDirection == (int)NFMT.Contract.TradeDirectionEnum.采购)
                {
                    tradeDirection = "采购";
                    isSelf = true;
                }
                else if (contract.TradeDirection == (int)NFMT.Contract.TradeDirectionEnum.销售)
                {
                    tradeDirection = "销售";
                    isSelf = false;
                }

                //买方抬头
                result = contractCorporationDetailBLL.LoadByContractId(user, contractId, isSelf);
                if (result.ResultStatus != 0)
                    Utility.JsUtility.WarmAlert(this.Page, result.Message, redirectUrl);

                buyCorporationDetails = result.ReturnValue as List<NFMT.Contract.Model.ContractCorporationDetail>;
                if (buyCorporationDetails == null || !buyCorporationDetails.Any())
                    Utility.JsUtility.WarmAlert(this.Page, "获取买方抬头失败", redirectUrl);

                List<string> corpNames = new List<string>();
                buyCorporationDetails.ForEach(detail =>
                {
                    corp = NFMT.User.UserProvider.Corporations.SingleOrDefault(a => a.CorpId == detail.CorpId);
                    if (!corpNames.Contains(corp.CorpName))
                        corpNames.Add(corp.CorpName);
                });

                buyCorpName = string.Join(",", corpNames);

                if (string.IsNullOrEmpty(buyCorpName))
                    Utility.JsUtility.WarmAlert(this.Page, "获取买方抬头失败", redirectUrl);

                //卖方抬头
                result = contractCorporationDetailBLL.LoadByContractId(user, contractId, !isSelf);
                if (result.ResultStatus != 0)
                    Utility.JsUtility.WarmAlert(this.Page, result.Message, redirectUrl);

                sellCorporationDetails = result.ReturnValue as List<NFMT.Contract.Model.ContractCorporationDetail>;
                if (sellCorporationDetails == null || !sellCorporationDetails.Any())
                    Utility.JsUtility.WarmAlert(this.Page, "获取卖方抬头失败", redirectUrl);

                corpNames.Clear();
                sellCorporationDetails.ForEach(detail =>
                {
                    corp = NFMT.User.UserProvider.Corporations.SingleOrDefault(a => a.CorpId == detail.CorpId);
                    if (!corpNames.Contains(corp.CorpName))
                        corpNames.Add(corp.CorpName);
                });

                sellCorpName = string.Join(",", corpNames);

                if (string.IsNullOrEmpty(sellCorpName))
                    Utility.JsUtility.WarmAlert(this.Page, "获取卖方抬头失败", redirectUrl);

                //列表明细
                result = contractBLL.GetContractDetail(user, contractId, (NFMT.Contract.TradeDirectionEnum)contract.TradeDirection);
                //if (result.ResultStatus != 0)
                //    Utility.JsUtility.WarmAlert(this.Page, result.Message, redirectUrl);

                dt = result.ReturnValue as System.Data.DataTable;
                //if (dt == null || dt.Rows.Count < 1)
                //    Utility.JsUtility.WarmAlert(this.Page, "获取合约明细失败", redirectUrl);

                contractDetailStr = GetGridDetail(dt, contract);

                //合约条款
                NFMT.Contract.BLL.ContractClauseBLL contractClauseBLL = new NFMT.Contract.BLL.ContractClauseBLL();
                result = contractClauseBLL.LoadClauseByContractId(user, contractId);
                if (result.ResultStatus != 0)
                    Utility.JsUtility.WarmAlert(this.Page, result.Message, redirectUrl);

                List<NFMT.Data.Model.ContractClause> contractClauses = result.ReturnValue as List<NFMT.Data.Model.ContractClause>;
                if (contractClauses == null || !contractClauses.Any())
                    Utility.JsUtility.WarmAlert(this.Page, "获取合约条款失败", redirectUrl);

                contractClausesStr = GetMasterClause(contractClauses);
            }
        }