Пример #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack && !string.IsNullOrWhiteSpace(base.Request.QueryString["DepartmentId"]))
     {
         int departmentId = Globals.SafeInt(base.Request.QueryString["DepartmentId"], -1);
         this.hfEnID.Value = departmentId.ToString();
         MapInfo modelByDepartmentId = this.mapInfoManage.GetModelByDepartmentId(departmentId);
         if (modelByDepartmentId == null)
         {
             Maticsoft.Model.Ms.Enterprise model = new Maticsoft.BLL.Ms.Enterprise().GetModel(departmentId);
             if ((model != null) && model.RegionID.HasValue)
             {
                 this.txtCity.Value = new Maticsoft.BLL.Ms.Regions().GetRegionNameByRID(model.RegionID.Value);
             }
         }
         else
         {
             this.hfMapId.Value = modelByDepartmentId.MapId.ToString();
             this.txtPointerTitle.Text = HttpUtility.HtmlDecode(modelByDepartmentId.PointerTitle);
             this.txtPointerContent.Text = Globals.HtmlDecodeForSpaceWrap(modelByDepartmentId.PointerContent);
             this.txtMarkersLongitude.Text = modelByDepartmentId.MarkersLongitude;
             this.txtMarkersDimension.Text = modelByDepartmentId.MarkersDimension;
             this.hfMapImgUrl.Value = modelByDepartmentId.PointImg;
         }
     }
 }
 private void BindEnterprise()
 {
     DataSet list = new Enterprise().GetList(string.Empty);
     if (!DataSetTools.DataSetIsNull(list))
     {
         this.dropEnterprise.DataSource = list;
         this.dropEnterprise.DataTextField = "Name";
         this.dropEnterprise.DataValueField = "EnterpriseID";
         this.dropEnterprise.DataBind();
     }
     this.dropEnterprise.Items.Insert(0, this.dropItem0Value);
 }
Пример #3
0
 public void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         string departmentId = this.DepartmentId;
         string userType = this.UserType;
         if (!string.IsNullOrWhiteSpace(departmentId) && !string.IsNullOrWhiteSpace(this.UserType))
         {
             int enterpriseID = Globals.SafeInt(departmentId, -1);
             if (enterpriseID >= 1)
             {
                 Maticsoft.Model.Ms.Enterprise model = new Maticsoft.BLL.Ms.Enterprise().GetModel(enterpriseID);
                 this.lblName.Text = model.Name;
                 this.ltbUser.DataSource = new User().GetUserList(userType, departmentId, string.Empty);
                 this.ltbUser.DataTextField = "UserName";
                 this.ltbUser.DataValueField = "UserID";
                 this.ltbUser.DataBind();
                 this.ltbUser.SelectedIndex = 0;
                 for (int i = 0; i < this.ltbUser.Items.Count; i++)
                 {
                     if (this.ltbUser.Items[i].Text == model.UserName)
                     {
                         ListItem item1 = this.ltbUser.Items[i];
                         item1.Text = item1.Text + this.DefaultText;
                     }
                 }
                 DataSet roleList = AccountsTool.GetRoleList();
                 this.cblRole.DataSource = roleList.Tables[0].DefaultView;
                 this.cblRole.DataTextField = "Description";
                 this.cblRole.DataValueField = "RoleID";
                 this.cblRole.DataBind();
                 for (int j = 0; j < this.cblRole.Items.Count; j++)
                 {
                     if (this.ReservedRoleIDs.Contains(this.cblRole.Items[j].Value))
                     {
                         this.cblRole.Items.Remove(this.cblRole.Items[j]);
                     }
                 }
                 this.SelectionRoles();
             }
         }
     }
 }
Пример #4
0
 public string GetEnteName(string prefixText, int limit)
 {
     if (string.IsNullOrWhiteSpace(prefixText))
     {
         return string.Empty;
     }
     string strEnteName = this.HtmlEncode(prefixText);
     DataSet enteName = new Enterprise().GetEnteName(strEnteName, limit);
     JsonArray array = new JsonArray();
     if (enteName.Tables[0].Rows.Count > 0)
     {
         for (int i = 0; i < enteName.Tables[0].Rows.Count; i++)
         {
             string tmpStr = enteName.Tables[0].Rows[i]["Name"].ToString();
             if (this.CheckHtmlCode(ref tmpStr, prefixText))
             {
                 JsonObject obj2 = new JsonObject();
                 obj2.Accumulate("name", tmpStr);
                 array.Add(obj2);
             }
         }
     }
     return array.ToString();
 }
Пример #5
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     Maticsoft.Model.Settings.Advertisement model = new Maticsoft.Model.Settings.Advertisement {
         AdvPositionId = new int?(this.AdPositionID)
     };
     if (string.IsNullOrWhiteSpace(this.txtAdvertisementName.Text))
     {
         MessageBox.ShowFailTip(this, "广告名称不能为空!");
     }
     else
     {
         model.AdvertisementName = this.txtAdvertisementName.Text;
         string s = string.Empty;
         if (this.rbTextContent.Checked)
         {
             s = "0";
         }
         else if (this.rbImgContent.Checked)
         {
             s = "1";
         }
         else if (this.rbFlashContent.Checked)
         {
             s = "2";
         }
         else
         {
             s = "3";
         }
         string oldValue = string.Format("/Upload/Temp/{0}", DateTime.Now.ToString("yyyyMMdd"));
         string newValue = string.Format("/Upload/AD/{0}", this.AdPositionID);
         ArrayList fileNameList = new ArrayList();
         if (s.Equals("1"))
         {
             if (string.IsNullOrWhiteSpace(this.hfFileUrl.Value))
             {
                 MessageBox.ShowFailTip(this, "请选择要上传的图片!");
                 return;
             }
             string str4 = string.Format(this.hfFileUrl.Value, "");
             fileNameList.Add(str4.Replace(oldValue, ""));
             model.FileUrl = str4.Replace(oldValue, newValue);
         }
         if (s.Equals("2"))
         {
             model.FileUrl = this.hfSwfUrl.Value;
         }
         if (s.Equals("3"))
         {
             if (string.IsNullOrWhiteSpace(this.txtAdvHtml.Text))
             {
                 MessageBox.ShowFailTip(this, "广告HTML代码不能为空!");
                 return;
             }
             model.AdvHtml = this.txtAdvHtml.Text;
         }
         model.ContentType = new int?(int.Parse(s));
         model.AlternateText = this.txtAlternateText.Text;
         model.NavigateUrl = this.txtNavigateUrl.Text;
         if (!PageValidate.IsNumber(this.txtImpressions.Text))
         {
             MessageBox.ShowFailTip(this, "显示频率格式不正确!");
         }
         else
         {
             model.Impressions = new int?(int.Parse(this.txtImpressions.Text));
             model.CreatedDate = new DateTime?(DateTime.Now);
             model.CreatedUserID = new int?(base.CurrentUser.UserID);
             if (this.chkIsValid.Checked)
             {
                 model.State = 1;
             }
             else
             {
                 model.State = 0;
             }
             if (!string.IsNullOrWhiteSpace(this.txtStartDate.Text))
             {
                 if (!PageValidate.IsDateTime(this.txtStartDate.Text))
                 {
                     MessageBox.ShowFailTip(this, "请输入正确的开始时间!");
                     return;
                 }
                 model.StartDate = new DateTime?(DateTime.Parse(this.txtStartDate.Text));
             }
             if (!string.IsNullOrWhiteSpace(this.txtEndDate.Text))
             {
                 if (!PageValidate.IsDateTime(this.txtEndDate.Text))
                 {
                     MessageBox.ShowFailTip(this, "请输入正确的结束时间!");
                     return;
                 }
                 model.EndDate = new DateTime?(DateTime.Parse(this.txtEndDate.Text));
             }
             if (!PageValidate.IsNumber(this.txtDayMaxPV.Text))
             {
                 MessageBox.ShowFailTip(this, "最大PV格式不正确!");
             }
             else
             {
                 model.DayMaxPV = new int?(int.Parse(this.txtDayMaxPV.Text));
                 if (!PageValidate.IsNumber(this.txtDayMaxIP.Text))
                 {
                     MessageBox.ShowFailTip(this, "最大IP格式不正确!");
                 }
                 else
                 {
                     model.DayMaxIP = new int?(int.Parse(this.txtDayMaxIP.Text));
                     if (string.IsNullOrWhiteSpace(this.txtCPMPrice.Text))
                     {
                         MessageBox.ShowFailTip(this, "请输入正确的价格!");
                     }
                     else
                     {
                         decimal result = 0M;
                         if (!decimal.TryParse(this.txtCPMPrice.Text, out result))
                         {
                             MessageBox.ShowFailTip(this, "价格格式不正确!");
                         }
                         else
                         {
                             model.CPMPrice = new decimal?(result);
                             if (this.rbAutoStop.Checked)
                             {
                                 model.AutoStop = 1;
                             }
                             else if (this.rbNoStup.Checked)
                             {
                                 model.AutoStop = 0;
                             }
                             else
                             {
                                 model.AutoStop = -1;
                             }
                             model.Sequence = new int?(this.bll.GetMaxSequence());
                             string text = this.txtEnterpriseID.Text;
                             Enterprise enterprise = new Enterprise();
                             if (!string.IsNullOrWhiteSpace(text))
                             {
                                 List<Enterprise> modelByEnterpriseName = enterprise.GetModelByEnterpriseName(text);
                                 if (modelByEnterpriseName.Count <= 0)
                                 {
                                     MessageBox.ShowFailTip(this, "没有找到相应商户,请重新输入!");
                                     return;
                                 }
                                 model.EnterpriseID = new int?(modelByEnterpriseName[0].EnterpriseID);
                             }
                             else
                             {
                                 model.EnterpriseID = -1;
                             }
                             if (this.bll.Add(model))
                             {
                                 string url = string.Format("SingleList.aspx?id={0}", this.AdPositionID);
                                 this.btnCancle.Enabled = false;
                                 this.btnSave.Enabled = false;
                                 if (!string.IsNullOrWhiteSpace(this.hfFileUrl.Value))
                                 {
                                     FileManage.MoveFile(base.Server.MapPath(oldValue), base.Server.MapPath(newValue), fileNameList);
                                 }
                                 MessageBox.ShowSuccessTip(this, "保存成功", url);
                             }
                             else
                             {
                                 MessageBox.ShowFailTip(this, "网络异常,请稍后再试!");
                             }
                         }
                     }
                 }
             }
         }
     }
 }
Пример #6
0
 private void ShowInfo()
 {
     Maticsoft.Model.Ms.Enterprise model = new Maticsoft.BLL.Ms.Enterprise().GetModel(this.EnterpriseID);
     if (model != null)
     {
         this.lblEnterpriseID.Text = model.EnterpriseID.ToString();
         this.lblName.Text = model.Name;
         this.lblIntroduction.Text = model.Introduction;
         if (model.RegisteredCapital.HasValue)
         {
             this.lblRegisteredCapital.Text = model.RegisteredCapital.ToString();
         }
         this.lblTelPhone.Text = model.TelPhone;
         this.lblCellPhone.Text = model.CellPhone;
         this.lblContactMail.Text = model.ContactMail;
         if (model.RegionID.HasValue)
         {
             this.RegionID.Region_iID = model.RegionID.Value;
         }
         this.lblAddress.Text = model.Address;
         this.lblRemark.Text = model.Remark;
         this.lblContact.Text = model.Contact;
         this.lblUserName.Text = model.UserName;
         if (model.EstablishedDate.HasValue)
         {
             this.lblEstablishedDate.Text = model.EstablishedDate.ToString();
         }
         if (model.EstablishedCity.HasValue)
         {
             this.RegionEstablishedCity.Region_iID = model.EstablishedCity.Value;
         }
         this.lblLOGO.Text = model.LOGO;
         this.lblFax.Text = model.Fax;
         this.lblPostCode.Text = model.PostCode;
         this.lblHomePage.Text = model.HomePage;
         this.lblArtiPerson.Text = model.ArtiPerson;
         if (model.EnteRank.HasValue)
         {
             this.lblEnteRank.Text = this.GetEnteRank(model.EnteRank);
         }
         if (model.EnteClassID.HasValue)
         {
             this.lblEnteClassName.Text = this.GetEnteClassName(model.EnteClassID);
         }
         if (model.CompanyType.HasValue)
         {
             this.lblCompanyType.Text = this.GetCompanyType(model.CompanyType);
         }
         this.lblBusinessLicense.Text = model.BusinessLicense;
         this.lblTaxNumber.Text = model.TaxNumber;
         this.lblAccountBank.Text = model.AccountBank;
         this.lblAccountInfo.Text = model.AccountInfo;
         this.lblServicePhone.Text = model.ServicePhone;
         this.lblQQ.Text = model.QQ;
         this.lblMSN.Text = model.MSN;
         if (model.Status.HasValue)
         {
             this.lblStatus.Text = this.GetStatus(model.Status);
         }
         if (model.CreatedDate.HasValue)
         {
             this.lblCreatedDate.Text = model.CreatedDate.ToString();
         }
         this.lblCreatedUserID.Text = model.CreatedUserName;
         if (model.UpdatedDate.HasValue)
         {
             this.lblUpdatedDate.Text = model.UpdatedDate.ToString();
         }
         this.lblUpdatedUserID.Text = model.UpdatedUserName;
         this.lblBalance.Text = model.Balance.ToString("F2");
         this.lblAgentID.Text = model.AgentID.ToString();
     }
 }
Пример #7
0
        private void ShowInfo(int AdvertisementId)
        {
            Maticsoft.Model.Settings.Advertisement model = new Maticsoft.BLL.Settings.Advertisement().GetModel(AdvertisementId);
            this.txtAdvertisementName.Text = model.AdvertisementName;
            switch (model.ContentType.Value)
            {
                case 0:
                    this.rbTextContent.Checked = true;
                    this.imgShow.Visible = false;
                    this.FlashPlay.Visible = false;
                    break;

                case 1:
                    this.rbImgContent.Checked = true;
                    this.hfFileUrl.Value = model.FileUrl;
                    this.imgShow.Visible = true;
                    this.FlashPlay.Visible = false;
                    break;

                case 2:
                    this.rbFlashContent.Checked = true;
                    this.hfSwfUrl.Value = model.FileUrl;
                    this.imgShow.Visible = false;
                    this.FlashPlay.Visible = true;
                    this.litVideo.Text = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0\" width=\"200\" height=\"170\"  ></a></li><param name=\"wmode\" value=\"opaque\" /><param name=\"quality\" value=\"high\" /><param name=\"movie\" value=\"" + model.FileUrl + "\" /><embed src=\"" + model.FileUrl + "\" allowfullscreen=\"true\" quality=\"high\" width=\"200\" height=\"170\"\" align=\"middle\" wmode=\"transparent\" allowscriptaccess=\"always\" type=\"application/x-shockwave-flash\"></embed></object></td></tr>";
                    break;

                case 3:
                    this.rbCodeContent.Checked = true;
                    this.imgShow.Visible = false;
                    this.FlashPlay.Visible = false;
                    break;
            }
            this.txtAdvHtml.Text = model.AdvHtml;
            this.txtAlternateText.Text = model.AlternateText;
            this.txtCPMPrice.Text = model.CPMPrice.Value.ToString("0.00");
            this.txtDayMaxIP.Text = model.DayMaxIP.ToString();
            this.txtDayMaxPV.Text = model.DayMaxPV.ToString();
            this.txtEndDate.Text = model.EndDate.HasValue ? model.EndDate.Value.ToString("yyyy-MM-dd") : "";
            this.imgAd.ImageUrl = model.FileUrl;
            Maticsoft.Model.Ms.Enterprise enterprise2 = new Maticsoft.BLL.Ms.Enterprise().GetModel(model.EnterpriseID.Value);
            if (enterprise2 != null)
            {
                this.txtEnterpriseID.Text = enterprise2.Name;
            }
            else
            {
                this.txtEnterpriseID.Text = "";
            }
            this.txtImpressions.Text = model.Impressions.Value.ToString();
            this.txtNavigateUrl.Text = model.NavigateUrl;
            this.txtStartDate.Text = model.StartDate.HasValue ? model.StartDate.Value.ToString("yyyy-MM-dd") : "";
            if (model.AutoStop.Value.Equals(0))
            {
                this.rbNoStup.Checked = true;
            }
            else if (model.AutoStop.Value.Equals(1))
            {
                this.rbAutoStop.Checked = true;
            }
            else
            {
                this.rbNoLimit.Checked = true;
            }
            switch (model.State.Value)
            {
                case -1:
                    this.rbStop.Checked = true;
                    return;

                case 0:
                    this.rbStatusN.Checked = true;
                    return;

                case 1:
                    this.rbStatusY.Checked = true;
                    return;
            }
        }
Пример #8
0
 public string GetEnName(object obj)
 {
     if (obj != null)
     {
         int enterpriseID = Globals.SafeInt(obj.ToString(), 0);
         Maticsoft.Model.Ms.Enterprise model = new Maticsoft.BLL.Ms.Enterprise().GetModel(enterpriseID);
         if (model != null)
         {
             return model.Name;
         }
     }
     return "广告主不存在";
 }