public void BindData()
    {
        DataTable dtAdminProfile = AdminProfileClass.GetAdminProfile_ByID(1);

        if (dtAdminProfile.Rows.Count > 0)
        {
            hfID.Value = "1";

            DataRow dr = dtAdminProfile.Rows[0];

            tbFirstName.Text = dr["FirstName"].ToString();
            tbLastName.Text  = dr["LastName"].ToString();
            tbEmailID.Text   = dr["EmailID"].ToString();

            tbDOB.Text = (!string.IsNullOrEmpty(dr["DOB"].ToString()) ? Convert.ToDateTime(dr["DOB"].ToString()).ToString(MyLogic.DateFormat) : "");

            tbAddress.Text  = dr["Address"].ToString();
            tbMobileNo.Text = dr["MobileNo"].ToString();

            string PathDir = "../SiteLogo/" + dr["SiteLogo"].ToString();

            iCompanyLogo.ImageUrl   = PathDir;
            Session["SiteLogo"]     = dr["SiteLogo"].ToString();
            rActiveSiteLog.Checked  = bool.Parse(dr["IsLogoActive"].ToString());
            tbSiteTextLogo.Text     = dr["SiteTextLogo"].ToString();
            rActiveSiteText.Checked = bool.Parse(dr["IsTextActive"].ToString());
        }
    }
Exemple #2
0
 protected void btnsignin_Click(object sender, EventArgs e)
 {
     if (Session["USERNAME"] == null)
     {
         MEMBERS.SQLReturnValue mRes = AdminProfileClass.CheckUserLogin_FrantEndUsers(txtUserName.Text, txtPWD.Text);
         if (mRes.ValueFromSQL != 0)
         {
             Session["USERNAME"] = mRes.MessageFromSQL;
             MyLogic.GetUserID   = mRes.ValueFromSQL.ToString();
             if (Session["Upload"] != null)
             {
                 Session["Upload"] = null;
                 Response.Redirect("upload_video.aspx");
             }
             else
             {
                 Response.Redirect("Default.aspx");
             }
         }
         else
         {
             ScriptManager.RegisterStartupScript(this, this.GetType(), "noti", "setMessage('SingIn Failed Please Try Again.',1);", true);
         }
     }
     else
     {
         ScriptManager.RegisterStartupScript(this, this.GetType(), "noti", "setMessage('SingIn Already Exists.',1);", true);
     }
 }
Exemple #3
0
 protected void btLogin_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(tbUserName.Text) || string.IsNullOrEmpty(tbPassword.Text))
     {
         lErrMessage.Visible   = true;
         lErrMessage.InnerText = "Enter user name & password first.";
     }
     else
     {
         MEMBERS.SQLReturnValue mRes = AdminProfileClass.CheckUserLogin(tbUserName.Text, tbPassword.Text, (Int32)MyLogic.UserType.AdminPanel);
         if (mRes.ValueFromSQL == 0)
         {
             lErrMessage.Visible   = true;
             lErrMessage.InnerText = mRes.MessageFromSQL;
         }
         else
         {
             MyLogic.GetUserID   = mRes.MessageFromSQL;
             MyLogic.GetUserType = ((Int32)MyLogic.UserType.AdminPanel).ToString();
             Response.Redirect("Dashboard.aspx");
         }
     }
 }
    protected void btSave_Click(object sender, EventArgs e)
    {
        AdminProfileClass obj = new AdminProfileClass();

        obj.FirstName = tbFirstName.Text;
        obj.LastName  = tbLastName.Text;
        obj.EmailID   = tbEmailID.Text;

        if (!string.IsNullOrEmpty(tbDOB.Text))
        {
            obj.DOB = MyLogic.GetDateFormatProper(tbDOB.Text);
        }

        obj.Address  = tbAddress.Text;
        obj.MobileNo = tbMobileNo.Text;

        obj.EmailID = tbEmailID.Text;

        string PathDir = Server.MapPath("~/SiteLogo/");

        if (fSiteLogo.HasFile)
        {
            string ImageName = fSiteLogo.PostedFile.FileName;
            if (hfID.Value == string.Empty)
            {
                fSiteLogo.SaveAs(PathDir + "\\" + ImageName);
            }
            else
            {
                if (File.Exists(Path.Combine(PathDir, Session["SiteLogo"].ToString())))
                {
                    File.Delete(Path.Combine(PathDir, Session["SiteLogo"].ToString()));
                    fSiteLogo.SaveAs(PathDir + "\\" + ImageName);
                }
            }
            obj.SiteLogo = ImageName;
        }
        else
        {
            obj.SiteLogo = Session["SiteLogo"].ToString();
        }

        obj.SiteTextLogo = tbSiteTextLogo.Text;

        if (rActiveSiteLog.Checked)
        {
            obj.IsLogoActive = true;
            obj.IsTextActive = false;
        }
        else if (rActiveSiteText.Checked)
        {
            obj.IsLogoActive = false;
            obj.IsTextActive = true;
        }
        else
        {
            if (fSiteLogo.HasFile)
            {
                obj.IsLogoActive = true;
                obj.IsTextActive = false;
            }
            else if (!string.IsNullOrEmpty(tbSiteTextLogo.Text))
            {
                obj.IsLogoActive = false;
                obj.IsTextActive = true;
            }
        }

        MEMBERS.SQLReturnValue mRes;
        if (hfID.Value == string.Empty)
        {
            obj.Flag = "ADD";
            mRes     = AdminProfileClass.Insert_Update_AdminProfile(obj);
        }
        else
        {
            obj.Flag            = "EDIT";
            obj.AdminProfileIDP = Int64.Parse(hfID.Value);
            mRes = AdminProfileClass.Insert_Update_AdminProfile(obj);
        }
        ScriptManager.RegisterStartupScript(this, this.GetType(), "noti", "setMessage('<b>" + mRes.MessageFromSQL + "</b>',1);", true);
        BindData();
    }