示例#1
0
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            //string strEnc = string.Empty;
            //List<UserBE> objUserBO1 = objUserDA.GetUserListDA(1);
            //for (int idx = 0; idx < objUserBO1.Count; idx++)
            //{
            //    strEnc = EBirdUtility.Encrypt(objUserBO1[idx].Password);
            //    objUserDA.UpdateUserPasswordEncrypted(objUserBO1[idx].UserID.ToString(), strEnc);
            //}

            List<UserBE> objUserBO = objUserDA.GetAuthenticatedUserDA(txtEmailID.Text.Trim(), EBirdUtility.Encrypt(txtPassword.Text.Trim()));
            if (objUserBO.Count > 0)
            {

                //if (objUserBO[0].UserStatus == "Active")
                if (objUserBO[0].AuthenticationState == "")
                {
                    Session["UserID"] = objUserBO[0].UserID;
                    Session["EmailID"] = txtEmailID.Text.Trim();
                    HttpContext.Current.Session.Add("UserID", objUserBO[0].UserID);
                    Session["ClientID"] = objUserBO[0].ClientID;
                    Session["Role"] = objUserBO[0].Role;

                    ClientDA objClientDA = new ClientDA();

                    List<ClientBE> objClientBE = objClientDA.GetClientDetailDA(objUserBO[0].ClientID);
                    if (objClientBE.Count > 0)
                    {
                        Session["PackageSubscribed"] = objClientBE[0].CurrentPkgSubscribed;
                        Session["Client_LanguageID"] = objClientBE[0].LanguageID;
                        Session["Client_TimeZoneID"] = objClientBE[0].TimeZoneID;
                        Session["Client_DateFormat"] = objClientBE[0].DateFormat;
                    }
                    Session["FullName"] = objUserBO[0].FirstName + " " + objUserBO[0].LastName;
                    if (objUserBO[0].Role == "SSAdmin" || objUserBO[0].Role == "AEAdmin")
                        //lblMsg.Text = "SSAdmin";
                        Response.Redirect("~/Pages/Client");
                    else
                    {
                        Session["PREMIUM_FEATURE"] = "," + objClientDA.GetPremiumFeatureDetailDA(Convert.ToInt32(objUserBO[0].ClientID));
                        Response.Redirect("~/Pages/Webinar");
                    }
                }
                else
                {
                    if (objUserBO[0].AuthenticationState == "UA002" || objUserBO[0].AuthenticationState == "UA003")
                    {
                        phChangePassword.Visible = true;
                        phLogin.Visible = false;
                        InvalidPlaceholder.Visible = false;
                    }
                    else
                    {
                        lblError1.Text = objErr.getMessage(objUserBO[0].AuthenticationState);
                        InvalidPlaceholder.Visible = true;
                    }
                }
            }
            else
            {
                lblError1.Text = objErr.getMessage("SS0004");
                InvalidPlaceholder.Visible = true;
            }
        }
示例#2
0
        // MiG 11/29/2012
        public void UpdateLockedStatus(object sender, System.EventArgs e)
        {
            try
            {
                int[] usrCount = objUserDA.GetClientUserCountDA(Convert.ToInt32(Session["ClientID"]));
                //Loop Through Grid
                foreach (GridDataItem item in tgrdUserList.Items)
                {
                    //Set Current Status
                    string CheckboxStatus = "Active";
                    //Get User
                    string strtest = (item["EmailID"].Text);
                    // Get Checkbox Value
                    CheckBox LockCheckBox = (CheckBox)item.FindControl("chkLock");
                    if ((LockCheckBox.Checked))
                        CheckboxStatus = "Inactive";

                    // Check if existing value has changed; if so, update database
                    List<UserBE> objUserBE = new List<UserBE>();
                    objUserBE = objUserDA.GetUserDetailDA(strtest);
                    if (objUserBE.Count > 0)
                    {
                        if (objUserBE[0].UserStatus != CheckboxStatus)
                        {
                            objUserDA.UpdateUserLockedFieldDA(strtest, CheckboxStatus);
                            ClientDA ObjClientDA = new ClientDA();

                            AuditLogBE objAuditlog = new AuditLogBE();
                            objAuditlog.ActionByID = Convert.ToInt32(Session["UserID"]);
                            objAuditlog.ActionID = Convert.ToInt32(AuditActions.Client_inactive_vs_Active);
                            objAuditlog.ActionDetail = "Updated user account " + strtest + " status to " + CheckboxStatus;
                            objAuditlog.ClientID = Convert.ToInt32(Session["ClientID"]);
                            ObjClientDA.SaveAuditRecord(objAuditlog);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
示例#3
0
        private void initializeAudiComponents()
        {
            Label lbl;
            CheckBox chk;

            if (Convert.ToString(Session["PackageSubscribed"]) == "Custom")
            {
                ClientDA objClientDA = new ClientDA();
                List<ConfigParameterBE> objConfigParameterBE = objClientDA.GetClientConfigIDsDA(Convert.ToInt32(Session["ClientID"]));
                for (int idx = 0; idx < objConfigParameterBE.Count; idx++)
                {
                    chk = (CheckBox)FindControl("chkConfig" + Convert.ToString(objConfigParameterBE[idx].ConfigID));
                    if (chk != null)
                    {
                        chk.Enabled = true;
                        chk.ForeColor = System.Drawing.Color.Black;
                        HyperLink hlnk = (HyperLink)FindControl("lbtnConfig" + Convert.ToString(objConfigParameterBE[idx].ConfigID));
                        if (hlnk != null)
                            hlnk.Enabled = true;
                    }
                    lbl = (Label)this.FindControl("lblConfig" + Convert.ToString(objConfigParameterBE[idx].ConfigID));
                    if (lbl != null)
                        lbl.ForeColor = System.Drawing.Color.Black;
                }
            }
            else
            {
                MasterDA objMasterDA = new MasterDA();
                List<PackageFeature> objPkg = objMasterDA.GetPackageFeatures(Convert.ToString(Session["PackageSubscribed"]));
                foreach (PackageFeature pf in objPkg)
                {
                    lbl = (Label)this.FindControl("lblConfig" + pf.FeatureID.ToString());
                    if (lbl != null)
                        lbl.ForeColor = System.Drawing.Color.Black;
                    chk = (CheckBox)this.FindControl("chkConfig" + pf.FeatureID.ToString());
                    if (chk != null)
                    {
                        chk.Enabled = true;
                        chk.ForeColor = System.Drawing.Color.Black;
                    }
                }
            }
        }