Пример #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Page.Title      = "User Role - " + System.Configuration.ConfigurationManager.AppSettings["AminPageTitle"];
            ltrheading.Text = "User Role";

            DataTable dtSeleectedMenu = new DataTable();
            BindMenuEditMode(dtSeleectedMenu);
            BindUserType();

            if (Request.QueryString["id"] != "" && Request.QueryString["id"] != null)
            {
                if (RegExp.IsNumericValue(Request.QueryString["id"]))
                {
                    //check is sub admin is viewing his own account
                    if (Session["AdminType"] != null && Convert.ToString(Session["AdminType"]) == "subadmin")
                    {
                        if (Convert.ToInt32(Session["adminId"]) != Convert.ToInt32(Request.QueryString["id"]))
                        {
                            Response.Redirect("adminuser.aspx");
                        }
                    }

                    BindSingleUser();
                }
                else
                {
                    Response.Redirect("home.aspx");
                }
            }
            hdTotalMenu.Value = menucount.ToString();
        }
    }
Пример #2
0
    protected void btncancel_Click(object sender, EventArgs e)
    {
        if (Request.QueryString["id"] != "" && Request.QueryString["id"] != null)
        {
            if (RegExp.IsNumericValue(Request.QueryString["id"]))
            {
                DataTable dtcontent = new DataTable();

                string fullimagepath   = string.Empty;
                string thumbimagepath  = string.Empty;
                string rectimagepath   = string.Empty;
                string mediumimagepath = string.Empty;

                fullimagepath   = Server.MapPath("../" + AppSettings.BRAND_ACTULE_ROOTURL + hdImage.Value);
                thumbimagepath  = Server.MapPath("../" + AppSettings.BRAND_THUMB_ROOTURL + hdImage.Value);
                rectimagepath   = Server.MapPath("../" + AppSettings.BRAND_THUMBRECT_ROOTURL + hdImage.Value);
                mediumimagepath = Server.MapPath("../" + AppSettings.BRAND_MEDIUM_ROOTURL + hdImage.Value);

                CommonFunctions.DeleteFile(fullimagepath);
                CommonFunctions.DeleteFile(thumbimagepath);
                CommonFunctions.DeleteFile(rectimagepath);
                CommonFunctions.DeleteFile(mediumimagepath);

                objBrand.idbrand = Convert.ToInt32(Request.QueryString["id"]);
                objBrand.DeleteBrand();
                objBrand.DeleteBrandlanguage();
                //   lblmsg.Text = "Delete Brand Successfully";
                Response.Redirect("add_brand.aspx?flag=delete");
            }
        }
    }
Пример #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Page.Title      = "Add/Modify Admin Menu - " + System.Configuration.ConfigurationManager.AppSettings["AminPageTitle"];
        ltrheading.Text = "Add/Modify Admin Menu";
        if (!Page.IsPostBack)
        {
            BindParentMenu();
            Page.Title      = "Add Admin Menu - " + System.Configuration.ConfigurationManager.AppSettings["AminPageTitle"];
            ltrheading.Text = "Add Admin Menu";
            if (Request.QueryString["flag"] == "edit")
            {
                Title           = "Modify Admin Menu - " + System.Configuration.ConfigurationManager.AppSettings["AminPageTitle"];
                ltrheading.Text = "Modify Admin Menu";
                if (Request.QueryString["id"] != "" && Request.QueryString["id"] != null)
                {
                    if (RegExp.IsNumericValue(Request.QueryString["id"]))
                    {
                        DataTable dtcontent = new DataTable();
                        objMenu.idmenu = Convert.ToInt32(Request.QueryString["id"]);
                        dtcontent      = objMenu.SelectSingleItemByMenuId();
                        if (dtcontent.Rows.Count > 0)
                        {
                            txtmenuname.Text            = Server.HtmlDecode(dtcontent.Rows[0]["title"].ToString());
                            ddlParentMenu.SelectedValue = Convert.ToString(dtcontent.Rows[0]["parentid"].ToString());
                            txtPageName.Text            = Server.HtmlDecode(dtcontent.Rows[0]["pageurl"].ToString());
                            txtImageName.Text           = Server.HtmlDecode(dtcontent.Rows[0]["imagepath"].ToString());
                            txtsortorder.Text           = dtcontent.Rows[0]["sortorder"].ToString();
                            chkvisible.Checked          = Convert.ToInt32(dtcontent.Rows[0]["isactive"]) == 1 ? true : false;
                            hfprevsort.Value            = dtcontent.Rows[0]["sortorder"].ToString();

                            //hdpageurl.Value = Server.HtmlDecode(dtcontent.Rows[0]["pageurl"].ToString());
                            //chkseparate.Checked = Convert.ToInt32(dtcontent.Rows[0]["isseparate"]) == 1 ? true : false;
                            //editorcontentsdesc1.Text = Server.HtmlDecode(dtcontent.Rows[0]["menuDesc"].ToString());
                        }
                    }
                    else
                    {
                        Response.Redirect("menu.aspx");
                    }
                }
                else
                {
                    Response.Redirect("menu.aspx");
                }
            }
            else
            {
                txtsortorder.Text = Convert.ToString(CommonFunctions.GetLastSortCount("menu", "sortorder"));
            }
        }
    }
Пример #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //lblemailerrmsg.Visible = false;
        //lblusererrmsg.Visible = false;
        txtfname.Focus();
        if (!Page.IsPostBack)
        {
            Page.Title      = "Add User - " + System.Configuration.ConfigurationManager.AppSettings["AminPageTitle"];
            ltrheading.Text = "Add User";
            bindadmintype();
            if (Request.QueryString["flag"] == "edit")
            {
                //bindadmintype();
                Title           = "Modify User - " + System.Configuration.ConfigurationManager.AppSettings["AminPageTitle"];
                ltrheading.Text = "Modify User";
                if (Request.QueryString["id"] != "" && Request.QueryString["id"] != null)
                {
                    if (RegExp.IsNumericValue(Request.QueryString["id"]))
                    {
                        //check is sub admin is viewing his own account
                        if (Session["AdminType"] != null && Convert.ToString(Session["AdminType"]) == "subadmin")
                        {
                            if (Convert.ToInt32(Session["adminId"]) != Convert.ToInt32(Request.QueryString["id"]))
                            {
                                Response.Redirect("adminuser.aspx");
                            }
                        }

                        BindSingleUser();
                    }
                    else
                    {
                        Response.Redirect("home.aspx");
                    }
                }
                else
                {
                    Response.Redirect("home.aspx");
                }
            }
            else
            {
                DataTable dtSeleectedMenu = new DataTable();
                BindMenuEditMode(dtSeleectedMenu);
            }
            //savemenu.Visible = true;
            hdTotalMenu.Value = menucount.ToString();
        }
    }
Пример #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Page.Title      = "Add/Modify CMS - " + System.Configuration.ConfigurationManager.AppSettings["AminPageTitle"];
     ltrheading.Text = "Add/Modify CMS";
     if (!Page.IsPostBack)
     {
         Page.Title      = "Add CMS - " + System.Configuration.ConfigurationManager.AppSettings["AminPageTitle"];
         ltrheading.Text = "Add CMS";
         if (Request.QueryString["flag"] == "edit")
         {
             Title           = "Modify CMS - " + System.Configuration.ConfigurationManager.AppSettings["AminPageTitle"];
             ltrheading.Text = "Modify CMS";
             if (Request.QueryString["id"] != "" && Request.QueryString["id"] != null)
             {
                 if (RegExp.IsNumericValue(Request.QueryString["id"]))
                 {
                     DataTable dtcontent = new DataTable();
                     objcontent.Id = Convert.ToInt32(Request.QueryString["id"]);
                     dtcontent     = objcontent.SelectSingleItemById();
                     if (dtcontent.Rows.Count > 0)
                     {
                         txtcontentname.Text = Server.HtmlDecode(dtcontent.Rows[0]["ContentTitle"].ToString());
                         txtdesc.Text        = Server.HtmlDecode(dtcontent.Rows[0]["ContentDesc"].ToString());
                         txtmetatitle.Text   = Server.HtmlDecode(dtcontent.Rows[0]["MetaTitle"].ToString());
                         txtmetakey.Text     = Server.HtmlDecode(dtcontent.Rows[0]["MetaKeyword"].ToString());
                         txtmetadesc.Text    = Server.HtmlDecode(dtcontent.Rows[0]["MetaDescription"].ToString());
                         txtsortorder.Text   = dtcontent.Rows[0]["DisplayRank"].ToString();
                         chkvisible.Checked  = Convert.ToInt32(dtcontent.Rows[0]["DisplayStatus"]) == 1 ? true : false;
                         hfprevsort.Value    = dtcontent.Rows[0]["DisplayRank"].ToString();
                     }
                 }
                 else
                 {
                     Response.Redirect("viewcontent.aspx");
                 }
             }
             else
             {
                 Response.Redirect("viewcontent.aspx");
             }
         }
         else
         {
             txtsortorder.Text = Convert.ToString(CommonFunctions.GetLastSortCount("tblContentCms", "DisplayRank"));
         }
     }
 }
Пример #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Page.Title      = "Add/Modify Language - " + System.Configuration.ConfigurationManager.AppSettings["AminPageTitle"];
     ltrheading.Text = "Add/Modify Language";
     if (!Page.IsPostBack)
     {
         Page.Title      = "Add Language - " + System.Configuration.ConfigurationManager.AppSettings["AminPageTitle"];
         ltrheading.Text = "Add Language";
         if (Request.QueryString["flag"] == "edit")
         {
             Title           = "Modify Language - " + System.Configuration.ConfigurationManager.AppSettings["AminPageTitle"];
             ltrheading.Text = "Modify Language";
             if (Request.QueryString["id"] != "" && Request.QueryString["id"] != null)
             {
                 if (RegExp.IsNumericValue(Request.QueryString["id"]))
                 {
                     DataTable dtcontent = new DataTable();
                     objlanguage.languageId = Convert.ToInt32(Request.QueryString["id"]);
                     dtcontent = objlanguage.GetSinglelanguage();
                     if (dtcontent.Rows.Count > 0)
                     {
                         txtlanguadename.Text = Server.HtmlDecode(dtcontent.Rows[0]["languageName"].ToString());
                         txtalign.Text        = Convert.ToString(dtcontent.Rows[0]["textAlign"].ToString());
                         //txtsortorder.Text = dtcontent.Rows[0]["sortorder"].ToString();
                         chkvisible.Checked = Convert.ToInt32(dtcontent.Rows[0]["isactive"]) == 1 ? true : false;
                         //hfprevsort.Value = dtcontent.Rows[0]["sortorder"].ToString();
                     }
                 }
                 else
                 {
                     Response.Redirect("viewlanguage.aspx");
                 }
             }
             else
             {
                 Response.Redirect("viewlanguage.aspx");
             }
         }
         //else
         //{
         //    txtsortorder.Text = Convert.ToString(CommonFunctions.GetLastSortCount("menu", "sortorder"));
         //}
     }
 }
Пример #7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Page.Title      = "Add/Modify User Type - " + System.Configuration.ConfigurationManager.AppSettings["AminPageTitle"];
     ltrheading.Text = "Add/Modify User Type";
     if (!Page.IsPostBack)
     {
         Page.Title      = "Add User Type - " + System.Configuration.ConfigurationManager.AppSettings["AminPageTitle"];
         ltrheading.Text = "Add User Type";
         if (Request.QueryString["flag"] == "edit")
         {
             Title           = "Modify User Type - " + System.Configuration.ConfigurationManager.AppSettings["AminPageTitle"];
             ltrheading.Text = "Modify User Type";
             if (Request.QueryString["id"] != "" && Request.QueryString["id"] != null)
             {
                 if (RegExp.IsNumericValue(Request.QueryString["id"]))
                 {
                     DataTable dtcontent = new DataTable();
                     objusertype.adminTypeId = Convert.ToInt32(Request.QueryString["id"]);
                     dtcontent = objusertype.SelectSingleItemById();
                     if (dtcontent.Rows.Count > 0)
                     {
                         txtadmintype.Text  = Server.HtmlDecode(dtcontent.Rows[0]["typeName"].ToString());
                         txtsortorder.Text  = dtcontent.Rows[0]["sortorder"].ToString();
                         chkvisible.Checked = Convert.ToInt32(dtcontent.Rows[0]["isactive"]) == 1 ? true : false;
                         hfprevsort.Value   = dtcontent.Rows[0]["sortorder"].ToString();
                     }
                 }
                 else
                 {
                     Response.Redirect("viewusertype.aspx");
                 }
             }
             else
             {
                 Response.Redirect("viewusertype.aspx");
             }
         }
         else
         {
             txtsortorder.Text = Convert.ToString(CommonFunctions.GetLastSortCount("adminType", "sortorder"));
         }
     }
 }
Пример #8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Page.Title      = "Add/Modify Customer - " + System.Configuration.ConfigurationManager.AppSettings["AminPageTitle"];
        ltrheading.Text = "Add/Modify Customer";
        if (!Page.IsPostBack)
        {
            Page.Title      = "Add Customer - " + System.Configuration.ConfigurationManager.AppSettings["AminPageTitle"];
            ltrheading.Text = "Add Customer";
            if (Request.QueryString["flag"] == "edit")
            {
                Title           = "Modify Customer - " + System.Configuration.ConfigurationManager.AppSettings["AminPageTitle"];
                ltrheading.Text = "Modify Customer";
                if (Request.QueryString["id"] != "" && Request.QueryString["id"] != null)
                {
                    if (RegExp.IsNumericValue(Request.QueryString["id"]))
                    {
                        DataTable dtcontent    = new DataTable();
                        DataTable dttotalsales = new DataTable();
                        objcustomer.customerId = Convert.ToInt32(Request.QueryString["id"]);
                        dtcontent = objcustomer.GetSingleCustomer();

                        //customer total order and sales
                        dttotalsales = objcustomer.GetSalesAndOrderTotalByCustomerId();
                        if (dttotalsales.Rows.Count > 0)
                        {
                            lblnoOrders.InnerText  = Convert.ToString(dttotalsales.Rows[0]["TotalOrder"]);
                            lblTotalSale.InnerText = Convert.ToString(dttotalsales.Rows[0]["totalSales"]);
                        }
                        // customer content
                        if (dtcontent.Rows.Count > 0)
                        {
                            txtcontactname.Text           = Convert.ToString(dtcontent.Rows[0]["contactName"]);
                            txtcompanyname.Text           = Convert.ToString(dtcontent.Rows[0]["companyName"]);
                            txtstreetaddress.Text         = Convert.ToString(dtcontent.Rows[0]["streetAddress"]);
                            txtcity.Text                  = Convert.ToString(dtcontent.Rows[0]["city"]);
                            txtcountry.Text               = Convert.ToString(dtcontent.Rows[0]["country"]);
                            txtstorenumber.Text           = Convert.ToString(dtcontent.Rows[0]["storePhoneNumber"]);
                            txtgpslocation.Text           = Convert.ToString(dtcontent.Rows[0]["gpsLocation"]);
                            hidlongleti.Value             = Convert.ToString(dtcontent.Rows[0]["gpsLocation"]);
                            txtmobile.Text                = Convert.ToString(dtcontent.Rows[0]["mobile"]);
                            txtemail.Text                 = Convert.ToString(dtcontent.Rows[0]["email"]);
                            txtpassword.Text              = Convert.ToString(dtcontent.Rows[0]["newPassword"]);
                            txtglobelrate.Text            = Convert.ToString(dtcontent.Rows[0]["globleDiscountRate"]);
                            txtcredit.Text                = Convert.ToString(dtcontent.Rows[0]["creditLimit"]);
                            txtreducepercent.Text         = Convert.ToString(dtcontent.Rows[0]["reducePercent"]);
                            ddldays.SelectedValue         = Convert.ToString(dtcontent.Rows[0]["xdays"]);
                            chkcod.Checked                = Convert.ToBoolean(dtcontent.Rows[0]["caseOnDelivery"]);
                            chkallowcradit.Checked        = Convert.ToBoolean(dtcontent.Rows[0]["allowCreditcard"]);
                            ddlcustomertype.SelectedValue = Convert.ToString(dtcontent.Rows[0]["customerType"]);

                            if (Convert.ToInt32(dtcontent.Rows[0]["languagePreferance"]) == Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["English"]))
                            {
                                rbtenglish.Checked = true;
                            }
                            else
                            {
                                rbtaribic.Checked = true;
                            }
                            if (Convert.ToString(dtcontent.Rows[0]["newPassword"]) != "")
                            {
                                //reqtxtpassword.Enabled = false;
                                hidpass.Value = Convert.ToString(dtcontent.Rows[0]["newPassword"]);
                            }
                            ltrJoineddate.Text       = Convert.ToDateTime(dtcontent.Rows[0]["createDate"]).ToShortDateString();
                            divCustomerSales.Visible = true;

                            ScriptManager.RegisterStartupScript(this, GetType(), "initialize", "initialize();", true);
                        }
                    }
                    else
                    {
                        Response.Redirect("viewcustomer.aspx");
                    }
                }
                else
                {
                    Response.Redirect("viewcustomer.aspx");
                }
            }
            ScriptManager.RegisterStartupScript(this, GetType(), "initialize", "initialize();", true);
        }
    }
Пример #9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Page.Title        = "Add/Modify Brand - " + System.Configuration.ConfigurationManager.AppSettings["AminPageTitle"];
        ltrheading.Text   = "Add/Modify Brand";
        btncancel.Visible = false;
        if (!Page.IsPostBack)
        {
            BindBrandItem();
            BindLanguagesOnPageLoad();
            BindLanguagesOnTabLoad();
            Page.Title      = "Add Brand - " + System.Configuration.ConfigurationManager.AppSettings["AminPageTitle"];
            ltrheading.Text = "Add Brand";
            lblmsg.Visible  = false;
            if (Request.QueryString["flag"] == "add")
            {
                lblmsg.Visible = true;
                lblmsgs.Text   = "Brand added successfully";
            }

            if (Request.QueryString["flag"] == "delete")
            {
                lblmsg.Visible = true;
                lblmsgs.Text   = "Brand deleted successfully";
            }

            if (Request.QueryString["fg"] == "edt")
            {
                lblmsg.Visible = true;
                lblmsgs.Text   = "Brand updated successfully";
            }

            if (Request.QueryString["flag"] == "edit")
            {
                Title           = "Modify Brand - " + System.Configuration.ConfigurationManager.AppSettings["AminPageTitle"];
                ltrheading.Text = "Modify Brand";
                if (Request.QueryString["id"] != "" && Request.QueryString["id"] != null)
                {
                    if (RegExp.IsNumericValue(Request.QueryString["id"]))
                    {
                        DataTable dtcontent = new DataTable();
                        objBrand.idbrand = Convert.ToInt32(Request.QueryString["id"]);

                        BindBrandLanguageOnedit(objBrand.idbrand);
                        dtcontent = objBrand.SelectSingleItemByBrandId();
                        if (dtcontent.Rows.Count > 0)
                        {
                            if (dtcontent.Rows[0]["imgName"].ToString() != "")
                            {
                                //RequiredFieldValidator10.Visible = false;
                                //reqimageg.Enabled = false;
                                spimg.Visible = true;
                                hdImage.Value = Server.HtmlDecode(dtcontent.Rows[0]["imgName"].ToString());
                                ancImage.HRef = "~/" + AppSettings.BRAND_ACTULE_ROOTURL + hdImage.Value;
                            }

                            txtsortorder.Text = dtcontent.Rows[0]["sortorder"].ToString();
                            //ddlactive.SelectedValue = Convert.ToString(dtcontent.Rows[0]["isactive"].ToString());
                            if (Convert.ToBoolean(dtcontent.Rows[0]["isactive"].ToString()) == false)
                            {
                                ddlactive.SelectedValue = "0";
                            }
                            else
                            {
                                ddlactive.SelectedValue = "1";
                            }

                            hfprevsort.Value = dtcontent.Rows[0]["sortorder"].ToString();
                        }
                        btncancel.Visible = true;
                    }
                    else
                    {
                        Response.Redirect("add_brand.aspx");
                    }
                }
                else
                {
                    Response.Redirect("add_brand.aspx");
                }
            }
            else
            {
                txtsortorder.Text = Convert.ToString(CommonFunctions.GetLastSortCount("brand", "sortorder"));
            }
        }
    }