示例#1
0
        public object QueryDistrutionUserList(Pagination pagination, DistributionOEMUserCondition condition)
        {
            condition.CompanyId  = this.CurrentCompany.CompanyId;
            condition.IsOwnerAll = false;
            if (condition.RegisterEndTime.HasValue)
            {
                condition.RegisterEndTime = condition.RegisterEndTime.Value.AddDays(1).AddMilliseconds(-3);
            }
            var distributionOemUser = from item in DistributionOEMService.QueryDistributionOEMUserList(condition, pagination)
                                      select new
            {
                RegisterTime    = item.RegisterTime,
                Login           = item.Login,
                AbbreviateName  = item.AbbreviateName,
                IncomeGroupName = item.IncomeGroupName,
                IncomeGroupId   = item.IncomeGroupId,
                CompanyId       = item.CompanyId
            };

            return(new
            {
                Pagination = pagination,
                UserList = distributionOemUser
            });
        }
 private void queryDistributionOEM(Pagination pagination)
 {
     try
     {
         var distributionOEMList = DistributionOEMService.QueryDistributionOEMList(getCondition(), pagination);
         this.datalist.DataSource = distributionOEMList;
         datalist.DataBind();
         if (distributionOEMList.Rows.Count > 0)
         {
             pager.Visible = true;
             if (pagination.GetRowCount)
             {
                 pager.RowCount = pagination.RowCount;
             }
         }
         else
         {
             pager.Visible = false;
         }
     }
     catch (Exception ex)
     {
         ShowExceptionMessage(ex, "查询");
     }
 }
        private void initData()
        {
            this.incomeGroup.Visible  = false;
            this.hfdCompanyType.Value = this.CurrentCompany.CompanyType.ToString();
            txtPurchaseCompany.SetCompanyType(CompanyType.Provider | CompanyType.Purchaser | CompanyType.Supplier, true);
            var purchase = DistributionOEMService.QueryDistributionOEMUserList(new DistributionOEMUserCondition
            {
                CompanyId = this.CurrentCompany.CompanyId
            }, new Pagination
            {
                PageIndex = 1,
                PageSize  = int.MaxValue
            });

            this.ddlPurchaseCompany.DataSource = from item in purchase
                                                 select new
            {
                Text  = item.Login + "-" + item.AbbreviateName,
                Value = item.CompanyId
            };
            this.ddlPurchaseCompany.DataTextField  = "Text";
            this.ddlPurchaseCompany.DataValueField = "Value";
            this.ddlPurchaseCompany.DataBind();
            this.ddlPurchaseCompany.Items.Insert(0, new ListItem("全部", ""));
            this.hfdCompanyId.Value = this.CurrentCompany.CompanyId.ToString();
            this.txtStartDate.Text  = DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd");
            this.txtEndDate.Text    = DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd");
            if (this.CurrentCompany.CompanyType == CompanyType.Platform)
            {
                this.royalty.Visible            = true;
                this.txtPurchaseCompany.Visible = true;
                this.ddlPurchaseCompany.Visible = false;
                var royaltyCompany = DistributionOEMService.QueryDistributionOEM();
                this.ddlRoyaltyCompany.DataSource = from item in royaltyCompany
                                                    select new
                {
                    Text  = item.UserNo + "-" + item.AbbreivateName,
                    Value = item.CompanyId
                };
                this.ddlRoyaltyCompany.DataTextField  = "Text";
                this.ddlRoyaltyCompany.DataValueField = "Value";
                this.ddlRoyaltyCompany.DataBind();
                this.ddlRoyaltyCompany.Items.Insert(0, new ListItem("全部", ""));
            }
            else
            {
                this.incomeGroup.Visible        = true;
                this.txtPurchaseCompany.Visible = false;
                this.ddlPurchaseCompany.Visible = true;
                var incomeGroup = IncomeGroupService.QueryIncomeGroup(this.CurrentCompany.CompanyId, null);
                this.ddlIncomeGroup.DataSource     = incomeGroup;
                this.ddlIncomeGroup.DataTextField  = "Name";
                this.ddlIncomeGroup.DataValueField = "Id";
                this.ddlIncomeGroup.DataBind();
                this.ddlIncomeGroup.Items.Insert(0, new ListItem("全部", ""));
                this.royalty.Visible = false;
            }
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (fileImg.PostedFile.ContentLength > 51200)
            {
                ShowMessage("上传图片过大,请选择小图片。");
                return;
            }
            string path = "";

            try
            {
                path = fileImg.HasFile ? Service.FileService.Upload(fileImg, "OEMLogo", "(jpg)|(gif)|(png)|(jpeg)", 51200) : OldImgUrl.Text.Replace(FileWeb, "");
            }
            catch (Exception ex)
            {
                ShowExceptionMessage(ex, "上传图片");
                return;
            }
            DistributionOEM oem = new DistributionOEM()
            {
                SiteName       = txtName.Text,
                DomainName     = txtDomain.Text,
                ManageEmail    = txtEmail.Text,
                ICPRecord      = txtICP.Text,
                LogoPath       = path,
                EmbedCode      = txtEmbedCode.Text,
                Enabled        = radEnabled.Checked,
                AllowSelfRegex = radAllowSelfRegex.Checked
            };
            var oemold = OEMService.QueryOEM(Guid.Parse(Request.QueryString["id"]));

            oem.AirlineConfig   = oemold.AirlineConfig;
            oem.AuthCashDeposit = oemold.AuthCashDeposit;
            oem.CompanyId       = oemold.CompanyId;
            oem.Contract        = oemold.Contract;
            oem.EffectTime      = oemold.EffectTime;
            oem.RegisterTime    = oemold.RegisterTime;
            oem.Setting         = oemold.Setting;
            oem.UseB3BConfig    = oemold.UseB3BConfig;
            oem.OperatorAccount = oemold.OperatorAccount;
            oem.Id       = oemold.Id;
            oem.LoginUrl = oemold.LoginUrl;
            try
            {
                DistributionOEMService.UpdateDistributionOEM(oem);
            }
            catch (Exception ex)
            {
                ShowExceptionMessage(ex, "修改站点信息");
                return;
            }
            //刷新缓存
            FlushRequester.TriggerOEMFlusher(oem.Id);
            RegisterScript("alert('修改站点信息成功!');window.location.href='DistributionOemAuthorizationList.aspx';", true);
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     RegisterOEMSkins("form.css");
     if (!IsPostBack)
     {
         string companyId      = Request.QueryString["CompanyId"];
         string incomeGroupId  = Request.QueryString["IncomeGroupId"];
         string strAccountType = Request.QueryString["AccountType"];
         if (!string.IsNullOrWhiteSpace(companyId))
         {
             this.addGroup.HRef = "IncomeGroupAdd.aspx?CompanyId=" + companyId + "&IncomeGroupId=" + incomeGroupId + "&AccountType=" + strAccountType;
             DistribtionOEMUserCompanyDetailInfo info = DistributionOEMService.QueryDistributionOEMUserDetailInfo(Guid.Parse(companyId));
             if (info != null)
             {
                 BindCompanyInfo(info);
             }
         }
     }
 }
示例#6
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                var  oem     = OEMService.QueryOEM(CurrentCompany.CompanyId);
                Guid styleId = Guid.Parse(hidValue.Value);
                DistributionOEMService.ChooiceStyle(oem.Id, styleId, CurrentUser.UserName);
                //刷新缓存
                FlushRequester.TriggerOEMFlusher(oem.Id);
                oem = OEMService.QueryOEM(oem.DomainName);
                LoadStyle(oem);
            }
            catch (Exception ex)
            {
                ShowExceptionMessage(ex, "选择风格");
            }

            ShowMessage("选择风格成功,刷新页面后生效!");
        }
示例#7
0
        /// <summary>
        ///  修改页头信息
        /// </summary>
        /// <param name="setting"></param>
        /// <returns></returns>
        public string UpdateHeaderifno(OemSetting setting, string oemid)
        {
            try
            {
                //var set = DistributionOEMService.QueryDistributionOEMSetting(setting.Id);

                //setting.FooterLinks = set.FooterLinks;
                //setting.BGColor = set.BGColor;
                //setting.copyrightInfo = set.copyrightInfo;

                DistributionOEMService.UpdateDistributionOEMSetting(setting, Guid.Parse(oemid), CurrentUser.UserName);
                //刷新缓存
                FlushRequester.TriggerOEMFlusher(Guid.Parse(oemid));
            }
            catch (Exception ex)
            {
                return(ex.Message);
            }
            return("1");
        }
 private void queryDistributionOEMUser(Pagination pagination)
 {
     try
     {
         var distributionOemUser = from item in DistributionOEMService.QueryDistributionOEMUserList(getCondition(), pagination)
                                   select new
         {
             item.RegisterTime,
             item.Login,
             item.AbbreviateName,
             item.IncomeGroupName,
             Type        = item.Type.GetDescription(),
             AccountType = item.AccountType.GetDescription(),
             item.ContactName,
             item.Enabled,
             AccountTypeValue = (byte)item.AccountType,
             item.CompanyId,
             IncomeGroupId = item.IncomeGroupId.HasValue? item.IncomeGroupId.ToString():string.Empty
         };
         datalist.DataSource = distributionOemUser;
         datalist.DataBind();
         if (distributionOemUser.Count() > 0)
         {
             pager.Visible = true;
             if (pagination.GetRowCount)
             {
                 pager.RowCount = pagination.RowCount;
             }
         }
         else
         {
             pager.Visible = false;
         }
     }
     catch (Exception ex)
     {
         ShowExceptionMessage(ex, "查询");
     }
 }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                if (valiate())
                {
                    DistributionOEM distributionOEM = save();
                    if (lblOperator.Text == "修改")
                    {
                        DistributionOEMService.UpdateOemInfo(distributionOEM, CurrentUser.UserName);
                        FlushRequester.TriggerOEMFlusher(distributionOEM.Id);
                    }
                    else
                    {
                        CompanyDetailInfo companyDetailInfo = CompanyService.GetCompanyDetail(txtB3bAccountNo.Text.Trim());
                        if (companyDetailInfo == null)
                        {
                            ShowMessage("该B3B账号不存在");
                        }
                        else if (companyDetailInfo.CompanyType == CompanyType.Platform)
                        {
                            ShowMessage("平台帐号不能开通OEM");
                        }
                        else
                        {
                            distributionOEM.CompanyId = companyDetailInfo.CompanyId;

                            DistributionOEMService.RegisterDistributionOEM(distributionOEM, companyDetailInfo.IsOem, companyDetailInfo.AbbreviateName);
                        }
                    }
                    FlushRequester.TriggerOEMAdder();
                    RegisterScript("alert('添加/修改成功');window.location.href='DistributionOemAuthorizationList.aspx'", false);
                }
            }
            catch (Exception ex)
            {
                ShowExceptionMessage(ex, "添加/修改");
            }
        }