Exemplo n.º 1
0
    protected void btn_Save_Click(object sender, EventArgs e)
    {
        if (ValidateFrom())
        {
            DataTable dt = new DataTable();
            try
            {
                if (ddl_Role.SelectedValue == "6")
                {
                    dt = objDist.InserUserBAL(ddl_State.SelectedValue.ToString(), "", "", "", "", ddl_Role.SelectedValue.ToString(), txtUname.Text.Trim(), txtPwdHash.Value, DateTime.Now, Request.ServerVariables["REMOTE_ADDR"].ToString(), ConnKey);
                }
                else
                {
                    dt = objDist.InserUserBAL(ddl_State.SelectedValue.ToString(), ddl_dist_code.SelectedValue.ToString(), ddl_mandal_code.SelectedValue.ToString(), ddl_Inst.SelectedValue.ToString(), ddl_InsType.SelectedValue.ToString(), ddl_Role.SelectedValue.ToString(), txtUname.Text.Trim(), txtPwdHash.Value, DateTime.Now, Request.ServerVariables["REMOTE_ADDR"].ToString(), ConnKey);
                }


                objCommon.ShowAlertMessage(dt.Rows[0][0].ToString());
                // txtInstutionCode.Text = "";
                txtUname.Text = "";
                txtPwd.Text   = "";
                GridData();
            }
            catch (Exception ex)
            {
                ExceptionLogging.SendExcepToDB(ex, Session["UsrName"].ToString(), Request.ServerVariables["REMOTE_ADDR"].ToString());
                Response.Redirect("~/Error.aspx");
            }
            finally
            {
            }
        }
    }