public void ValidUser(string strUserID, string strUsrPwd)
        {
            string    strEPwd    = objSecurity.EncryptWithKey(strUsrPwd, objTool.getAppValue("SecurityKey"));
            DataTable dtUserAuth = objSSMS.Fill_Datatable(objSQL.Con, "spUserAuth", new string[] { "UserList", strUserID, strEPwd });

            if (dtUserAuth.Rows.Count > 0)
            {
                string strRollID        = Convert.ToString(dtUserAuth.Rows[0]["UsrRollID"]);
                string strRollName      = Convert.ToString(dtUserAuth.Rows[0]["UsrRollName"]);
                string strExecutiveCode = Convert.ToString(dtUserAuth.Rows[0]["ExecuteID"]);
                string strExecutiveName = Convert.ToString(dtUserAuth.Rows[0]["Name"]);
                string strItemCode      = Convert.ToString(dtUserAuth.Rows[0]["Item Category Code"]);

                objSession.setSession(HttpContext.Current, objTool.getAppValue("UsrID"), strUserID);
                objSession.setSession(HttpContext.Current, objTool.getAppValue("UsrPwd"), strEPwd);
                objSession.setSession(HttpContext.Current, objTool.getAppValue("UsrRoleID"), strRollID);
                objSession.setSession(HttpContext.Current, objTool.getAppValue("UsrRoleName"), strRollName);
                objSession.setSession(HttpContext.Current, objTool.getAppValue("ExecutiveCode"), strExecutiveCode);
                objSession.setSession(HttpContext.Current, objTool.getAppValue("ExecutiveName"), strExecutiveName);
                objSession.setSession(HttpContext.Current, objTool.getAppValue("ItemCategoryCode"), strItemCode);//
                if (strRollID == "2")
                {
                    Response.Redirect(objRoute.getRouteURL("AppConfig"), false);
                }
                else
                {
                    Response.Redirect(objRoute.getRouteURL("AgentList"), false);
                }
            }
            else
            {
                objTool.jsWarning(ltrNotificationArea, "Please check your User ID or Password again.");
            }
        }
 //User Auth Events
 protected void btnAddUser_Click(object sender, EventArgs e)
 {
     try
     {
         string itemcategory = string.Empty;
         foreach (ListItem li in dpItemCategory.Items)
         {
             if (li.Selected)
             {
                 itemcategory += itemcategory == string.Empty ? li.Text : "|" + li.Text;
             }
         }
         if (rdOption.SelectedIndex == -1)
         {
             objTool.jsWarning(ltrNotificationArea, "Select User Type!");
         }
         else if (rdOption.SelectedIndex == 1 && dpSalesPerson.SelectedIndex == 0)
         {
             objTool.jsWarning(ltrNotificationArea, "Select Sales Person!");
         }
         else if (rdOption.SelectedIndex == -1)
         {
             objTool.jsWarning(ltrNotificationArea, "Select Item Category Code!");
         }
         else if (string.IsNullOrEmpty(txtUserID.Text) || string.IsNullOrWhiteSpace(txtUserID.Text))
         {
             objTool.jsWarning(ltrNotificationArea, "Enter User ID!");
         }
         else if (string.IsNullOrEmpty(txtUsrPwd.Text) || string.IsNullOrWhiteSpace(txtUsrPwd.Text))
         {
             objTool.jsWarning(ltrNotificationArea, "Enter Passsword!");
         }
         else if (string.IsNullOrEmpty(txtConfPassword.Text) || string.IsNullOrWhiteSpace(txtConfPassword.Text))
         {
             objTool.jsWarning(ltrNotificationArea, "Enter Confirm Passsword!");
         }
         else if (string.Compare(txtConfPassword.Text, txtUsrPwd.Text) != 0)
         {
             objTool.jsWarning(ltrNotificationArea, "Enter Password and Confirm Passsword does not match!");
         }
         else if (dpUsrRoll.SelectedIndex == 0)
         {
             objTool.jsWarning(ltrNotificationArea, "Select User Roll!");
         }
         else if (objSSMS.ExecutedStoreProcedure(objSQL.Con, "spUserAuth", new string[] { "getUserCount", txtUserID.Text }) != "0")
         {
             objTool.jsWarning(ltrNotificationArea, "This User already created. Enter Unique User ID.");
         }
         else
         {
             if (string.IsNullOrEmpty(hfUser.Value))
             {
                 objSSMS.ExecutedStoreProcedure(objSQL.Con, "spUserAuth", new string[] { "CreateUser", txtUserID.Text, objSecurity.EncryptWithKey(txtConfPassword.Text, objTool.getAppValue("SecurityKey")), dpUsrRoll.SelectedValue, rdOption.SelectedIndex == 0 ? txtUserID.Text : dpSalesPerson.SelectedValue, itemcategory });
                 UserReset();
                 objTool.jsSuccess(ltrNotificationArea, "New User Created.");
             }
             else
             {
                 objSSMS.ExecutedStoreProcedure(objSQL.Con, "spUserAuth", new string[] { "UpdateUser", txtUserID.Text, string.IsNullOrEmpty(txtConfPassword.Text) == true ? string.Empty : objSecurity.EncryptWithKey(txtConfPassword.Text, objTool.getAppValue("SecurityKey")), dpUsrRoll.SelectedValue, rdOption.SelectedIndex == 0 ? txtUserID.Text : dpSalesPerson.SelectedValue, itemcategory, string.Empty, hfUser.Value });
                 UserReset();
                 objTool.jsSuccess(ltrNotificationArea, "User Updated.");
             }
         }
     }
     catch (Exception ex)
     {
         objTool.jsError(ltrNotificationArea, ex.Message.ToString());
     }
 }