示例#1
0
 protected void btnSava_Click(object sender, EventArgs e)
 {
     try
     {
         Model.CustomerInfo cust = new Model.CustomerInfo();
         cust.CustomerAccount = txtCustomerAccount.Text.Trim();
         cust.CustomerPwd     = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(txtCustomerAccount.Text.Trim(), "MD5");
         cust.CustomerName    = txtCustomerName.Text.Trim();
         cust.CustomerState   = 0;
         cust.CreateDate      = DateTime.Now;
         int result = new BLL.CustomerInfo().Add(cust);
         if (result > 0)
         {
             Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('保存成功')</script>");
         }
         else
         {
             Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('保存失败')</script>");
         }
     }
     catch (Exception ec)
     {
         Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert(" + ec.Message + ")</script>");
         throw;
     }
 }
示例#2
0
        protected void btnSub_Click(object sender, EventArgs e)
        {
            try
            {
                if (!string.IsNullOrEmpty(Request.QueryString["vid"]) && !string.IsNullOrEmpty(Request.QueryString["mid"]))
                {
                    int msid = Convert.ToInt32(Request.QueryString["mid"]);
                    Model.CustomerServCenter cust = new Model.CustomerServCenter();
                    if (Session["manager"] != null)
                    {
                        Model.ManagerInfo ma = ((Model.ManagerInfo)Session["manager"]);


                        cust.GUUserID = ma.AdminID;
                        cust.GUName   = ma.AdminName;
                        cust.GUType   = 1;
                    }
                    else if (Session["Cust"] != null)
                    {
                        Model.CustomerInfo custinfo = ((Model.CustomerInfo)Session["Cust"]);

                        cust.GUUserID = custinfo.CustomerID;
                        cust.GUName   = custinfo.CustomerName;
                        cust.GUType   = 2;
                    }
                    cust.CSCSubId   = msid;
                    cust.CSCContent = txthdcontent.Text.Trim();
                    cust.CSCTime    = GetConversion();

                    cust.CSCState = 1;

                    cust.CSCTitle = null;
                    int result = new BLL.CustomerServCenter().Add(cust);
                    if (result > 0)
                    {
                        int vid = Convert.ToInt32(Request.QueryString["vid"]);
                        list = new BLL.CustomerServCenter().GetDialogueInfo(msid, msid, vid);
                        Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>window.scroll(0,document.body.scrollHeight) </script>");
                        txthdcontent.Text = string.Empty;
                    }
                    else
                    {
                        Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('回复失败')</script>");
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
示例#3
0
 protected void btnSava_Click(object sender, EventArgs e)
 {
     try
     {
         Model.CustomerInfo cust = new Model.CustomerInfo();
         int custId = Convert.ToInt32(Request.QueryString["id"]);
         cust.CustomerAccount = txtCustomerAccount.Text;
         Model.CustomerInfo custs = new BLL.CustomerInfo().GetModel(custId);
         if (txtCustomerPwd.Text.Trim() != "")
         {
             cust.CustomerPwd = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(txtCustomerPwd.Text, "MD5");
         }
         else
         {
             cust.CustomerPwd = custs.CustomerPwd;
         }
         cust.CustomerName  = txtCustomerName.Text;
         cust.CustomerState = custs.CustomerState;
         cust.CreateDate    = custs.CreateDate;
         cust.CustomerID    = custId;
         bool result = new BLL.CustomerInfo().Update(cust);
         if (result)
         {
             Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('保存成功')</script>");
         }
         else
         {
             Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('保存失败')</script>");
         }
     }
     catch (Exception ec)
     {
         Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + ec.Message + "')</script>");
         throw;
     }
 }
示例#4
0
 private void PrintCustomerPersonInfo(Model.CustomerInfo personInfo)
 {
 }
示例#5
0
        protected void btnlogin_Click(object sender, EventArgs e)
        {
            Session.Clear();
            string username = Request.Form["username"].ToString();
            string passwd   = Request.Form["password"].ToString();

            string md5pass = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(passwd, "MD5");

            try
            {
                if (dropModel.SelectedValue == "0")
                {
                    Model.ManagerInfo manager = new BLL.ManagerInfo().GetModel(username);
                    if (manager == null || string.IsNullOrEmpty(manager.AdminAccount))
                    {
                        Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('帐号不存在,请重新输入')</script>");
                    }
                    else if (md5pass != manager.AdminPasswd)
                    {
                        Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('密码不正确,请重新输入')</script>");
                    }
                    else
                    {
                        Session["manager"] = manager;

                        AddLog(manager.AdminID, 1, DateTime.Now, "在Ip为:" + Request.UserHostAddress + " 的PC端登录");
                        Response.Redirect("Manage\\Management.aspx");
                    }
                }
                else if (dropModel.SelectedValue == "1")
                {
                    Model.AgentInfo agent = new BLL.AgentInfo().GetModel(username);
                    if (agent == null || string.IsNullOrEmpty(agent.AgentAccount))
                    {
                        Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('帐号不存在,请重新输入')</script>");
                    }
                    else if (md5pass != agent.AgentPasswd)
                    {
                        Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('密码不正确,请重新输入')</script>");
                    }
                    else
                    {
                        Session["Agent"] = agent;

                        Model.AgentInfo agents = new Model.AgentInfo();
                        agents.AgentID     = agent.AgentID;
                        agents.LoginIP     = Request.UserHostAddress;
                        agents.LoginTime   = DateTime.Now;
                        agents.OnlineState = 1;
                        new BLL.AgentInfo().UpdateIPonTime(agents);

                        AddLog(agent.AgentID, 2, DateTime.Now, "在IP为:" + Request.UserHostAddress + " 的PC端登录");
                        Response.Redirect("Manage\\AgentInfo.aspx");
                    }
                }
                else if (dropModel.SelectedValue == "2")
                {
                    Model.CustomerInfo cust = new BLL.CustomerInfo().GetModel(username);
                    if (cust == null || string.IsNullOrEmpty(cust.CustomerAccount))
                    {
                        Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('帐号不存在,请重新输入')</script>");
                    }
                    else if (md5pass != cust.CustomerPwd)
                    {
                        Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('密码不正确,请重新输入')</script>");
                    }
                    else
                    {
                        Session["Cust"] = cust;
                        Model.CustomerInfo Customer = new Model.CustomerInfo();
                        Customer.CustomerState   = 1;
                        Customer.CustomerAccount = cust.CustomerAccount;
                        new BLL.CustomerInfo().UpdateState(Customer);
                        Response.Redirect("Manage\\OnlineProblem.aspx");
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
        }