示例#1
0
    protected void OKButton_Click(object sender, ImageClickEventArgs e)
    {
        string password;
        string username;
        bool   flag      = false;
        string MdPswdStr = FormsAuthentication.HashPasswordForStoringInConfigFile(txtPassword.Text.ToString(), "MD5");

        username = txtUserName.Text.ToString();
        password = MdPswdStr;
        if (username.Equals("") || password.Equals(""))
        {
            Response.Write("<script language=javascript>alert('用户名和密码不能为空!')</script>");
            return;
        }
        Function_Admin Function_Admin = new Function_Admin();
        DataTable      dt             = new DataTable();

        dt = Function_Admin.User_Login(3, username, password, "");
        if (dt.Rows.Count > 0)
        {
            Response.Write("<script language=javascript>alert('对不起,该用户已经注册!');location='Register.aspx'</script>");
            return;
        }
        else
        {
            Function_Admin.User_Login_insert(4, username, password, "");
            flag = true;
        }
        if (flag)
        {
            Response.Write("<script language=javascript>alert('注册用户成功!'); location='Index.aspx'</script>");
        }
    }
示例#2
0
    protected void OKButton_Click(object sender, ImageClickEventArgs e)
    {
        string uid = "";
        string pwd = "";

        uid = txtUserName.Text.ToString();
        pwd = FormsAuthentication.HashPasswordForStoringInConfigFile(txtPassword.Text.ToString(), "MD5");
        if (uid.Equals("") || pwd.Equals(""))
        {
            Response.Write("<script language=javascript>alert('用户名和密码不能为空!')</script>");
            return;
        }
        Function_Admin Function_Admin = new Function_Admin();
        DataTable      dt             = new DataTable();

        dt = Function_Admin.User_Login(3, uid, pwd, "");
        if (dt.Rows.Count != 0)
        {
            Session["UserLoginName"] = this.txtUserName.Text;
            Response.Redirect("~/Source1/Index.aspx?&uid=" + Session["UserLoginName"].ToString() + "");
        }
        else
        {
            Response.Write("<script>alert('登录失败!请返回查找原因');location='Login.aspx'</script>");
        }
    }
示例#3
0
    protected void btn_submit_Click(object sender, EventArgs e)
    {
        string uid = "";
        string pwd = "";

        uid = txt_uid.Text.ToString();
        DataTable dt1 = new DataTable();

        if (wlbh.Substring(0, 2) != "Z01")
        {
            dt1 = Car.usp_llr_Confirm(5, lydh, Session["UserLoginName"].ToString());
            if (dt1.Rows[0]["create_uid"].ToString() != uid)
            {
                Response.Write("<script language=javascript>alert('当前确认领料人必须和领料申请人一致!')</script>");
                return;
            }
        }
        pwd = FormsAuthentication.HashPasswordForStoringInConfigFile(txt_pwd.Text.ToString(), "MD5");
        if (uid.Equals("") || pwd.Equals(""))
        {
            Response.Write("<script language=javascript>alert('工号和密码不能为空!')</script>");
            return;
        }
        Function_Admin Function_Admin = new Function_Admin();
        DataTable      dt             = new DataTable();

        dt = Function_Admin.User_Login(1, uid, pwd, "");
        if (dt == null || dt.Rows.Count <= 0)
        {
            Response.Write("<script language=javascript>alert('工号和密码输入不正确!')</script>");
            return;
        }
        else
        {
            Response.Write("<script language=javascript>alert('领料成功!')</script>");
            //Response.Write("<script>window.opener=null;window.close();</script>");
            Car.usp_llr_close(2, lydh, Session["UserLoginName"].ToString());
            //Response.Write("<script>window.opener.location.href=window.opener.location.href;window.location.reload</script>");
            //Response.Write("<script>window.close()</script>");
            StringBuilder scriptString = new StringBuilder();
            scriptString.Append("<script language = javascript>");
            scriptString.Append("window.opener.refresh();");

            scriptString.Append(" window.focus();");
            scriptString.Append(" window.opener=null;");
            scriptString.Append(" window.close(); ");

            scriptString.Append("</" + "script>");
            Response.Write(scriptString.ToString());
        }
    }
示例#4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Function_Admin Function_Admin = new Function_Admin();
        DataTable      dt             = new DataTable();

        dt = Function_Admin.User_Login(2, Session["UserLoginName"].ToString(), "", "IT");
        if (dt.Rows.Count > 0)
        {
            this.div1.Style.Add("display", "block");
        }
        else
        {
            this.div1.Style.Add("display", "none");
        }
    }
示例#5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // if (Session["UserLoginName"].ToString() == null)
        if (Session["UserLoginName"] == null)
        {
            Response.Redirect("~/Source1/Login.aspx");
            Response.End();


            return;
        }
        if (!Page.IsPostBack)
        {
            string    uid    = Session["UserLoginName"].ToString();
            DataTable dtcomp = Function_Admin.User_Login(6, uid, "", "");
            Function_Admin.initDrop(DropDownList5, dtcomp, "comp");
            GetData();
        }
    }
示例#6
0
    protected void OKButton_Click(object sender, ImageClickEventArgs e)
    {
        string    uid = Session["UserLoginName"].ToString();
        string    pwd = FormsAuthentication.HashPasswordForStoringInConfigFile(txtPassword_Old.Text.ToString(), "MD5");
        DataTable dt  = Function_Admin.User_Login(3, uid, pwd, "");

        if (dt == null || dt.Rows.Count <= 0)
        {
            Response.Write("<script language=javascript>alert('旧密码输入有误!')</script>");
            return;
        }
        else
        {
            string newpwd = FormsAuthentication.HashPasswordForStoringInConfigFile(txtPassword_Confirm.Text.ToString(), "MD5");
            int    result = Function_Admin.User_Login_insert(5, uid, newpwd, "");
            if (result >= 1)
            {
                Response.Write("<script>alert('密码更新成功!');location='Index.aspx'</script>");
            }
        }
    }
示例#7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // if (Session["UserLoginName"].ToString() == null)
        if (Session["UserLoginName"] == null)
        {
            Response.Redirect("~/Source1/Login.aspx");
            Response.End();


            return;
        }

        string    uid = Session["UserLoginName"].ToString();
        DataTable dt  = new DataTable();

        //dt = Function_Admin.User_Login(2, Session["UserLoginName"].ToString(), "", "仓库");
        //if (dt.Rows.Count<=0)
        //{
        //    Response.Write("<script>javascript:alert('您没仓库确认的权限')</script>");

        //    return;
        //}
        if (!Page.IsPostBack)
        {
            //txtly_date3.Text = DateTime.Now.ToString("MM/dd/yyyy");
            //txtly_date4.Text = DateTime.Now.AddDays(1).ToString("MM/dd/yyyy");
            DataTable dtcomp = Function_Admin.User_Login(6, uid, "", "");
            Function_Admin.initDrop(DropDownList5, dtcomp, "comp");

            DataTable dtcode = new DataTable();
            dtcode = Car.usp_llr_Confirm(9, "", "");
            ddl_code.DataSource     = dtcode;
            ddl_code.DataTextField  = "describ";
            ddl_code.DataValueField = "describ";
            ddl_code.DataBind();
            ddl_code.Items.Insert(0, new ListItem("", ""));
            GetData();
            DisplayGrid();
        }
    }
示例#8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Session["dt"] = null;
        string uid = "";

        if (Session["UserLoginName"] == null)
        {
            Response.Redirect("~/Source1/Login.aspx");
            Response.End();


            return;
        }
        uid = Session["UserLoginName"].ToString();
        if (!IsPostBack)
        {
            DataTable dt1 = SQLHelper.reDs(strsql).Tables[0];
            this.DropDownList2.DataSource     = dt1;
            this.DropDownList2.DataValueField = "pl_prod_line";
            this.DropDownList2.DataTextField  = "pl_desc";
            this.DropDownList2.DataBind();

            DataTable dt = Function_Admin.User_Login(6, uid, "", "");
            Function_Admin.initDrop(DropDownList3, dt, "comp");
            Function_Admin.initDrop(DropDownList4, dt, "comp");
        }

        if (DropDownList2.SelectedItem.Text == "辅料-刀具类")
        {
            Panel2.Visible = true;
            Panel3.Visible = false;
        }
        else
        {
            Panel2.Visible = false;
            Panel3.Visible = true;
        }
    }