Esempio n. 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     //取得栏目传参
     if (int.TryParse(Request.Params["Id"], out Id))
     {
         if (!Page.IsPostBack)
         {
             if (!getUserCookies())
             {
                 Response.Redirect("~/Index.aspx");
             }
             else
             {
                 modeluser = blluser.GetModelByName(uid);
             }
             ChannelData = cbll.GetList(" c.ID='" + Id + "'").Tables[0];
             ChannelTitle = cbll.GetList(" UserID='" + modeluser.ID + "'").Tables[0];
             if (ChannelData.Rows.Count > 0)
             {
                 lbChanel.Text = ChannelData.Rows[0]["Title"].ToString();
             }
         }
     }
     else
     {
         string myScript = @"alertMsg('出现错误啦,参数不正确','error.gif');";
         Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", myScript, true);
         return;
     }
   
 }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (!getUserCookies())
                {
                    Response.Redirect("~/Index.aspx");
                }
                else
                {
                    model = bll.GetModelByName(uid);
                    if (!string.IsNullOrEmpty(model.PaypalAccount))
                    {
                        Panel1.Visible = false;
                        Panel2.Visible = true;
                        lbPayAccount.Text = model.PaypalAccount;
                        lbTrueName.Text = model.TrueName;
                    }
                    else
                    {
                        Panel1.Visible = true;
                        Panel2.Visible = false;
                    }

                }
            }
        }
Esempio n. 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (!getUserCookies())
                {
                    Response.Redirect("~/Index.aspx");
                }
                else
                {
                    modeluser = blluser.GetModelByName(uid);

                }
                Spread.Model.WebSet model = new Spread.Model.WebSet();
                //bll.Get_Config(rwc);
                string pathurl = Server.MapPath(ConfigurationManager.AppSettings["WebSetpath"].ToString());
                model = bllSet.loadConfig(pathurl);
                DataTable dtChannel = cbll.GetList(" UserID='" + modeluser.ID + "' ").Tables[0];
                if (dtChannel.Rows.Count >= int.Parse(model.ChannelNum))
                {
                    string myScript = @"alertRedirectMsg('添加渠道不能大于" + model.ChannelNum + "!','error.gif','Channel.aspx');";
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", myScript, true);
                    return;
                }
                //TreeBind();
                DataTable dt = bll.GetList("").Tables[0];
                this.rptList.DataSource = dt;
                this.rptList.DataBind();
            }
        }
Esempio n. 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (!getUserCookies())
                {
                    Response.Redirect("~/Index.aspx");
                }
                else
                {
                    modeluser = blluser.GetModelByName(uid);
                    hduid.Value = modeluser.ID.ToString();

                }
                if (Request.Params["cooperationModelId"] != null)
                {
                    cModel = cbll.GetModel(int.Parse(Request.Params["cooperationModelId"].ToString()));
                    if (cModel.ID > 0)
                    {
                        hdcid.Value = cModel.ID.ToString();
                        hdcname.Value = cModel.Name;
                        RptBind(" ChanelID='" + cModel.ID.ToString() + "'" + this.CombSqlTxt(this.keywords));

                    }
                }

            }
        }
Esempio n. 5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         this.txtDate1.Value = DateTime.Now.AddDays(-10).ToString("yyyy-MM-dd");
         this.txtDate2.Value = DateTime.Now.ToString("yyyy-MM-dd");
         
         if (!getUserCookies())
         {
             Response.Redirect("~/Index.aspx");
         }
         else
         {
             modeluser = blluser.GetModelByName(uid);
             hduserid.Value = modeluser.ID.ToString();
         }
         if (Request.Params["startDateStr"] != null)
         {
             this.txtDate1.Value = Request.Params["startDateStr"].ToString();
         }
         if (Request.Params["endDateStr"] != null)
         {
             this.txtDate2.Value = Request.Params["endDateStr"].ToString();
         }
         ChannelData = cbll.GetList(" UserID='" + modeluser.ID + "'").Tables[0];
         MenuBind();
         TreeBind(ChannelData);
         RptBind();
     }
 }
Esempio n. 6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!int.TryParse(Request.Params["id"] as string, out this.Id))
     {
         JscriptMsg(350, 230, "错误提示", "<b>出现错误啦!</b>您要修改的信息不存在或参数不正确。", "back", "Error");
         return;
     }
     
     if (!Page.IsPostBack)
     {
         userModel = bll.GetModel(this.Id);
         strPwd = DESEncrypt.Decrypt(userModel.Password);
         if (userModel.UserType == 1)
         {
             this.Panel1.Visible = false;
             this.Panel2.Visible = true;
             QyView(userModel);
         }
         else
         {
             this.Panel1.Visible = true;
             this.Panel2.Visible = false;
             GrView(userModel);
         }
     }
 }
Esempio n. 7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if(!getUserCookies()){
             Response.Redirect("~/Index.aspx");
         }else{
             model = bll.GetModelByName(uid);
             
         }
     }
 }
Esempio n. 8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (!getUserCookies())
                {
                    Response.Redirect("~/Index.aspx");
                }
                else
                {
                    modeluser = blluser.GetModelByName(uid);
                    hduid.Value = modeluser.ID.ToString();

                }

                baseUrl = Request.Url.AbsoluteUri.Substring(0, Request.Url.AbsoluteUri.IndexOf(Request.RawUrl));
                
                if (Request.Params["classId"] != null)
                {
                    classId = Request.Params["classId"].ToString();
                    platformId = Request.Params["classId"].ToString();
                }
                else
                {
                    platformId = "所有平台";
                }
                if (Request.Params["keywords"] != null)
                {
                    keywords = Request.Params["keywords"].ToString();
                    searchinput.Value = Request.Params["keywords"].ToString();
                }
                if (Request.Params["cooperateModelId"] != null)
                {
                    DataTable dt = cbll.GetList(" UserID='" + modeluser.ID + "'  AND c.id='" + Request.Params["cooperateModelId"] + "'").Tables[0]; 
                    if (dt.Rows.Count > 0)
                    {
                        lbTitle.Text = dt.Rows[0]["Title"].ToString();
                        lbBrand.Text = dt.Rows[0]["Brand"].ToString();
                        lbPtitle.Text = dt.Rows[0]["Ptitle"].ToString();
                    }
                    cooperateModelId = Request.Params["cooperateModelId"].ToString();
                    cModel = cbll.GetModel(int.Parse(Request.Params["cooperateModelId"].ToString()));
                     if (cModel.ID > 0)
                     {
                         hdcid.Value = cModel.ID.ToString();
                         hdcname.Value = cModel.Name;
                         RptBind(this.CombSqlTxt(this.classId, this.keywords), "UpdateDate desc");
                     }
                }
            }
            InfoView();
        }
Esempio n. 9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (!getUserCookies())
         {
             Response.Redirect("~/Index.aspx");
         }
         else
         {
             modeluser = blluser.GetModelByName(uid);
         }
         ChannelData = cbll.GetList(" UserID='" + modeluser.ID+ "'").Tables[0];
     }
 }
Esempio n. 10
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Session["changeName"] != null)
         {
             model=bll.GetModelByName(Session["changeName"].ToString());
             hdPhone.Value = model.Phone;
         }
         else
         {
             string myScript = @"alertRedirectMsg('信息有误!','error.gif','step1Page.aspx');";
             Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", myScript, true);
         }
     }
 }
Esempio n. 11
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (!getUserCookies())
         {
             Response.Redirect("~/Index.aspx");
         }
         else
         {
             model = bll.GetModelByName(uid);
             lbPhone.Text = model.Phone;
             lbCorporateName.Text = model.CorporateName;
             lbQQ.Text = model.QQ;
         }
     }
 }
Esempio n. 12
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (!getUserCookies())
         {
             Response.Redirect("~/Index.aspx");
         }
         else
         {
             model = bll.GetModelByName(uid);
             lbPhone.Text = model.Phone;
             telphone2.Value = model.Phone;
             qqnumber.Value = model.QQ;
         }
     }
 }
Esempio n. 13
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (!getUserCookies())
         {
             Response.Redirect("~/Index.aspx");
         }
         else
         {
             modeluser = blluser.GetModelByName(uid);
             hdusername.Value = modeluser.TrueName;
             model.Content = bll.GetModel(1).Content;
         }
     }
    
 }
Esempio n. 14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (!getUserCookies())
                {
                    Response.Redirect("~/Index.aspx");
                }
                else
                {
                    modeluser = blluser.GetModelByName(uid);
                    hduid.Value = modeluser.ID.ToString();

                }
                if (Request.Params["cooperateId"] != null)
                {
                    DataTable dt = cbll.GetList(" UserID='" + modeluser.ID + "'  AND c.id='" + Request.Params["cooperateId"] + "'").Tables[0];
                    if (dt.Rows.Count > 0)
                    {
                        lbTitle.Text = dt.Rows[0]["Title"].ToString();
                        lbBrand.Text = dt.Rows[0]["Brand"].ToString();
                        lbPtitle.Text = dt.Rows[0]["Ptitle"].ToString();
                    }

                    cModel = cbll.GetModel(int.Parse(Request.Params["cooperateId"].ToString()));
                    if (cModel.ID > 0)
                    {
                        hdcid.Value = cModel.ID.ToString();
                        hdcname.Value = cModel.Title;
                        chooseGame=extbll.GetList(" e.ChanelID='" + cModel.ID.ToString() + "'").Tables[0];
                    }
                    else
                    {
                        string myScript = @"alertRedirectMsg('参数错误!','error.gif','Channel.aspx');";
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", myScript, true);
                    }
                }
                else
                {
                    string myScript = @"alertRedirectMsg('参数错误!','error.gif','Channel.aspx');";
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", myScript, true);
                }
                InfoView();
            }
        }
Esempio n. 15
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         this.startdate.Value = DateTime.Now.ToString("yyyy-MM-dd");
         this.enddate.Value = DateTime.Now.ToString("yyyy-MM-dd");
         if (!getUserCookies())
         {
             Response.Redirect("~/Index.aspx");
         }
         else
         {
             modeluser = blluser.GetModelByName(uid);
             hduserid.Value = modeluser.ID.ToString();
         }
         ChannelData = cbll.GetList(" UserID='" + modeluser.ID + "'").Tables[0];
         RptBind();
     }
 }
Esempio n. 16
0
 protected void Page_Load(object sender, EventArgs e)
 {
    
     if (!IsPostBack)
     {
         string pathurl = Server.MapPath(ConfigurationManager.AppSettings["WebSetpath"].ToString());
         webset = bll.loadConfig(pathurl);
         int num = int.Parse(webset.SettlementCycle);
         this.startDate.Text = DateTime.Now.AddDays(-num).ToString("yyyy-MM-dd");
         this.endDate.Text = DateTime.Now.ToString("yyyy-MM-dd");
         startDateStr = this.startDate.Text;
         endDateStr = this.endDate.Text;
         if (!getUserCookies())
         {
             Response.Redirect("~/Index.aspx");
         }
         else
         {
             modeluser = blluser.GetModelByName(uid);
             hduserid.Value = modeluser.ID.ToString();
             hdusername.Value = modeluser.Name.ToString();
             alipayPayeeName.Text = modeluser.TrueName;
             alipayPayeeAccount.Text = modeluser.PaypalAccount;
             getUserInfo(modeluser.ID);
         }
         DataTable dt = accBll.GetList(" and UserID='" + hduserid.Value + "' and CONVERT(varchar(100),ApplyTime,23)='"+DateTime.Now.ToString("yyyy-MM-dd")+"'  ").Tables[0];
         if (dt.Rows.Count >0)
         {
             if (dt.Rows[0]["Status"].ToString() == "待审核")
             {
                 this.btnSave.Enabled = false;
                 this.btnSave.Text = "已申请结算";
             }
             else
             {
                 this.btnSave.Enabled = false;
                 this.btnSave.Text = "已经结算";
             }
         }
         //ChannelData = rbll.GetList(" UserID='" + modeluser.ID + "'").Tables[0];
     }
 }
Esempio n. 17
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         userModel = bll.GetModel(this.Id);
         userModel.TrueName = txtTrueName.Text;
         userModel.IdentityCard = txtIdentityCard.Text;
         userModel.QQ = txtQQ.Text;
         userModel.Email = txtEmail.Text;
         userModel.Applicationdesc = txtApplicationdesc.Text;
         userModel.Phone = txtPhone.Text;
         userModel.Tel = txtTel.Text;
         userModel.PaypalAccount = txtPaypalAccount.Text;
         bll.Update(userModel);
         JscriptPrint("保存成功啦!", "List.aspx", "Success");
     }
     catch
     {
         JscriptMsg(350, 230, "错误提示", "<b>保存错误啦!</b>", "back", "Error");
     }
 }
Esempio n. 18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (!getUserCookies())
                {
                    Response.Redirect("~/Index.aspx");
                }
                else
                {
                    modeluser = blluser.GetModelByName(uid);
                    hduid.Value = modeluser.ID.ToString();

                }
                
                if (Request.Params["cooperateModelId"] != null)
                {
                    DataTable dt = cbll.GetList(" UserID='" + modeluser.ID + "'  AND c.id='" + Request.Params["cooperateModelId"] + "'").Tables[0]; 
                    if (dt.Rows.Count > 0)
                    {
                        lbTitle.Text = dt.Rows[0]["Title"].ToString();
                        lbBrand.Text = dt.Rows[0]["Brand"].ToString();
                        lbPtitle.Text = dt.Rows[0]["Ptitle"].ToString();
                    }
                    cModel = cbll.GetModel(int.Parse(Request.Params["cooperateModelId"].ToString()));
                    if (cModel.ID > 0)
                    {
                        hdcid.Value = cModel.ID.ToString();
                        hdcname.Value = cModel.Name;
                        RptBind(" ChanelID='" + cModel.ID.ToString() + "'");
                        //this.rptList.DataSource = extbll.GetList(" e.ChanelID='" + cModel.ID.ToString() + "'").Tables[0];
                        //this.rptList.DataBind();
                    }
                }

            }
        }
Esempio n. 19
0
 protected void btnSave2_Click(object sender, EventArgs e)
 {
     try
     {
         userModel = bll.GetModel(this.Id);
         userModel.CompanyName = txtqCompanyName.Text;
         userModel.CompanyAddress = txtqCompanyAddress.Text;
         userModel.RegistrationMark = txtqRegistrationMark.Text;
         userModel.TrueName = txtqTrueName.Text;
         userModel.IdentityCard = txtgIdentityCard.Text;
         userModel.CorporateName = txtqCorporateName.Text;
         userModel.QQ = txtqQQ.Text;
         userModel.Email = txtqEmail.Text;
         userModel.Applicationdesc = txtqApplicationdesc.Text;
         userModel.Phone = txtqPhone.Text;
         userModel.Tel = txtqTel.Text;                
         bll.Update(userModel);
         JscriptPrint("保存成功啦!", "List.aspx", "Success");
     }
     catch
     {
         JscriptMsg(350, 230, "错误提示", "<b>保存错误啦!</b>", "back", "Error");
     }
 }
Esempio n. 20
0
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public Spread.Model.User DataRowToModel(DataRow row)
 {
     Spread.Model.User model = new Spread.Model.User();
     if (row != null)
     {
         if (row["ID"] != null && row["ID"].ToString() != "")
         {
             model.ID = int.Parse(row["ID"].ToString());
         }
         if (row["Name"] != null)
         {
             model.Name = row["Name"].ToString();
         }
         if (row["Password"] != null)
         {
             model.Password = row["Password"].ToString();
         }
         if (row["RegDate"] != null && row["RegDate"].ToString() != "")
         {
             model.RegDate = DateTime.Parse(row["RegDate"].ToString());
         }
         if (row["Email"] != null)
         {
             model.Email = row["Email"].ToString();
         }
         if (row["Sex"] != null && row["Sex"].ToString() != "")
         {
             if ((row["Sex"].ToString() == "1") || (row["Sex"].ToString().ToLower() == "true"))
             {
                 model.Sex = true;
             }
             else
             {
                 model.Sex = false;
             }
         }
         if (row["IdentityCard"] != null)
         {
             model.IdentityCard = row["IdentityCard"].ToString();
         }
         if (row["TrueName"] != null)
         {
             model.TrueName = row["TrueName"].ToString();
         }
         if (row["IsLock"] != null && row["IsLock"].ToString() != "")
         {
             if ((row["IsLock"].ToString() == "1") || (row["IsLock"].ToString().ToLower() == "true"))
             {
                 model.IsLock = true;
             }
             else
             {
                 model.IsLock = false;
             }
         }
         if (row["Tel"] != null)
         {
             model.Tel = row["Tel"].ToString();
         }
         if (row["Phone"] != null)
         {
             model.Phone = row["Phone"].ToString();
         }
         if (row["QQ"] != null)
         {
             model.QQ = row["QQ"].ToString();
         }
         if (row["UserType"] != null && row["UserType"].ToString() != "")
         {
             model.UserType = int.Parse(row["UserType"].ToString());
         }
         if (row["LastLogin"] != null && row["LastLogin"].ToString() != "")
         {
             model.LastLogin = DateTime.Parse(row["LastLogin"].ToString());
         }
         if (row["CompanyName"] != null)
         {
             model.CompanyName = row["CompanyName"].ToString();
         }
         if (row["CompanyAddress"] != null)
         {
             model.CompanyAddress = row["CompanyAddress"].ToString();
         }
         if (row["RegistrationMark"] != null)
         {
             model.RegistrationMark = row["RegistrationMark"].ToString();
         }
         if (row["CorporateName"] != null)
         {
             model.CorporateName = row["CorporateName"].ToString();
         }
         if (row["Applicationdesc"] != null)
         {
             model.Applicationdesc = row["Applicationdesc"].ToString();
         }
         if (row["PaypalAccount"] != null)
         {
             model.PaypalAccount = row["PaypalAccount"].ToString();
         }
         if (row["Salesman"] != null)
         {
             model.Salesman = row["Salesman"].ToString();
         }
         if (row["SalesPhone"] != null)
         {
             model.SalesPhone = row["SalesPhone"].ToString();
         }
         if (row["SalesQQ"] != null)
         {
             model.SalesQQ = row["SalesQQ"].ToString();
         }
         if (row["Bak1"] != null)
         {
             model.Bak1 = row["Bak1"].ToString();
         }
         if (row["Bak2"] != null)
         {
             model.Bak2 = row["Bak2"].ToString();
         }
         if (row["Bak3"] != null)
         {
             model.Bak3 = row["Bak3"].ToString();
         }
         if (row["Bak4"] != null)
         {
             model.Bak4 = row["Bak4"].ToString();
         }
         if (row["Bak5"] != null)
         {
             model.Bak5 = row["Bak5"].ToString();
         }
     }
     return model;
 }
Esempio n. 21
0
        protected void submitbtn_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(this.channelname.Text))
            {
                string myScript = @"alertMsg('渠道名称不能为空!','error.gif');";
                Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", myScript, true);
                return;
            }
            #region 删除
            //if (this.channeltype.SelectedValue=="0")
            //{
            //    string myScript = @"alertMsg('请选择行业分类!','error.gif');";
            //    Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", myScript, true);
            //    return;
            //}
            //if (this.channeltype.SelectedValue == "1")
            //{
            //    if (string.IsNullOrEmpty(this.txtWebName.Text))
            //    {
            //        string myScript = @"alertMsg('网站名称不能为空!','error.gif');";
            //        Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", myScript, true);
            //        return;
            //    }
            //    if (string.IsNullOrEmpty(this.txtWebUrl.Text))
            //    {
            //        string myScript = @"alertMsg('网站地址不能为空!','error.gif');";
            //        Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", myScript, true);
            //        return;
            //    }
            //}
            //else if (this.channeltype.SelectedValue == "5")
            //{
            //    if (string.IsNullOrEmpty(this.txtWebName.Text))
            //    {
            //        string myScript = @"alertMsg('软件名称不能为空!','error.gif');";
            //        Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", myScript, true);
            //        return;
            //    }
            //    if (string.IsNullOrEmpty(this.txtWebUrl.Text))
            //    {
            //        string myScript = @"alertMsg('软件下载连接不能为空!','error.gif');";
            //        Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", myScript, true);
            //        return;
            //    }
            //}
            //else if (this.channeltype.SelectedValue == "10")
            //{
            //    if (string.IsNullOrEmpty(this.txtWebName.Text))
            //    {
            //        string myScript = @"alertMsg('应用商店名称不能为空!','error.gif');";
            //        Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", myScript, true);
            //        return;
            //    }
            //    if (string.IsNullOrEmpty(this.txtWebUrl.Text))
            //    {
            //        string myScript = @"alertMsg('应用商店下载连接不能为空!','error.gif');";
            //        Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", myScript, true);
            //        return;
            //    }
            //}
            //else if (this.channeltype.SelectedValue == "12")
            //{
            //    if (string.IsNullOrEmpty(this.txtWebName.Text))
            //    {
            //        string myScript = @"alertMsg('网站名称不能为空!','error.gif');";
            //        Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", myScript, true);
            //        return;
            //    }
            //    if (string.IsNullOrEmpty(this.txtWebUrl.Text))
            //    {
            //        string myScript = @"alertMsg('网站地址不能为空!','error.gif');";
            //        Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", myScript, true);
            //        return;
            //    }
            //}
            //else if (this.channeltype.SelectedValue == "16")
            //{
            //    if (string.IsNullOrEmpty(this.txtWebName.Text))
            //    {
            //        string myScript = @"alertMsg('APP名称不能为空!','error.gif');";
            //        Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", myScript, true);
            //        return;
            //    }
            //    if (string.IsNullOrEmpty(this.txtWebUrl.Text))
            //    {
            //        string myScript = @"alertMsg('APP下载连接不能为空!','error.gif');";
            //        Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", myScript, true);
            //        return;
            //    }
            //}
            //else if (this.channeltype.SelectedValue == "19")
            //{
            //    if (string.IsNullOrEmpty(this.txtWebName.Text))
            //    {
            //        string myScript = @"alertMsg('自身资源说明不能为空!','error.gif');";
            //        Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", myScript, true);
            //        return;
            //    }

            //}
            //else if (this.channeltype.SelectedValue == "19")
            //{
            //    if (string.IsNullOrEmpty(this.txtWebName.Text))
            //    {
            //        string myScript = @"alertMsg('自身资源说明不能为空!','error.gif');";
            //        Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", myScript, true);
            //        return;
            //    }

            //}
            //else if (this.channeltype.SelectedValue == "21")
            //{
            //    if (string.IsNullOrEmpty(this.txtWebName.Text))
            //    {
            //        string myScript = @"alertMsg('自身资源说明不能为空!','error.gif');";
            //        Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", myScript, true);
            //        return;
            //    }

            //}
            //else if (this.channeltype.SelectedValue == "23")
            //{
            //    if (string.IsNullOrEmpty(this.txtWebName.Text))
            //    {
            //        string myScript = @"alertMsg('名称不能为空!','error.gif');";
            //        Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", myScript, true);
            //        return;
            //    } 
            //    if (string.IsNullOrEmpty(this.txtWebUrl.Text))
            //    {
            //        string myScript = @"alertMsg('覆盖AP数量不能为空!','error.gif');";
            //        Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", myScript, true);
            //        return;
            //    }

            //}
            #endregion
            //批量删除
            string ClassList="";
            int n = 0;
            for (int i = 0; i < rptList.Items.Count; i++)
            {
                int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("lb_id")).Value);
                CheckBox cb = (CheckBox)rptList.Items[i].FindControl("cb_id");
                if (cb.Checked)
                {
                    ClassList += id.ToString();
                    n++;
                }
            }
            if (n == 0)
            {
                string myScript = @"alertMsg('请选择产品!','error.gif');";
                Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", myScript, true);
                return;
            }
            else if (n>1)
            {
                string myScript = @"alertMsg('只能选择一种商品推广!','error.gif');";
                Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", myScript, true);
                return;
            }
            try
            {
                modeluser = blluser.GetModelByName(Request.Cookies["UserPage_UID"].Value.ToString());
                Model.Channel cModel = new Model.Channel();
                BLL.Channel cbll = new BLL.Channel();
                cModel.Title = channelname.Text;
                cModel.CatalogID = "";//channeltype.SelectedValue;
                cModel.Name = "";//txtWebName.Text;
                cModel.Url = "";//txtWebUrl.Text;
                cModel.ParentId = int.Parse(ClassList);
                cModel.Status = 1;
                cModel.UserID = modeluser.ID;
                cModel.Bak1 = "game" + ClassList + "_" + DateTime.Now.ToString("MMdd");
                int num=cbll.Add(cModel);
                if (num>0)
                {
                    Model.Log modLog = new Model.Log();
                    modLog.UserId = num;
                    modLog.UserName = channelname.Text;
                    InsertLog(modLog);
                    string myScript = @"alertRedirectMsg('渠道添加成功!','success.gif','Channel.aspx');";
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", myScript, true);
                }
            }
            catch
            {
                string myScript = @"alertMsg('渠道添加失败!','error.gif');";
                Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", myScript, true);
                return;
            }
        }
Esempio n. 22
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Spread.Model.User GetModelByName(string name)
        {

            StringBuilder strSql = new StringBuilder();
            strSql.Append("select  top 1 ID,Name,Password,RegDate,Email,Sex,IdentityCard,TrueName,IsLock,Tel,Phone,QQ,UserType,LastLogin,CompanyName,CompanyAddress,RegistrationMark,CorporateName,Applicationdesc,PaypalAccount,Salesman,SalesPhone,SalesQQ,Bak1,Bak2,Bak3,Bak4,Bak5 from [User] ");
            strSql.Append(" where Name=@Name");
            SqlParameter[] parameters = {
					new SqlParameter("@Name", SqlDbType.NVarChar,50)
			};
            parameters[0].Value = name;

            Spread.Model.User model = new Spread.Model.User();
            DataSet ds = DbHelper.Query(strSql.ToString(), parameters);
            if (ds.Tables[0].Rows.Count > 0)
            {
                return DataRowToModel(ds.Tables[0].Rows[0]);
            }
            else
            {
                return null;
            }
        }