Ejemplo n.º 1
0
        protected bool show = false;//是否查看
        #endregion

        protected void Page_Load(object sender, EventArgs e)
        {
            //实例化业务逻辑类和实体类
            Insurancemodel = new EyouSoft.Model.SupplierStructure.SupplierInsurance();
            Insurancebll   = new EyouSoft.BLL.SupplierStructure.SupplierInsurance();

            //省份和城市初始化
            this.ucProvince1.CompanyId = CurrentUserCompanyID;
            this.ucProvince1.IsFav     = true;
            this.ucCity1.CompanyId     = CurrentUserCompanyID;
            this.ucCity1.IsFav         = true;

            if (!IsPostBack)
            {
                bindProandCity();
                if (CheckGrant(global::Common.Enum.TravelPermission.供应商管理_保险_栏目))
                {
                    //操作类型 修改or添加
                    type = Utils.GetQueryStringValue("type");
                    switch (type)
                    {
                    case "modify":
                        if (CheckGrant(global::Common.Enum.TravelPermission.供应商管理_保险_修改))
                        {
                            bind();
                        }
                        else
                        {
                            Utils.ResponseNoPermit(global::Common.Enum.TravelPermission.供应商管理_保险_修改, false);
                        }
                        break;

                    case "show":

                        show = true;
                        bind();

                        break;

                    default:
                        if (!CheckGrant(global::Common.Enum.TravelPermission.供应商管理_保险_新增))
                        {
                            Utils.ResponseNoPermit(global::Common.Enum.TravelPermission.供应商管理_保险_新增, false);
                        }
                        break;
                    }
                }
            }
        }
Ejemplo n.º 2
0
        private void loadXls()
        {
            string data = Utils.GetFormValue("dataxls");

            string[] s = data.Split(';');
            EyouSoft.BLL.SupplierStructure.SupplierInsurance           insurancebll   = new EyouSoft.BLL.SupplierStructure.SupplierInsurance();
            IList <EyouSoft.Model.SupplierStructure.SupplierInsurance> insurancemodel = new List <EyouSoft.Model.SupplierStructure.SupplierInsurance>();

            for (int i = 0; i < s.Length; i++)
            {
                string[] smodel = s[i].Split(',');
                if (smodel.Length == 11 && !string.IsNullOrEmpty(smodel[0]) && !string.IsNullOrEmpty(smodel[1]) && !string.IsNullOrEmpty(smodel[2]))
                {
                    EyouSoft.Model.SupplierStructure.SupplierInsurance slmodel = new EyouSoft.Model.SupplierStructure.SupplierInsurance();
                    slmodel.ProvinceName = HttpUtility.UrlDecode(smodel[0]);
                    slmodel.CityName     = HttpUtility.UrlDecode(smodel[1]);
                    slmodel.UnitName     = HttpUtility.UrlDecode(smodel[2]);
                    slmodel.UnitAddress  = HttpUtility.UrlDecode(smodel[3]);

                    slmodel.SupplierContact = new List <EyouSoft.Model.CompanyStructure.SupplierContact>();
                    EyouSoft.Model.CompanyStructure.SupplierContact scmodel = new EyouSoft.Model.CompanyStructure.SupplierContact();
                    scmodel.ContactName   = HttpUtility.UrlDecode(smodel[4]);
                    scmodel.JobTitle      = HttpUtility.UrlDecode(smodel[5]);
                    scmodel.ContactTel    = HttpUtility.UrlDecode(smodel[6]);
                    scmodel.ContactMobile = HttpUtility.UrlDecode(smodel[7]);
                    scmodel.QQ            = HttpUtility.UrlDecode(smodel[8]);
                    scmodel.Email         = HttpUtility.UrlDecode(smodel[9]);
                    scmodel.CompanyId     = SiteUserInfo.CompanyID;
                    slmodel.SupplierContact.Add(scmodel);

                    slmodel.Remark        = HttpUtility.UrlDecode(smodel[10]);
                    slmodel.OperatorId    = SiteUserInfo.ID;
                    slmodel.IssueTime     = DateTime.Now;
                    slmodel.CompanyId     = CurrentUserCompanyID;
                    slmodel.AgreementFile = string.Empty;
                    slmodel.IsDelete      = false;
                    slmodel.SupplierType  = EyouSoft.Model.EnumType.CompanyStructure.SupplierType.保险;
                    slmodel.TradeNum      = 0;
                    insurancemodel.Add(slmodel);
                }
            }
            int res = 0;

            res = insurancebll.AddList(insurancemodel);

            Response.Clear();
            Response.Write(string.Format("{{\"res\":{0}}}", res > 0 ? 1 : -1));
            Response.End();
        }
Ejemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //初始化保险业务逻辑类和实体类
            Insurancebll   = new EyouSoft.BLL.SupplierStructure.SupplierInsurance();
            Insurancemodle = new EyouSoft.Model.SupplierStructure.SupplierInsurance();

            //权限判断
            if (!CheckGrant(global::Common.Enum.TravelPermission.供应商管理_保险_栏目))
            {
                Utils.ResponseNoPermit(global::Common.Enum.TravelPermission.供应商管理_保险_栏目, true);
            }
            grantadd    = CheckGrant(global::Common.Enum.TravelPermission.供应商管理_保险_新增);
            grantdel    = CheckGrant(global::Common.Enum.TravelPermission.供应商管理_保险_删除);
            grantmodify = CheckGrant(global::Common.Enum.TravelPermission.供应商管理_保险_修改);
            grantto     = CheckGrant(global::Common.Enum.TravelPermission.供应商管理_保险_导出);
            grantload   = CheckGrant(global::Common.Enum.TravelPermission.供应商管理_保险_导入);

            if (!this.Page.IsPostBack)
            {
                //操作类型 删除or导出excel
                action = Utils.GetQueryStringValue("action");
                switch (action)
                {
                case "toexcel":
                {
                    if (grantto)
                    {
                        CreateExcel("Insurance" + DateTime.Now.ToShortDateString());
                    }
                }
                break;

                case "Insurancedel":
                {
                    if (grantdel)
                    {
                        InsuranceDel();
                    }
                }
                break;

                default:
                    DataInit();
                    break;
                }
            }
        }