Beispiel #1
0
        /// <summary>
        /// 修改时勾选listbox
        /// </summary>
        /// <param name="user"></param>
        /// <param name="clauseContract"></param>
        /// <param name="masterId"></param>
        /// <param name="isCreate"></param>
        /// <param name="contractId"></param>
        /// <returns></returns>
        private System.Text.StringBuilder UpdateCheckItems(UserModel user, int contractId)
        {
            System.Text.StringBuilder sb = new System.Text.StringBuilder();

            try
            {
                ContractClauseDAL dal = new ContractClauseDAL();
                NFMT.Common.ResultModel result = dal.LoadByContractId(user, contractId);
                if (result.ResultStatus != 0)
                    return sb.Clear();

                List<Model.ContractClause> contractClauses = result.ReturnValue as List<Model.ContractClause>;
                if (contractClauses == null || !contractClauses.Any())
                    return sb.Clear();

                foreach (Model.ContractClause contractClause in contractClauses.OrderBy(a => a.ClauseId))
                {
                    sb.AppendFormat("var item = $(\"#listbox_\"+{0}).jqxListBox(\"getItemByValue\", \"{1}\");", string.Format("masterIds.indexOf({0})", contractClause.MasterId), contractClause.ClauseId);
                    sb.AppendFormat("$(\"#listbox_\"+{0}).jqxListBox(\"removeItem\",item);", string.Format("masterIds.indexOf({0})", contractClause.MasterId));
                    sb.AppendFormat("$(\"#listbox_\"+{0}).jqxListBox(\"insertAt\",item, 0);", string.Format("masterIds.indexOf({0})", contractClause.MasterId));
                    sb.AppendFormat("$(\"#listbox_\"+{0}).jqxListBox(\"checkIndex\",0);", string.Format("masterIds.indexOf({0})", contractClause.MasterId));
                    sb.Append(Environment.NewLine);
                }
            }
            catch
            {
                return sb.Clear();
            }

            return sb;
        }
Beispiel #2
0
        internal ResultModel Create(NFMT.Common.UserModel user, Contract.Model.Contract contract, Model.ContractDetail contractDetail, Model.ContractPrice contractPrice, List<Model.ContractCorporationDetail> outCorps, List<Model.ContractCorporationDetail> inCorps, List<Model.ContractDept> depts, List<NFMT.Contract.Model.ContractClause> contractClauses,List<Model.ContractTypeDetail> contractTypes = null)
        {
            ResultModel result = new ResultModel();

            try
            {
                DAL.ContractDetailDAL detailDAL = new ContractDetailDAL();
                DAL.ContractPriceDAL priceDAL = new ContractPriceDAL();
                DAL.ContractCorporationDetailDAL corpDAL = new ContractCorporationDetailDAL();
                DAL.ContractDeptDAL deptDAL = new ContractDeptDAL();
                NFMT.User.DAL.CorporationDAL dal = new User.DAL.CorporationDAL();

                result = this.ValidateAuth(user, contract, outCorps, inCorps);
                if (result.ResultStatus != 0)
                    return result;

                contract.ContractStatus = StatusEnum.已录入;
                result = contractDAL.Insert(user, contract);
                if (result.ResultStatus != 0)
                    return result;
                //获取合约序号
                int contractId = (int)result.ReturnValue;

                contractDetail.ContractId = contractId;
                contractDetail.MoreOrLess = contractDetail.MoreOrLess / 100;
                contractDetail.DiscountRate = contractDetail.DiscountRate / 100;
                result = detailDAL.Insert(user, contractDetail);
                if (result.ResultStatus != 0)
                    return result;

                contractPrice.ContractId = contractId;
                result = priceDAL.Insert(user, contractPrice);
                if (result.ResultStatus != 0)
                    return result;

                NFMT.User.Model.Corporation outCorpTemp = null;
                //新增合约对方抬头明细
                foreach (ContractCorporationDetail corp in outCorps)
                {
                    NFMT.User.Model.Corporation c = NFMT.User.UserProvider.Corporations.FirstOrDefault(temp => temp.CorpId == corp.CorpId);
                    if (c == null || c.CorpId <= 0)
                        return result;

                    if (outCorpTemp == null)
                        outCorpTemp = c;
                    if ((outCorpTemp.ParentId == 0 && outCorps.Count > 1) || (outCorpTemp.ParentId != c.ParentId))
                    {
                        result.ResultStatus = -1;
                        result.Message = "选择的外部公司不属于同一集团";
                        return result;
                    }

                    corp.ContractId = contractId;
                    corp.CorpName = c.CorpName;
                    corp.IsInnerCorp = false;
                    if (outCorps.IndexOf(corp) == 0)
                        corp.IsDefaultCorp = true;
                    else
                        corp.IsDefaultCorp = false;
                    corp.DetailStatus = StatusEnum.已生效;

                    result = corpDAL.Insert(user, corp);
                    if (result.ResultStatus != 0)
                        return result;
                }

                //新增己方合约抬头明细
                foreach (ContractCorporationDetail corp in inCorps)
                {
                    result = dal.Get(user, corp.CorpId);
                    if (result.ResultStatus != 0)
                        return result;

                    NFMT.User.Model.Corporation c = result.ReturnValue as NFMT.User.Model.Corporation;
                    if (c == null)
                        return result;
                    corp.CorpName = c.CorpName;
                    corp.ContractId = contractId;
                    corp.IsInnerCorp = true;
                    if (inCorps.IndexOf(corp) == 0)
                        corp.IsDefaultCorp = true;
                    else
                        corp.IsDefaultCorp = false;
                    corp.DetailStatus = StatusEnum.已生效;

                    result = corpDAL.Insert(user, corp);
                    if (result.ResultStatus != 0)
                        return result;
                }

                //新增执行部门
                foreach (Model.ContractDept dept in depts)
                {
                    dept.ContractId = contractId;
                    dept.DetailStatus = Common.StatusEnum.已生效;
                    result = deptDAL.Insert(user, dept);
                    if (result.ResultStatus != 0)
                        return result;
                }

                //新增合约类型明细
                if (contractTypes != null)
                {
                    DAL.ContractTypeDetailDAL contractTypeDAL = new ContractTypeDetailDAL();
                    foreach (Model.ContractTypeDetail contractType in contractTypes)
                    {
                        contractType.ContractId = contractId;
                        contractType.DetailStatus = StatusEnum.已生效;
                        result = contractTypeDAL.Insert(user, contractType);
                        if (result.ResultStatus != 0)
                            return result;
                    }
                }

                //新增合约条款
                if (contractClauses != null && contractClauses.Any())
                {
                    DAL.ContractClauseDAL contractClauseDAL = new ContractClauseDAL();
                    foreach (Model.ContractClause contractClause in contractClauses)
                    {
                        contractClause.ContractId = contractId;
                        result = contractClauseDAL.Insert(user, contractClause);
                        if (result.ResultStatus != 0)
                            return result;
                    }
                }

                if (result.ResultStatus == 0)
                {
                    contract.ContractId = contractId;
                    result.ReturnValue = contract;
                }

                //附件使用
                //创建方法最后返回业务数据Id
                if (result.ResultStatus == 0)
                {
                    contract.ContractId = contractId;
                    result.ReturnValue = contract;
                }
            }
            catch (Exception ex)
            {
                result.ResultStatus = -1;
                result.Message = ex.Message;
            }

            return result;
        }
Beispiel #3
0
        internal ResultModel Update(NFMT.Common.UserModel user, Contract.Model.Contract contract, Model.ContractDetail contractDetail, Model.ContractPrice contractPrice, List<Model.ContractCorporationDetail> outCorps, List<Model.ContractCorporationDetail> inCorps, List<Model.ContractDept> depts, List<NFMT.Contract.Model.ContractClause> contractClauses, List<Model.ContractTypeDetail> contractTypes = null)
        {
            ResultModel result = new ResultModel();

            try
            {
                DAL.ContractDetailDAL detailDAL = new ContractDetailDAL();
                DAL.ContractPriceDAL priceDAL = new ContractPriceDAL();
                DAL.ContractCorporationDetailDAL corpDAL = new ContractCorporationDetailDAL();
                DAL.ContractDeptDAL deptDAL = new ContractDeptDAL();

                if (contract == null)
                {
                    result.Message = "合约不存在";
                    return result;
                }

                result = this.ValidateAuth(user, contract, outCorps, inCorps);
                if (result.ResultStatus != 0)
                    return result;

                result = contractDAL.Get(user, contract.ContractId);
                if (result.ResultStatus != 0)
                    return result;

                NFMT.Contract.Model.Contract resultObj = result.ReturnValue as NFMT.Contract.Model.Contract;
                if (resultObj == null)
                {
                    result.Message = "合约不存在";
                    return result;
                }

                //合约更新
                resultObj.ContractDate = contract.ContractDate;
                resultObj.OutContractNo = contract.OutContractNo;
                resultObj.Premium = contract.Premium;
                resultObj.TradeBorder = contract.TradeBorder;
                resultObj.ContractLimit = contract.ContractLimit;
                resultObj.TradeDirection = contract.TradeDirection;
                resultObj.ContractPeriodS = contract.ContractPeriodS;
                resultObj.ContractPeriodE = contract.ContractPeriodE;
                resultObj.InitQP = contract.InitQP;
                resultObj.AssetId = contract.AssetId;
                resultObj.SettleCurrency = contract.SettleCurrency;
                resultObj.SignAmount = contract.SignAmount;
                resultObj.UnitId = contract.UnitId;
                resultObj.PriceMode = contract.PriceMode;
                resultObj.Memo = contract.Memo;
                resultObj.DeliveryStyle = contract.DeliveryStyle;
                resultObj.DeliveryDate = contract.DeliveryDate;

                result = contractDAL.Update(user, resultObj);
                if (result.ResultStatus != 0)
                    return result;

                //明细更新
                result = detailDAL.GetDetailByContractId(user, contract.ContractId);
                if (result.ResultStatus != 0)
                    return result;
                NFMT.Contract.Model.ContractDetail resultDetail = result.ReturnValue as NFMT.Contract.Model.ContractDetail;
                if (resultDetail == null)
                {
                    result.Message = "明细不存在";
                    return result;
                }

                resultDetail.DiscountBase = contractDetail.DiscountBase;
                //resultDetail.DiscountType = contractDetail.DiscountType;
                resultDetail.DiscountRate = contractDetail.DiscountRate / 100;
                resultDetail.DelayType = contractDetail.DelayType;
                resultDetail.DelayRate = contractDetail.DelayRate;
                resultDetail.MoreOrLess = contractDetail.MoreOrLess / 100;

                resultDetail.Status = resultObj.Status;

                result = detailDAL.Update(user, resultDetail);
                if (result.ResultStatus != 0)
                    return result;

                //价格更新
                result = priceDAL.GetPriceByContractId(user, contract.ContractId);
                if (result.ResultStatus != 0)
                    return result;
                NFMT.Contract.Model.ContractPrice resultPrice = result.ReturnValue as NFMT.Contract.Model.ContractPrice;
                if (resultPrice == null)
                {
                    result.Message = "合约价格不存在";
                    return result;
                }
                resultPrice.FixedPrice = contractPrice.FixedPrice;
                resultPrice.FixedPriceMemo = contractPrice.FixedPriceMemo;
                resultPrice.WhoDoPrice = contractPrice.WhoDoPrice;
                resultPrice.DoPriceBeginDate = contractPrice.DoPriceBeginDate;
                resultPrice.DoPriceEndDate = contractPrice.DoPriceEndDate;
                resultPrice.IsQP = contractPrice.IsQP;
                resultPrice.PriceFrom = contractPrice.PriceFrom;
                resultPrice.PriceStyle1 = contractPrice.PriceStyle1;
                resultPrice.PriceStyle2 = contractPrice.PriceStyle2;
                resultPrice.MarginMode = contractPrice.MarginMode;
                resultPrice.MarginAmount = contractPrice.MarginAmount;
                resultPrice.MarginMemo = contractPrice.MarginMemo;
                resultPrice.AlmostPrice = contractPrice.AlmostPrice;

                resultPrice.Status = resultObj.Status;

                result = priceDAL.Update(user, resultPrice);
                if (result.ResultStatus != 0)
                    return result;

                //更新抬头
                //外部公司
                result = corpDAL.LoadCorpListByContractId(user, contract.ContractId, false);
                if (result.ResultStatus != 0)
                    return result;

                List<NFMT.Contract.Model.ContractCorporationDetail> ocs = result.ReturnValue as List<NFMT.Contract.Model.ContractCorporationDetail>;
                if (ocs == null || ocs.Count == 0)
                {
                    result.Message = "外部公司更新错误";
                    return result;
                }
                foreach (NFMT.Contract.Model.ContractCorporationDetail c in ocs)
                {
                    if (c.DetailStatus == StatusEnum.已生效)
                        c.DetailStatus = StatusEnum.已录入;

                    result = corpDAL.Invalid(user, c);
                    if (result.ResultStatus != 0)
                        return result;
                }

                NFMT.User.Model.Corporation outCorpTemp = null;

                foreach (ContractCorporationDetail corp in outCorps)
                {
                    NFMT.User.Model.Corporation c = NFMT.User.UserProvider.Corporations.FirstOrDefault(temp => temp.CorpId == corp.CorpId);
                    if (c == null || c.CorpId <= 0)
                        return result;

                    if (outCorpTemp == null)
                        outCorpTemp = c;
                    if ((outCorpTemp.ParentId == 0 && outCorps.Count > 1) || (outCorpTemp.ParentId != c.ParentId))
                    {
                        result.ResultStatus = -1;
                        result.Message = "选择的外部公司不属于同一集团";
                        return result;
                    }

                    corp.ContractId = contract.ContractId;
                    corp.CorpName = c.CorpName;
                    corp.IsInnerCorp = false;
                    if (outCorps.IndexOf(corp) == 0)
                        corp.IsDefaultCorp = true;
                    else
                        corp.IsDefaultCorp = false;
                    corp.DetailStatus = StatusEnum.已生效;

                    result = corpDAL.Insert(user, corp);
                    if (result.ResultStatus != 0)
                        return result;
                }

                //内部公司
                result = corpDAL.LoadCorpListByContractId(user, contract.ContractId, true);
                if (result.ResultStatus != 0)
                    return result;

                ocs = result.ReturnValue as List<NFMT.Contract.Model.ContractCorporationDetail>;
                if (ocs == null || ocs.Count == 0)
                {
                    result.Message = "内部公司更新错误";
                    return result;
                }
                foreach (NFMT.Contract.Model.ContractCorporationDetail c in ocs)
                {
                    if (c.DetailStatus == StatusEnum.已生效)
                        c.DetailStatus = StatusEnum.已录入;

                    result = corpDAL.Invalid(user, c);
                    if (result.ResultStatus != 0)
                        return result;
                }

                foreach (ContractCorporationDetail corp in inCorps)
                {
                    NFMT.User.Model.Corporation c = NFMT.User.UserProvider.Corporations.FirstOrDefault(temp => temp.CorpId == corp.CorpId);

                    if (c == null || c.CorpId <= 0)
                        return result;
                    corp.CorpName = c.CorpName;
                    corp.ContractId = contract.ContractId;
                    corp.IsInnerCorp = true;
                    if (inCorps.IndexOf(corp) == 0)
                        corp.IsDefaultCorp = true;
                    else
                        corp.IsDefaultCorp = false;
                    corp.DetailStatus = StatusEnum.已生效;

                    result = corpDAL.Insert(user, corp);
                    if (result.ResultStatus != 0)
                        return result;
                }

                //更新执行部门
                result = deptDAL.LoadDeptByContractId(user, contract.ContractId);
                if (result.ResultStatus != 0)
                    return result;
                List<NFMT.Contract.Model.ContractDept> ds = result.ReturnValue as List<NFMT.Contract.Model.ContractDept>;
                foreach (NFMT.Contract.Model.ContractDept d in ds)
                {
                    if (d.DetailStatus == StatusEnum.已生效)
                        d.DetailStatus = StatusEnum.已录入;

                    result = deptDAL.Invalid(user, d);
                    if (result.ResultStatus != 0)
                        return result;
                }

                foreach (Model.ContractDept dept in depts)
                {
                    dept.ContractId = contract.ContractId;
                    dept.DetailStatus = Common.StatusEnum.已生效;
                    result = deptDAL.Insert(user, dept);
                    if (result.ResultStatus != 0)
                        return result;
                }

                //更新合约类型
                DAL.ContractTypeDetailDAL contractTypeDAL = new ContractTypeDetailDAL();
                result = contractTypeDAL.LoadContractTypesById(user,resultObj.ContractId);
                if(result.ResultStatus!=0)
                    return result;
                List<Model.ContractTypeDetail> resultContractTypes = result.ReturnValue as List<Model.ContractTypeDetail>;
                if(resultContractTypes == null)
                {
                    result.Message="获取合约类型失败";
                    result.ResultStatus=-1;
                    return result;
                }

                //作废原有合约类型
                foreach(Model.ContractTypeDetail contractType in resultContractTypes)
                {
                    contractType.DetailStatus = StatusEnum.已录入;
                    result = contractTypeDAL.Invalid(user,contractType);
                    if(result.ResultStatus!=0)
                        return result;
                }

                //新增新的合约类型
                foreach (Model.ContractTypeDetail contractType in contractTypes)
                {
                    contractType.ContractId = resultObj.ContractId;
                    contractType.DetailStatus = StatusEnum.已生效;
                    result = contractTypeDAL.Insert(user, contractType);
                    if (result.ResultStatus != 0)
                        return result;
                }

                //作废所有关联合约条款
                DAL.ContractClauseDAL contractClauseDAL = new ContractClauseDAL();
                result = contractClauseDAL.InvalidAll(user, contract.ContractId);
                if (result.ResultStatus != 0)
                    return result;

                if (contractClauses != null && contractClauses.Any())
                {
                    foreach (Model.ContractClause contractClause in contractClauses)
                    {
                        contractClause.ContractId = contract.ContractId;
                        contractClause.RefStatus = StatusEnum.已生效;
                        result = contractClauseDAL.Insert(user, contractClause);
                        if (result.ResultStatus != 0)
                            return result;
                    }
                }
            }
            catch (Exception ex)
            {
                result.ResultStatus = -1;
                result.Message = ex.Message;
            }

            return result;
        }
Beispiel #4
0
        /// <summary>
        /// 动态生成控件绑定javascript代码
        /// </summary>
        /// <param name="user"></param>
        /// <param name="isCreate">是否在新增时调用</param>
        /// <returns></returns>
        public string GetListBoxsInit(UserModel user, OperateEnum operate, int contractId)
        {
            try
            {
                List<NFMT.Data.Model.ClauseContract> clauseContracts = GetClauseContracts(user);
                if (clauseContracts == null || !clauseContracts.Any())
                    return string.Empty;

                System.Text.StringBuilder sb = new System.Text.StringBuilder();
                System.Text.StringBuilder sbCheck = new System.Text.StringBuilder();
                System.Text.StringBuilder sbMasterIdsArray = new System.Text.StringBuilder();
                NFMT.Data.BLL.ContractClauseBLL contractClauseBLL = new NFMT.Data.BLL.ContractClauseBLL();
                NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();

                sb.Append("$(\"#jqxTabs\").jqxTabs({ width: \"99%\", position: \"top\" }); ");
                sb.Append(Environment.NewLine);

                int i = 0;
                foreach (int masterId in clauseContracts.Select(a => a.MasterId).Distinct())
                {
                    if (i == 1)
                    {
                        sb.Append("$('#jqxTabs').on('selected', function (event) {");
                        sb.Append(Environment.NewLine);
                        sb.Append("var clickedItem = event.args.item;");
                        sb.Append(Environment.NewLine);
                    }
                    if (i != 0)
                    {
                        sb.AppendFormat("if(clickedItem =={0}&&is{0}Inited==false) ", i.ToString());
                        sb.Append("{");
                    }

                    sb.Append("var localdataArray = [");
                    foreach (NFMT.Data.Model.ClauseContract clauseContract in clauseContracts.Where(a => a.MasterId == masterId).OrderByDescending(a => a.IsChose).ThenBy(b => b.Sort))
                    {
                        result = contractClauseBLL.Get(user, clauseContract.ClauseId);
                        if (result.ResultStatus != 0)
                            continue;
                        NFMT.Data.Model.ContractClause contractClause = result.ReturnValue as NFMT.Data.Model.ContractClause;
                        if (contractClause == null)
                            continue;

                        sb.AppendFormat("[\"{0}\",\"{1}\"],", clauseContract.ClauseId.ToString(), contractClause.ClauseText);

                        //勾选
                        if (operate == OperateEnum.新增)
                            sbCheck.Append(CreateCheckItems(user, clauseContract, masterId, i));
                    }
                    if (!string.IsNullOrEmpty(sb.ToString()))
                        sb = sb.Remove(sb.Length - 1, 1);

                    sb.Append("];");
                    sb.Append(Environment.NewLine);

                    sb.AppendFormat("var source{0}=", masterId.ToString());
                    sb.Append("{localdata:localdataArray,async:false ,datatype:\"array\",datafields: [{ name: \"id\",type: \"int\", map: \"0\" },{ name: \"name\",type: \"string\", map: \"1\"}]};");

                    sb.Append(Environment.NewLine);
                    sb.Append("try{");

                    sb.Append(Environment.NewLine);
                    sb.AppendFormat("var listboxDataAdapter{0} = new $.jqx.dataAdapter(source{0});", masterId.ToString());
                    sb.Append(Environment.NewLine);
                    sb.AppendFormat("$(\"#listbox_{0}\").jqxListBox( ", i.ToString());
                    sb.Append("{ ");
                    sb.AppendFormat("source: listboxDataAdapter{0}, checkboxes: true,displayMember: \"name\", valueMember: \"id\",autoHeight:true,width:\"99%\",allowDrag:true,autoItemsHeight: true ", masterId.ToString());
                    sb.Append(Environment.NewLine);

                    sbMasterIdsArray.Append(Environment.NewLine);
                    sbMasterIdsArray.AppendFormat("masterIds.push({0});", masterId);
                    sbMasterIdsArray.Append(Environment.NewLine);
                    sbMasterIdsArray.AppendFormat(" var is{0}Inited = false;", i.ToString());

                    sb.Append("}); ");
                    sb.Append(Environment.NewLine);
                    sb.AppendFormat("is{0}Inited = true;", i.ToString());
                    sb.Append(Environment.NewLine);
                    sb.Append(sbCheck);
                    sb.Append(Environment.NewLine);
                    sb.Append("}catch(e){alert(e.Message);}");
                    sb.Append(Environment.NewLine);

                    if (i != 0)
                        sb.Append("}");

                    i++;

                }
                if (i > 1)
                    sb.Append("})");

                //勾选
                if (operate == OperateEnum.修改 || operate == OperateEnum.明细)
                {
                    ContractClauseDAL dal = new ContractClauseDAL();
                    result = dal.LoadByContractId(user, contractId);
                    if (result.ResultStatus == 0)
                    {
                        List<Model.ContractClause> contractClauses = result.ReturnValue as List<Model.ContractClause>;
                        if (contractClauses != null && contractClauses.Any())
                        {
                            int masterId = contractClauses.First().MasterId;

                            sbCheck.AppendFormat("$('#jqxTabs').jqxTabs('select', {0}); ", string.Format("masterIds.indexOf({0})", masterId));
                            sbCheck.Append("for(var i =0;i<masterIds.length;i++){");
                            sbCheck.AppendFormat("if(masterIds[i]=={0})", masterId);
                            sbCheck.Append("{continue;}");
                            if (operate == OperateEnum.明细)
                                sbCheck.Append("$('#jqxTabs').jqxTabs('removeAt', i);");
                            //else
                            //    sbCheck.Append("$('#jqxTabs').jqxTabs('disableAt', i);");
                            sbCheck.Append("}");

                            sbCheck.Append(UpdateCheckItems(user, contractId));
                            if (operate == OperateEnum.明细)
                            {
                                sbCheck.AppendFormat("var items = $(\"#listbox_\"+{0}).jqxListBox('getItems');", string.Format("masterIds.indexOf({0})", masterId));
                                sbCheck.Append("var i =items.length-1;");
                                sbCheck.Append("for(;i>=0;i--){if(items[i].checked==false){");
                                sbCheck.AppendFormat("$(\"#listbox_\"+{0}).jqxListBox('removeItem', items[i]);", string.Format("masterIds.indexOf({0})", masterId));
                                sbCheck.Append("}}");
                            }

                            sbCheck.Append(Environment.NewLine);

                            if (operate == OperateEnum.明细)
                                sbCheck.AppendFormat("$(\"#listbox_\"+{0}).jqxListBox(\"disabled\",true);", string.Format("masterIds.indexOf({0})", masterId));
                        }
                    }
                }
                else
                    sbCheck.Clear();

                return sbMasterIdsArray.Append(sb).Append(Environment.NewLine).Append(sbCheck).Append(Environment.NewLine).ToString();
            }
            catch
            {
                return string.Empty;
            }
        }