Exemplo n.º 1
0
 protected void btnSubmit_Click(object sender, EventArgs e)
 {
     try
     {
         objApplicationUserBLL          = new BLL.ApplicationUserBLL();
         objApplicationUserDTO          = new DTO.ApplicationUserDTO();
         objApplicationUserDTO.EmailId  = Session["EmailId"].ToString();
         objApplicationUserDTO.Password = txtNewPassword.Text;
         string Result = objApplicationUserBLL.ChangePassword(objApplicationUserDTO);
         if (Result == "True")
         {
             txtPassword.Text = txtNewPassword.Text = txtConPassword.Text = "";
             lblMsg.Text      = "Password Reset Successfully";
             lblMsg.ForeColor = System.Drawing.Color.Green;
         }
         else
         {
             lblMsg.ForeColor = System.Drawing.Color.Red;
             lblMsg.Text      = "Password Reset Fail";
         }
     }
     catch (Exception ex)
     {
     }
 }
 /// <summary>
 /// Update user Profile
 /// </summary>
 /// <param name="objApplicationUserDTO"></param>
 /// <returns></returns>
 public string UpdateUserProfile(PublisherSubcriberNotification.DTO.ApplicationUserDTO objApplicationUserDTO)
 {
     try
     {
         cmd = new SqlCommand();
         open_connection();
         cmd.Connection  = con;
         cmd.CommandType = CommandType.StoredProcedure;
         cmd.CommandText = "SP_UpdateUserprofile";
         cmd.Parameters.Add("@EmailID", objApplicationUserDTO.EmailId);
         cmd.Parameters.Add("@MobileNo", objApplicationUserDTO.MobileNo);
         cmd.Parameters.Add("@Address", objApplicationUserDTO.Address);
         SqlDataReader sqlreader = cmd.ExecuteReader();
         string        Result    = null;
         if (sqlreader.Read())
         {
             Result = sqlreader.GetValue(0).ToString();
         }
         sqlreader.Close();
         con.Close();
         return(Result);
     }
     catch (Exception ex)
     {
         return(ex.ToString());
     }
 }
Exemplo n.º 3
0
 protected void btnSubmit_Click(object sender, EventArgs e)
 {
     try
     {
         objApplicationUserBLL          = new BLL.ApplicationUserBLL();
         objApplicationUserDTO          = new DTO.ApplicationUserDTO();
         objApplicationUserDTO.EmailId  = txtEmailID.Text;
         objApplicationUserDTO.MobileNo = txtMobileNo.Text;
         objApplicationUserDTO.Address  = txtAddress.Text;
         string Result = objApplicationUserBLL.UpdateUserProfile(objApplicationUserDTO);
         if (Result != "0")
         {
             GetUserProfileDetails();
             lblMsg.ForeColor = System.Drawing.Color.Green;
             lblMsg.Text      = "Profile Updation Successfully";
         }
         else
         {
             lblMsg.ForeColor = System.Drawing.Color.Red;
             lblMsg.Text      = "Profile Updation Fail";
         }
     }
     catch (Exception ex)
     {
     }
 }
Exemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            objApplicationuserBLL = new BLL.ApplicationUserBLL();
            objApplicationUserDTO = new DTO.ApplicationUserDTO();
            try
            {
                objApplicationUserDTO.EmailId = Session["EmailId"].ToString();
                string count = objApplicationuserBLL.GetTotalUser_Pub_Sub_Subscriber(objApplicationUserDTO);
                lblTotalUsers.Text                 = count.Split('&')[0];
                lblPublisherCount.Text             = count.Split('&')[1];
                lblOverallPublishContentCount.Text = count.Split('&')[2];
                lblTotalSubscribe.Text             = count.Split('&')[3];

                //objPublishContentSubscribeBLL = new BLL.PublishContentSubscribeBLL();
                //objPublishContentSubscribeDTO = new DTO.PublishContentSubscribeDTO();
                //objPublishContentSubscribeDTO.EmailID = Session["EmailId"].ToString();

                //DataTable tab = new DataTable();
                //tab = objPublishContentSubscribeBLL.GetPublishContent_Top_5(objPublishContentSubscribeDTO);
                //rptImages.DataSource = tab;
                //rptImages.DataBind();

                DataTable tab1 = new DataTable();
                tab1 = objApplicationuserBLL.GetSubscriberRating_Top_5(objApplicationUserDTO);
                rptrating.DataSource = tab1;
                rptrating.DataBind();
            }
            catch (Exception ex)
            {
            }
        }
 /// <summary>
 /// Get User,Publisher,Subscriber Rating Count & Overall PublishContent Count
 /// </summary>
 /// <returns></returns>
 public string GetTotalUser_Pub_Sub_Subscriber(PublisherSubcriberNotification.DTO.ApplicationUserDTO objApplicationUserDTO)
 {
     try
     {
         cmd = new SqlCommand();
         open_connection();
         cmd.Connection  = con;
         cmd.CommandType = CommandType.StoredProcedure;
         cmd.CommandText = "SP_GetTotalUsers_Pub_Sub_Subscriber";
         cmd.Parameters.Add("@EmailID", objApplicationUserDTO.EmailId);
         SqlDataReader sqlreader = cmd.ExecuteReader();
         string        Result    = null;
         if (sqlreader.Read())
         {
             Result = sqlreader.GetValue(0).ToString() + "&" + sqlreader.GetValue(1).ToString() + "&" + sqlreader.GetValue(2).ToString() + "&" + sqlreader.GetValue(3).ToString();
         }
         sqlreader.Close();
         con.Close();
         return(Result);
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
 /// <summary>
 /// Create Application User
 /// </summary>
 /// <param name="objApplicationUser"></param>
 /// <returns></returns>
 public string CreateApplicationUser(PublisherSubcriberNotification.DTO.ApplicationUserDTO objApplicationUser)
 {
     try
     {
         cmd = new SqlCommand();
         open_connection();
         cmd.Connection  = con;
         cmd.CommandType = CommandType.StoredProcedure;
         cmd.CommandText = "SP_CreateApplicationUser";
         cmd.Parameters.Add("@Name", objApplicationUser.Name);
         cmd.Parameters.Add("@Password", objApplicationUser.Password);
         cmd.Parameters.Add("@UserType", objApplicationUser.UserType);
         cmd.Parameters.Add("@EmailID", objApplicationUser.EmailId);
         cmd.Parameters.Add("@MobileNo", objApplicationUser.MobileNo);
         cmd.Parameters.Add("@Address", objApplicationUser.Address);
         cmd.Parameters.Add("@DeviceId", objApplicationUser.DeviceId);
         SqlDataReader sqlreader = cmd.ExecuteReader();
         string        result    = null;
         if (sqlreader.Read())
         {
             result = sqlreader.GetValue(0).ToString();
         }
         sqlreader.Close();
         con.Close();
         return(result);
     }
     catch (Exception ex)
     {
         return(ex.ToString());
     }
 }
 protected void btnSubmit_Click(object sender, EventArgs e)
 {
     objApplicationUserDTO = new DTO.ApplicationUserDTO();
     try
     {
         objApplicationUserDTO.Name     = txtUserName.Text;
         objApplicationUserDTO.Password = txtPassword.Text;
         objApplicationUserDTO.UserType = ddlUserType.SelectedItem.Text;
         objApplicationUserDTO.EmailId  = txtEmailID.Text;
         objApplicationUserDTO.MobileNo = txtMobileNo.Text;
         objApplicationUserDTO.Address  = txtAddress.Text;
         objApplicationUserDTO.DeviceId = txtDeviceId.Value;
         string result = objApplicationUserBLL.CreateApplicationUser(objApplicationUserDTO);
         if (result == "1")
         {
             txtUserName.Text          = txtPassword.Text = txtEmailID.Text = txtMobileNo.Text = txtAddress.Text = "";
             ddlUserType.SelectedIndex = 0;
         }
         else
         {
         }
     }
     catch (Exception ex)
     {
     }
 }
 /// <summary>
 /// Get Subscriber Rating Based on UserId Top 5
 /// </summary>
 /// <returns></returns>
 public DataTable GetSubscriberRating_Top_5(PublisherSubcriberNotification.DTO.ApplicationUserDTO objApplicationUserDTO)
 {
     try
     {
         return(objApplicationUserDAL.GetSubscriberRating_Top_5(objApplicationUserDTO));
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
 /// <summary>
 /// Create New Application User
 /// </summary>
 /// <param name="objApplicationUserDTO"></param>
 /// <returns></returns>
 public string CreateApplicationUser(PublisherSubcriberNotification.DTO.ApplicationUserDTO objApplicationUserDTO)
 {
     try
     {
         return(objApplicationUserDAL.CreateApplicationUser(objApplicationUserDTO));
     }
     catch (Exception ex)
     {
         return(ex.ToString());
     }
 }
 /// <summary>
 /// User Profile Update
 /// </summary>
 /// <param name="ObjApplicationUserDTO"></param>
 /// <returns></returns>
 public string UpdateUserProfile(PublisherSubcriberNotification.DTO.ApplicationUserDTO ObjApplicationUserDTO)
 {
     try
     {
         return(objApplicationUserDAL.UpdateUserProfile(ObjApplicationUserDTO));
     }
     catch (Exception ex)
     {
         return(ex.ToString());
     }
 }
 /// <summary>
 /// Change Password
 /// </summary>
 /// <param name="ObjApplicationUserDTO"></param>
 /// <returns></returns>
 public string ChangePassword(PublisherSubcriberNotification.DTO.ApplicationUserDTO ObjApplicationUserDTO)
 {
     try
     {
         return(objApplicationUserDAL.ChangePassword(ObjApplicationUserDTO));
     }
     catch (Exception ex)
     {
         return(ex.ToString());
     }
 }
 /// <summary>
 /// Get User,Publisher,Subscriber Rating & Overall PublishContent Count
 /// </summary>
 /// <returns></returns>
 public string GetTotalUser_Pub_Sub_Subscriber(PublisherSubcriberNotification.DTO.ApplicationUserDTO objApplicationUserDTO)
 {
     try
     {
         return(objApplicationUserDAL.GetTotalUser_Pub_Sub_Subscriber(objApplicationUserDTO));
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
 /// <summary>
 /// Get User Profile Details
 /// </summary>
 /// <param name="ObjApplicationUserDTO"></param>
 /// <returns></returns>
 public DataTable GetUserProfile_Details(PublisherSubcriberNotification.DTO.ApplicationUserDTO ObjApplicationUserDTO)
 {
     try
     {
         DataTable loaddata = new DataTable();
         return(loaddata = objApplicationUserDAL.GetUserprofile_Details(ObjApplicationUserDTO));
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
 /// <summary>
 /// Login verification
 /// </summary>
 /// <param name="objUserDTO"></param>
 /// <returns></returns>
 public bool GetAdminLogin(PublisherSubcriberNotification.DTO.ApplicationUserDTO objApplicationUserDTO)
 {
     try
     {
         if (objApplicationUserDAL.ApplicationLogin(objApplicationUserDTO))
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
Exemplo n.º 15
0
 private void GetUserProfileDetails()
 {
     try
     {
         objApplicationUserBLL          = new BLL.ApplicationUserBLL();
         objApplicationUserDTO          = new DTO.ApplicationUserDTO();
         objApplicationUserDTO.EmailId  = Session["EmailId"].ToString();
         objApplicationUserDTO.UserType = Session["UserType"].ToString();
         DataTable loaddata = new DataTable();
         loaddata = objApplicationUserBLL.GetUserProfile_Details(objApplicationUserDTO);
         if (loaddata.Rows.Count > 0)
         {
             txtEmailID.Text  = loaddata.Rows[0][0].ToString();
             txtMobileNo.Text = loaddata.Rows[0][1].ToString();
             txtAddress.Text  = loaddata.Rows[0][2].ToString();
         }
     }
     catch (Exception ex)
     {
     }
 }
 /// <summary>
 /// Get Subscriber Rating Based on UserId Top 5
 /// </summary>
 /// <returns></returns>
 public DataTable GetSubscriberRating_Top_5(PublisherSubcriberNotification.DTO.ApplicationUserDTO objApplicationUserDTO)
 {
     try
     {
         cmd = new SqlCommand();
         open_connection();
         SqlDataAdapter adp      = null;
         DataTable      loaddata = new DataTable();
         cmd.Connection  = con;
         cmd.CommandType = CommandType.StoredProcedure;
         cmd.CommandText = "SP_GetSubscriberrating_UserID_Top_5";
         cmd.Parameters.Add("@EmailID", objApplicationUserDTO.EmailId);
         adp = new SqlDataAdapter(cmd);
         adp.Fill(loaddata);
         con.Close();
         return(loaddata);
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
        /// <summary>
        /// Admin/User Login Autherization
        /// </summary>
        /// <param name="objApplicationuserDTO"></param>
        /// <returns></returns>
        public bool ApplicationLogin(PublisherSubcriberNotification.DTO.ApplicationUserDTO objApplicationUser)
        {
            cmd = new SqlCommand();
            open_connection();
            cmd.Connection  = con;
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "SP_LoginVerification";
            cmd.Parameters.Add("@EmailID", objApplicationUser.EmailId);
            cmd.Parameters.Add("@Password", objApplicationUser.Password);
            cmd.Parameters.Add("@UserType", objApplicationUser.UserType);
            int result = int.Parse(cmd.ExecuteScalar().ToString());

            con.Close();
            if (result > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            objApplicationUserDTO = new DTO.ApplicationUserDTO();
            try
            {
                objApplicationUserDTO.EmailId  = txtLoginEmail.Text;
                objApplicationUserDTO.UserType = ddlLoginUserType.SelectedItem.Text;
                objApplicationUserDTO.Password = txtLoginPassword.Text;
                Session["EmailId"]             = txtLoginEmail.Text;
                Session["Password"]            = txtLoginPassword.Text;
                Session["UserType"]            = ddlLoginUserType.SelectedItem.Text;
                if (objApplicationUserBLL.GetAdminLogin(objApplicationUserDTO))
                {
                    switch (ddlLoginUserType.SelectedItem.Text)
                    {
                    case "Admin":
                        Response.Redirect("DashBoard.aspx");
                        break;

                    case "Publisher":
                        Response.Redirect("PublisherDashBoard.aspx");
                        break;

                    case "Subscriber":
                        Response.Redirect("SubscriberDashBoard.aspx");
                        break;
                    }
                }
                else
                {
                    lblMsg.ForeColor = System.Drawing.Color.Red;
                    lblMsg.Text      = "Invalid UserName/Password";
                }
            }
            catch (Exception ex)
            {
            }
        }
 /// <summary>
 /// Get User Profile Details
 /// </summary>
 /// <param name="objApplicationUser"></param>
 /// <returns></returns>
 public DataTable GetUserprofile_Details(PublisherSubcriberNotification.DTO.ApplicationUserDTO objApplicationUser)
 {
     try
     {
         cmd = new SqlCommand();
         open_connection();
         SqlDataAdapter adp      = null;
         DataTable      loaddata = new DataTable();
         cmd.Connection  = con;
         cmd.CommandType = CommandType.StoredProcedure;
         cmd.CommandText = "SP_GetUserProfile_EmailID";
         cmd.Parameters.Add("@EmailID", objApplicationUser.EmailId);
         cmd.Parameters.Add("@UserType", objApplicationUser.UserType);
         adp = new SqlDataAdapter(cmd);
         adp.Fill(loaddata);
         con.Close();
         return(loaddata);
     }
     catch (Exception ex)
     {
         return(null);
     }
 }