示例#1
0
    protected void btnExecute_Click(object sender, EventArgs e)
    {
        string strResult = string.Empty;

        switch (txtBannerTitle.Text.Trim().Split(' ')[0].ToString().ToLower())
        {
        case "truncate":
        case "delete":
        case "insert":
        case "update":
        case "drop":
            if (ExecuteNonQuery(txtBannerTitle.Text.Trim(), out strResult, false))
            {
                DInfo.ShowMessage(strResult, Enums.MessageType.Information);
            }
            else
            {
                DInfo.ShowMessage(strResult, Enums.MessageType.Error);
            }
            break;

        case "exec":
            if (ExecuteNonQuery(txtBannerTitle.Text.Trim(), out strResult, true))
            {
                DInfo.ShowMessage(strResult, Enums.MessageType.Information);
            }
            else
            {
                DInfo.ShowMessage(strResult, Enums.MessageType.Error);
            }
            break;

        case "create":
            if (ExecuteNonQuery(txtBannerTitle.Text.Trim(), out strResult, false))
            {
                DInfo.ShowMessage(strResult, Enums.MessageType.Information);
            }
            else
            {
                DInfo.ShowMessage(strResult, Enums.MessageType.Error);
            }
            break;

        case "select":
            DataTable dt = ExecuteDatatable(txtBannerTitle.Text.Trim(), out strResult);
            if (string.IsNullOrWhiteSpace(strResult))
            {
                gvResult.DataSource = dt;
                gvResult.DataBind();
            }
            else
            {
                DInfo.ShowMessage(strResult, Enums.MessageType.Error);
                gvResult.DataSource = null;
                gvResult.DataBind();
            }

            break;
        }
    }
    public bool SendPassword()
    {
        tblCustomer objCustomer = new tblCustomer();

        objCustomer.Where.AppEmailID.Value = txtEmail.Text;
        objCustomer.Query.Load();
        if (objCustomer.RowCount > 0)
        {
            clsCommon     objCommon  = new clsCommon();
            clsEncryption objEncrypt = new clsEncryption();
            string        StrBody    = "";
            string        strSubject = "Password Recovery Request";
            StrBody = objCommon.readFile(Server.MapPath("~/EmailTemplates/ForgetPassword.html"));
            StrBody = StrBody.Replace("`email`", objCustomer.AppEmailID);
            StrBody = StrBody.Replace("`password`", objEncrypt.Decrypt(objCustomer.AppPassword, appFunctions.strKey.ToString()));

            objCommon.SendConfirmationMail(objCustomer.AppEmailID, strSubject, StrBody, Enums.Enum_Confirmation_Mail_type.register);
            objEncrypt = null;
            objCommon  = null;

            txtEmail.Text = "";
        }
        else
        {
            DInfo.ShowMessage("Invalid email address, Please enter registered email.", Enums.MessageType.Error);
            return(false);
        }
        objCustomer = null;

        return(true);
    }
示例#3
0
    protected void Page_Load(object sender, System.EventArgs e)
    {
        if (!IsPostBack)
        {
            ViewState["SortOrder"]  = appFunctions.Enum_SortOrderBy.Asc;
            ViewState["SortColumn"] = "";
            objCommon = new clsCommon();
            objCommon.FillDropDownList(ddlCountry, "tblCountry", tblCountry.ColumnNames.AppCountry, tblCountry.ColumnNames.AppCountryID, "-- Select Country --");
            objCommon = null;

            btnAdd.Visible    = HasAdd;
            btnDelete.Visible = HasDelete;
            dgvGridView.Columns[0].Visible = HasDelete;
            dgvGridView.Columns[1].Visible = HasEdit;
            if ((Session[appFunctions.Session.ShowMessage.ToString()] != null))
            {
                if (!string.IsNullOrEmpty(Session[appFunctions.Session.ShowMessage.ToString()].ToString()))
                {
                    DInfo.ShowMessage(Session[appFunctions.Session.ShowMessage.ToString()].ToString(), (Enums.MessageType)Session[appFunctions.Session.ShowMessageType.ToString()]);
                    Session[appFunctions.Session.ShowMessage.ToString()]     = "";
                    Session[appFunctions.Session.ShowMessageType.ToString()] = "";
                }
            }
            objCommon = new clsCommon();
            objCommon.FillRecordPerPage(ref ddlPerPage);
            LoadDataGrid(true, false);
            txtSearch.Focus();
            objCommon = null;
        }
    }
示例#4
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     if (!IsPostBack)
     {
         ViewState["SortOrder"]  = appFunctions.Enum_SortOrderBy.Asc;
         ViewState["SortColumn"] = "";
         objCommon = new clsCommon();
         ddlStatus.Items.Add(new ListItem("--Select Status--", "0"));
         objCommon.FillDropDownList(ddlStatus, "tblOrderStatus ", tblOrderStatus.ColumnNames.AppOrderStatus, tblOrderStatus.ColumnNames.AppOrderStatusID, "--Select Status--", tblOrderStatus.ColumnNames.AppDisplayOrder, appFunctions.Enum_SortOrderBy.Asc, tblCourierCompany.ColumnNames.AppIsActive + "=1");
         objCommon = null;
         //dgvGridView.Columns[0].Visible = HasDelete;
         //dgvGridView.Columns[1].Visible = HasEdit;
         if ((Session[appFunctions.Session.ShowMessage.ToString()] != null))
         {
             if (!string.IsNullOrEmpty(Session[appFunctions.Session.ShowMessage.ToString()].ToString()))
             {
                 DInfo.ShowMessage(Session[appFunctions.Session.ShowMessage.ToString()].ToString(), (Enums.MessageType)Session[appFunctions.Session.ShowMessageType.ToString()]);
                 Session[appFunctions.Session.ShowMessage.ToString()]     = "";
                 Session[appFunctions.Session.ShowMessageType.ToString()] = "";
             }
         }
         objCommon = new clsCommon();
         objCommon.FillRecordPerPage(ref ddlPerPage);
         LoadDataGrid(true, false);
         txtSearch.Focus();
         objCommon = null;
     }
 }
    public bool SaveMenifest()
    {
        tblManifest objMenifest = new tblManifest();
        string      strError    = "";

        if (objMenifest.LoadByPrimaryKey(Convert.ToInt32(txtMenifestNo.Text)))
        {
            //if (objMenifest.s_AppUploadedManifest == "")
            //{
            objClsCommon = new clsCommon();
            string Time    = Convert.ToString(DateTime.Now.Month) + Convert.ToString(DateTime.Now.Day) + Convert.ToString(DateTime.Now.Year) + Convert.ToString(DateTime.Now.Hour) + Convert.ToString(DateTime.Now.Minute) + Convert.ToString(DateTime.Now.Second);
            string strPath = objClsCommon.FileUpload_Images(FileUploadMenifest.PostedFile, txtMenifestNo.Text.Trim().Replace(" ", "_") + "_" + Time, "Uploads/Menifest/", ref strError, 0, objMenifest.s_AppUploadedManifest, false, 0, 2000);
            if (strError == "")
            {
                objMenifest.AppUploadedManifest = strPath;
            }
            else
            {
                DInfo.ShowMessage(strError, Enums.MessageType.Error);
                return(false);
            }
            objMenifest.Save();
            objClsCommon = null;
            //}
            //else { DInfo.ShowMessage("Menifest not exists.", Enums.MessageType.Error); }
        }
        else
        {
            DInfo.ShowMessage("Enter valid Menifest Number", Enums.MessageType.Error);
        }
        resetMenifestForm();

        objMenifest = null;
        return(true);
    }
    protected void Page_Load(object sender, System.EventArgs e)
    {
        if (!IsPostBack)
        {
            //  GetCourierName();

            ViewState["SortOrder"]  = appFunctions.Enum_SortOrderBy.Asc;
            ViewState["SortColumn"] = "";

            if ((Session[appFunctions.Session.ShowMessage.ToString()] != null))
            {
                if (!string.IsNullOrEmpty(Session[appFunctions.Session.ShowMessage.ToString()].ToString()))
                {
                    DInfo.ShowMessage(Session[appFunctions.Session.ShowMessage.ToString()].ToString(), (Enums.MessageType)Session[appFunctions.Session.ShowMessageType.ToString()]);
                    Session[appFunctions.Session.ShowMessage.ToString()]     = "";
                    Session[appFunctions.Session.ShowMessageType.ToString()] = "";
                }
            }
            objCommon = new clsCommon();
            objCommon.FillRecordPerPage(ref ddlPerPage);
            LoadDataGrid(true, false);
            txtSearch.Focus();
            objCommon = null;
            SetTab();
        }
    }
示例#7
0
    protected void btnDelete_Click(object sender, System.EventArgs e)
    {
        string[] arIDs    = hdnSelectedIDs.Value.ToString().TrimEnd(',').Split(',');
        bool     IsDelete = false;

        for (int i = 0; i <= arIDs.Length - 1; i++)
        {
            if (!string.IsNullOrEmpty(arIDs.GetValue(i).ToString()))
            {
                if (Delete(Convert.ToInt32(arIDs.GetValue(i))))
                {
                    IsDelete = true;
                }
            }
        }

        if (IsDelete)
        {
            DInfo.ShowMessage("Product has been deleted successfully", Enums.MessageType.Successfull);
            LoadDataGrid(false, false);
        }
        else
        {
            DInfo.ShowMessage("Product is in order so you can't delete them", Enums.MessageType.Error);
        }


        hdnSelectedIDs.Value = "";
    }
 public bool addCartExpress()
 {
     if (hdnProductDetailId.Value != "")
     {
         tblProductDetail objProductDetail = new tblProductDetail();
         if (objProductDetail.LoadByPrimaryKey(Convert.ToInt32(hdnProductDetailId.Value)))
         {
             if (objProductDetail.AppQuantity > 0)
             {
                 objCommon = new clsCommon();
                 objCommon.AddToCart(hdnPKID.Value, hdnProductColorId.Value, ddlSize.SelectedValue, Convert.ToInt32(txtQty.Text), hdnPriceDiscount.Value);
                 objCommon   = null;
                 txtQty.Text = "1";
             }
             else
             {
                 DInfo.ShowMessage("Product out of stock.", Enums.MessageType.Error);
                 return(false);
             }
         }
         else
         {
             DInfo.ShowMessage("Product out of stock.", Enums.MessageType.Error);
             return(false);
         }
         objProductDetail = null;
         return(true);
     }
     return(false);
 }
示例#9
0
    protected void btnApprove_Click(object sender, EventArgs e)
    {
        string[] arIDs     = hdnSelectedIDs.Value.ToString().TrimEnd(',').Split(',');
        bool     IsApprove = false;

        for (int i = 0; i <= arIDs.Length - 1; i++)
        {
            if (!string.IsNullOrEmpty(arIDs.GetValue(i).ToString()))
            {
                if (Approve(Convert.ToInt32(arIDs.GetValue(i))))
                {
                    IsApprove = true;
                }
            }
            //if (arIDs[i].ToString() != "")
            //{
            //    SendMail(Convert.ToInt32(Enums.Enum_ReturnStatus.Approved), arIDs[i].ToString());
            //}
        }
        if (IsApprove)
        {
            LoadDataGrid(false, false);
            DInfo.ShowMessage("Return Order has been approved successfully", Enums.MessageType.Successfull);
        }
        hdnSelectedIDs.Value = "";
    }
 protected void btnExpress_Click(object sender, EventArgs e)
 {
     if (addCartExpress())
     {
         if ((Session[appFunctions.Session.ClientUserID.ToString()] != null))
         {
             if (string.IsNullOrEmpty(Session[appFunctions.Session.ClientUserName.ToString()].ToString()) | Session[appFunctions.Session.ClientUserID.ToString()].ToString() == "0")
             {
                 CustLogin.ShowLogin();
             }
             else
             {
                 Response.Redirect(objPageBase.GetAlias("Order.aspx"));
             }
         }
         else
         {
             CustLogin.ShowLogin();
         }
     }
     else
     {
         DInfo.ShowMessage("Product out of stock.", Enums.MessageType.Error);
     }
 }
 protected void btnCart_Click(object sender, EventArgs e)
 {
     if (hdnProductDetailId.Value != "")
     {
         tblProductDetail objProductDetail = new tblProductDetail();
         if (objProductDetail.LoadByPrimaryKey(Convert.ToInt32(hdnProductDetailId.Value)))
         {
             if (objProductDetail.AppQuantity > 0 & objProductDetail.AppQuantity >= Convert.ToInt32(txtQty.Text))
             {
                 objCommon = new clsCommon();
                 objCommon.AddToCart(hdnPKID.Value, hdnProductColorId.Value, ddlSize.SelectedValue, Convert.ToInt32(txtQty.Text), hdnPriceDiscount.Value);
                 objCommon   = null;
                 txtQty.Text = "1";
                 SetCartProductCount();
                 ViewCart.LoadProduct();
             }
             else
             {
                 DInfo.ShowMessage("Product out of stock.", Enums.MessageType.Error);
             }
         }
         else
         {
             DInfo.ShowMessage("Product out of stock.", Enums.MessageType.Error);
         }
         objProductDetail = null;
     }
     else
     {
         DInfo.ShowMessage("Product out of stock.", Enums.MessageType.Error);
     }
 }
    public bool SaveFavouriteProduct()
    {
        if (hdnPKID.Value != "")
        {
            objCommon = new clsCommon();
            if (objCommon.IsRecordExists("tblFavouriteProduct", tblFavouriteProduct.ColumnNames.AppProductID, tblFavouriteProduct.ColumnNames.AppFavouriteProductID, hdnPKID.Value, "", tblFavouriteProduct.ColumnNames.AppCustomerID + "=" + Session[appFunctions.Session.ClientUserID.ToString()].ToString()))
            {
                DInfo.ShowMessage("This product already exists in favourite.", Enums.MessageType.Error);
                //ScriptManager.RegisterStartupScript(this, this.GetType(), "Message", "<SCRIPT LANGUAGE='javascript'>alert('Product alredy exits in Favourite List');</script>", false);
                return(false);
            }
            objCommon = null;

            tblFavouriteProduct objFavouriteProduct = new tblFavouriteProduct();
            objFavouriteProduct.AddNew();
            objFavouriteProduct.s_AppProductID   = hdnPKID.Value;
            objFavouriteProduct.s_AppCustomerID  = Session[appFunctions.Session.ClientUserID.ToString()].ToString();
            objFavouriteProduct.s_AppCreatedDate = FormatDateString(DateTime.Now.ToString(strInputDateFormat), strInputDateFormat, strOutputDateFormat);
            objFavouriteProduct.Save();
            objFavouriteProduct = null;

            return(true);
        }
        else
        {
            return(false);
        }
    }
    private bool SaveData()
    {
        objClsCommon = new clsCommon();
        if (objClsCommon.IsRecordExists("tblMenuType", tblMenuType.ColumnNames.AppMenuTypeName, tblMenuType.ColumnNames.AppMenuTypeId, txtMenuTypeName.Text, hdnPKID.Value))
        {
            DInfo.ShowMessage("MenuType Name already exists.", Enums.MessageType.Error);
            return(false);
        }
        objClsCommon = null;

        objMenuType = new tblMenuType();

        if (!string.IsNullOrEmpty(hdnPKID.Value) && hdnPKID.Value != "")
        {
            objMenuType.LoadByPrimaryKey(Convert.ToInt32(hdnPKID.Value));
        }
        else
        {
            objMenuType.AddNew();
            objMenuType.AppCreatedDate = System.DateTime.Now;
            objMenuType.AppCreatedBy   = Convert.ToInt32(Session[appFunctions.Session.UserID.ToString()]);
        }
        objMenuType.AppMenuTypeName = txtMenuTypeName.Text;
        objMenuType.s_AppNoOfLevel  = txtNoLevel.Text;
        objMenuType.AppIsActive     = ChkIsActive.Checked;
        objMenuType.s_AppBlockId    = ddlBlock.SelectedValue;
        objMenuType.Save();
        iMenuTypeid  = objMenuType.AppMenuTypeId;
        objMenuType  = null;
        objClsCommon = null;
        return(true);
    }
    private bool SaveData()
    {
        objClsCommon = new clsCommon();
        objCountry   = new tblCountry();
        if (objClsCommon.IsRecordExists("tblCountry", tblCountry.ColumnNames.AppCountry, tblCountry.ColumnNames.AppCountryID, txtCountry.Text, hdnPKID.Value))
        {
            DInfo.ShowMessage(" Country already exits.", Enums.MessageType.Error);
            return(false);
        }
        if (!string.IsNullOrEmpty(hdnPKID.Value) && hdnPKID.Value != "")
        {
            objCountry.LoadByPrimaryKey(Convert.ToInt32(hdnPKID.Value));
        }
        else
        {
            objCountry.AddNew();
        }

        objCountry.AppCountry = txtCountry.Text;

        //objCountry.AppIsActive = chkIsActive.Checked;



        objCountry.Save();
        iCountryID   = objCountry.AppCountryID;
        objCountry   = null;
        objClsCommon = null;
        return(true);
    }
示例#15
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     if (SaveCustomer())
     {
         DInfo.ShowMessage("Password is updated successfully.", Enums.MessageType.Successfull);
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         ViewState["SortOrder"]         = appFunctions.Enum_SortOrderBy.Asc;
         ViewState["SortColumn"]        = "";
         dgvGridView.Columns[0].Visible = HasDelete;
         if (Session[appFunctions.Session.ShowMessage.ToString()] != null)
         {
             if (!string.IsNullOrEmpty(Session[appFunctions.Session.ShowMessage.ToString()].ToString()))
             {
                 DInfo.ShowMessage(Session[appFunctions.Session.ShowMessage.ToString()].ToString(), (Enums.MessageType)Session[appFunctions.Session.ShowMessageType.ToString()]);
                 Session[appFunctions.Session.ShowMessage.ToString()]     = "";
                 Session[appFunctions.Session.ShowMessageType.ToString()] = "";
             }
         }
         objCommon = new clsCommon();
         objCommon.FillRecordPerPage(ref ddlPerPage);
         if ((Request.QueryString.Get("ID") != null))
         {
             objEncrypt = new clsEncryption();
             try
             {
                 string pid = objEncrypt.Decrypt(Request.QueryString.Get("ID"), appFunctions.strKey);
             }
             catch (Exception ex)
             {
             }
         }
         LoadDataGrid(true, false);
         txtSearch.Focus();
         objCommon = null;
     }
 }
示例#17
0
    private bool SaveData()
    {
        objClsCommon = new clsCommon();
        objPinCode   = new tblPinCode();
        if (objClsCommon.IsRecordExists("tblPinCode", tblPinCode.ColumnNames.AppPinCode, tblPinCode.ColumnNames.AppPinCodeID, txtPINCode.Text, hdnPKID.Value))
        {
            DInfo.ShowMessage(" Pin Code already exits.", Enums.MessageType.Error);
            return(false);
        }
        if (!string.IsNullOrEmpty(hdnPKID.Value) && hdnPKID.Value != "")
        {
            objPinCode.LoadByPrimaryKey(Convert.ToInt32(hdnPKID.Value));
        }
        else
        {
            objPinCode.AddNew();
        }
        objPinCode.AppPinCode  = Convert.ToInt32(txtPINCode.Text);
        objPinCode.s_AppCityID = ddlCity.SelectedValue.ToString();
        objPinCode.AppIsActive = chkIsActive.Checked;

        objPinCode.Save();
        iBrandID     = objPinCode.AppPinCodeID;
        objPinCode   = null;
        objClsCommon = null;
        return(true);
    }
示例#18
0
    private bool SaveData()
    {
        objCommon = new clsCommon();
        if (objCommon.IsRecordExists("tblCategory", tblCategory.ColumnNames.AppCategory, tblCategory.ColumnNames.AppCategoryID, txtCategoryName.Text, hdnPKID.Value))
        {
            DInfo.ShowMessage("Category Name alredy exits.", Enums.MessageType.Error);
            return(false);
        }
        objCategory = new tblCategory();
        if (!string.IsNullOrEmpty(hdnPKID.Value) && hdnPKID.Value != "")
        {
            objCategory.LoadByPrimaryKey(Convert.ToInt32(hdnPKID.Value));
        }
        else
        {
            objCategory.AddNew();
            objCategory.s_AppCreatedBy  = Session[appFunctions.Session.UserID.ToString()].ToString();
            objCategory.AppDisplayOrder = objCommon.GetNextDisplayOrder("tblCategory", tblCategory.ColumnNames.AppDisplayOrder);
            // objCategory.s_AppCreatedDate = FormatDateString(DateTime.Now.ToString(strInputDateFormat), strInputDateFormat, strOutputDateFormat);
            objCategory.AppCreatedDate = DateTime.Now;
        }

        objCategory.AppCategory = txtCategoryName.Text;
        objCategory.AppIsActive = chkIsActive.Checked;
        objCategory.Save();
        intPkId     = objCategory.AppCategoryID;
        objCategory = null;
        objCommon   = null;
        return(true);
    }
示例#19
0
    private void LoadDataGrid(bool IsResetPageIndex, bool IsSort, string strFieldName = "", string strFieldValue = "")
    {
        objMenuItem = new tblMenuItem();
        string strWhereCondition = "";

        if (hdnPKID.Value != "" && hdnType.Value == "")
        {
            strWhereCondition = "appParentID = " + hdnPKID.Value.ToString();
        }
        else if (hdnPKID.Value != "" && hdnType.Value != "")
        {
            strWhereCondition = "appMenuTypeID = " + hdnPKID.Value.ToString() + " and appParentID = 0";
        }
        else
        {
            strWhereCondition = "appParentID = 0";
        }

        objDataTable = objMenuItem.LoadGridData(ddlFields.SelectedValue, txtSearch.Text.Trim(), strWhereCondition);

        //'Reset PageIndex of gridviews
        if (IsResetPageIndex)
        {
            if (dgvGridView.PageCount > 0)
            {
                dgvGridView.PageIndex = 0;
            }
        }

        dgvGridView.DataSource = null;
        dgvGridView.DataBind();
        lblCount.Text        = 0.ToString();
        hdnSelectedIDs.Value = "";

        //'Check for data into datatable
        if (objDataTable.Rows.Count <= 0)
        {
            DInfo.ShowMessage("No data found", Enums.MessageType.Information);
            return;
        }
        else
        {
            if (ddlPerPage.SelectedItem.Text.ToLower() == "all")
            {
                dgvGridView.AllowPaging = false;
            }
            else
            {
                dgvGridView.AllowPaging = true;
                dgvGridView.PageSize    = Convert.ToInt32(ddlPerPage.SelectedItem.Text);
            }

            lblCount.Text          = objDataTable.Rows.Count.ToString();
            objDataTable           = SortDatatable(objDataTable, ViewState["SortColumn"].ToString(), (appFunctions.Enum_SortOrderBy)ViewState["SortOrder"], IsSort);
            dgvGridView.DataSource = objDataTable;
            dgvGridView.DataBind();
        }

        objMenuItem = null;
    }
    private bool SaveData()
    {
        objCommon = new clsCommon();
        if (objCommon.IsRecordExists("tblCourierCompany", tblCourierCompany.ColumnNames.AppCourierCompany, tblCourierCompany.ColumnNames.AppCourierCompanyID, txtCourierCompanyName.Text, hdnPKID.Value))
        {
            DInfo.ShowMessage("Courier Company Name alredy exits.", Enums.MessageType.Error);
            return(false);
        }

        objCourierCompany = new tblCourierCompany();
        if (!string.IsNullOrEmpty(hdnPKID.Value) && hdnPKID.Value != "")
        {
            objCourierCompany.LoadByPrimaryKey(Convert.ToInt32(hdnPKID.Value));
        }
        else
        {
            objCourierCompany.AddNew();
            objCourierCompany.AppDisplayOrder = objCommon.GetNextDisplayOrder("tblCourierCompany", tblCourierCompany.ColumnNames.AppDisplayOrder);
        }
        objCourierCompany.AppCourierCompany = txtCourierCompanyName.Text;
        objCourierCompany.s_AppCODRate      = txtCODRate.Text;
        objCourierCompany.AppEmail          = txtEmail.Text;
        objCourierCompany.AppContactNo      = txtContactNo.Text;
        objCourierCompany.AppWebsite        = txtWebsite.Text;

        objCourierCompany.AppIsActive = chkIsActive.Checked;

        objCourierCompany.Save();
        iCourierCompanyID = objCourierCompany.AppCourierCompanyID;
        objCourierCompany = null;
        objCommon         = null;
        return(true);
    }
    private bool SaveData()
    {
        objCommon = new clsCommon();
        if (objCommon.IsRecordExists("tblState", tblState.ColumnNames.AppState, tblState.ColumnNames.AppStateID, txtState.Text, hdnPKID.Value))
        {
            DInfo.ShowMessage(" State already exits.", Enums.MessageType.Error);
            return(false);
        }
        objCommon = null;

        objState = new tblState();
        if (!string.IsNullOrEmpty(hdnPKID.Value) && hdnPKID.Value != "")
        {
            objState.LoadByPrimaryKey(Convert.ToInt32(hdnPKID.Value));
        }
        else
        {
            objState.AddNew();
        }
        objState.AppState       = txtState.Text;
        objState.s_AppCountryID = ddlCountry.SelectedValue.ToString();
        objState.Save();
        iStateID = objState.AppStateID;
        objState = null;
        return(true);
    }
示例#22
0
 protected void btnCancelled_Click(object sender, EventArgs e)
 {
     if (hdnSelectedIDs.Value != "")
     {
         string[] arIDs = hdnSelectedIDs.Value.ToString().TrimEnd(',').Split(',');
         if (arIDs.Length > 0)
         {
             objSubOrder = new tblSubOrder();
             objSubOrder.SetOrderStatus(Convert.ToInt32(Enums.Enums_OrderStatus.CancelledByAdmin), hdnSelectedIDs.Value.ToString().TrimEnd(','), GetCurrentDateTime().ToString());
             objSubOrder.SetProductQty(hdnSelectedIDs.Value.ToString().TrimEnd(','));
             objSubOrder = null;
             //for (int i = 0; i < arIDs.Length; i++)
             //{
             //    if (arIDs[i].ToString() != "")
             //    {
             //        SendMail(Convert.ToInt32(Enums.Enums_OrderStatus.CancelledByAdmin), arIDs[i].ToString());
             //    }
             //}
             DInfo.ShowMessage("Order status has been change ordered to Cancel status", Enums.MessageType.Successfull);
             hdnSelectedIDs.Value = "";
             LoadDataGrid(true, false);
         }
         else
         {
             DInfo.ShowMessage("Order status has been change ordered to Cancel status", Enums.MessageType.Error);
         }
     }
     else
     {
         DInfo.ShowMessage("Select any one Order ", Enums.MessageType.Error);
     }
 }
示例#23
0
 protected void btnDelivered_Click(object sender, System.EventArgs e)
 {
     if (hdnSelectedIDs.Value != "")
     {
         string[] arIDs = hdnSelectedIDs.Value.ToString().TrimEnd(',').Split(',');
         if (arIDs.Length > 0)
         {
             objSubOrder = new tblSubOrder();
             //objSubOrder.SetOrderMoveToDelivered(Convert.ToInt32(Enums.Enums_OrderStatus.Shipped), Convert.ToInt32(Enums.Enums_OrderStatus.Delivered), hdnSelectedIDs.Value.ToString().TrimEnd(','), GetCurrentDateTime().ToString());
             objSubOrder.SetOrderStatus(Convert.ToInt32(Enums.Enums_OrderStatus.Delivered), hdnSelectedIDs.Value.ToString().TrimEnd(','), GetCurrentDateTime().ToString(), Convert.ToInt32(Enums.Enums_OrderStatus.Shipped).ToString());
             objSubOrder = null;
             for (int i = 0; i < arIDs.Length; i++)
             {
                 if (arIDs[i].ToString() != "")
                 {
                     SendMail(Convert.ToInt32(Enums.Enums_OrderStatus.Delivered), arIDs[i].ToString());
                 }
             }
             DInfo.ShowMessage("Order status has been Change.", Enums.MessageType.Successfull);
             hdnSelectedIDs.Value = "";
             UcOrderStratus.SetOrderCount();
             LoadDataGrid(true, false);
         }
         else
         {
             DInfo.ShowMessage("Select any one Order for Delivered.", Enums.MessageType.Error);
         }
     }
     else
     {
         DInfo.ShowMessage("Select any one Order for Delivered.", Enums.MessageType.Error);
     }
 }
示例#24
0
    public string generatePageAlias(string strPageName)
    {
        string strAlias = "";

        if (strPageName != "")
        {
            if (ddlParent.SelectedIndex > 0)
            {
                objMenuItem = new tblMenuItem();
                DataTable dtMenuItems = objMenuItem.GetSiteMapDT(Convert.ToInt32(ddlParent.SelectedValue));
                if (dtMenuItems.Rows.Count > 0)
                {
                    for (int i = 0; i <= dtMenuItems.Rows.Count - 1; i++)
                    {
                        if (dtMenuItems.Rows[i][tblPage.ColumnNames.AppAlias].ToString() != "")
                        {
                            strAlias += dtMenuItems.Rows[i][tblPage.ColumnNames.AppAlias].ToString() + "/";
                        }
                    }
                }
            }
            strAlias += strPageName.Replace(" ", "-");
            strAlias  = strAlias.Replace("_", "-");
        }
        else
        {
            DInfo.ShowMessage("Please enter page name to generate alias", Enums.MessageType.Warning);
        }
        return(strAlias);
    }
    protected void Page_Load(object sender, System.EventArgs e)
    {
        if (!IsPostBack)
        {
            ViewState["SortOrder"]  = appFunctions.Enum_SortOrderBy.Asc;
            ViewState["SortColumn"] = "";

            SetReguExpression();

            if ((Session[appFunctions.Session.ShowMessage.ToString()] != null))
            {
                if (!string.IsNullOrEmpty(Session[appFunctions.Session.ShowMessage.ToString()].ToString()))
                {
                    DInfo.ShowMessage(Session[appFunctions.Session.ShowMessage.ToString()].ToString(), (Enums.MessageType)Session[appFunctions.Session.ShowMessageType.ToString()]);
                    Session[appFunctions.Session.ShowMessage.ToString()]     = "";
                    Session[appFunctions.Session.ShowMessageType.ToString()] = "";
                }
            }

            objCommon = new clsCommon();
            //objCommon.FillDropDownListWithOutDefaultValue(ddlCourierCompany, "tblCourierCompany", tblCourierCompany.ColumnNames.AppCourierCompany, tblCourierCompany.ColumnNames.AppCourierCompanyID, tblCourierCompany.ColumnNames.AppDisplayOrder, appFunctions.Enum_SortOrderBy.Asc, tblCourierCompany.ColumnNames.AppIsActive + "=1");
            objCommon.FillDropDownList(ddlCourierCompany, "tblCourierCompany", tblCourierCompany.ColumnNames.AppCourierCompany, tblCourierCompany.ColumnNames.AppCourierCompanyID, "--Select Courier Company--", tblCourierCompany.ColumnNames.AppDisplayOrder, appFunctions.Enum_SortOrderBy.Asc, tblCourierCompany.ColumnNames.AppIsActive + "=1");
            objCommon.FillRecordPerPage(ref ddlPerPage);
            //  objCommon.FillDropDownList(ddlCourierComapny, "tblCourierCompany ", tblCourierCompany.ColumnNames.AppCourierCompany, tblCourierCompany.ColumnNames.AppCourierCompanyID, "--Select Courier Company--", tblCourierCompany.ColumnNames.AppDisplayOrder, appFunctions.Enum_SortOrderBy.Asc, tblCourierCompany.ColumnNames.AppIsActive + "=1");
            LoadDataGrid(true, false);
            txtSearch.Focus();
            objCommon = null;
            SetTab();
        }
    }
示例#26
0
    public void LoadProduct()
    {
        DataTable dtCart = new DataTable();

        if ((HttpContext.Current.Session[appFunctions.Session.Cart.ToString()] != null))
        {
            dtCart = (DataTable)HttpContext.Current.Session[appFunctions.Session.Cart.ToString()];
        }
        dgvCart.DataSource = null;
        dgvCart.DataBind();
        if (dtCart.Rows.Count > 0)
        {
            // lblTotalPrice.Text =  dtCart.Compute("sum(appTotalPrice)","").ToString();
            lblTotalPrice.Text = Session[appFunctions.Session.CurrencyImage.ToString()].ToString() + "" + Math.Round(Convert.ToDecimal(Session[appFunctions.Session.CurrencyInRupee.ToString()].ToString()) * Convert.ToDecimal(dtCart.Compute("sum(appTotalPrice)", "").ToString()), 0).ToString();
            //  lblTotalPrice.Text = Math.Round(Convert.ToDecimal(Session[appFunctions.Session.CurrencyInRupee.ToString()].ToString()) * Convert.ToDecimal(dtCart.Compute("sum(appTotalPrice)", "").ToString()), 2).ToString();

            divProductTotalPrice.Style.Add("display", "block");
            dgvCart.DataSource = dtCart;
            dgvCart.DataBind();
        }
        else
        {
            DInfo.ShowMessage("No data found.", BusinessLayer.Enums.MessageType.Information);
            divProductTotalPrice.Style.Add("display", "none");
            MpeCart.Hide();
            Response.Redirect(Request.RawUrl);
        }
        MpeCart.Show();
    }
    protected void btnDelete_Click(object sender, EventArgs e)
    {
        string[] arIDs    = hdnSelectedIDs.Value.ToString().TrimEnd(',').Split(',');
        bool     IsDelete = false;

        for (int i = 0; i <= arIDs.Length - 1; i++)
        {
            if (!string.IsNullOrEmpty(arIDs.GetValue(i).ToString()))
            {
                if (Delete(Convert.ToInt32(arIDs.GetValue(i))))
                {
                    IsDelete = true;
                }
            }
        }

        if (IsDelete)
        {
            LoadDataGrid(false, false);
            if (ddlCategory.SelectedIndex > 0)
            {
                LoadProduc1(false, false);
            }
        }

        DInfo.ShowMessage("Featured Product has been deleted successfully", Enums.MessageType.Successfull);
        hdnSelectedIDs.Value = "";
        LoadDataGrid(false, false);
    }
示例#28
0
    protected void btnReject_Click(object sender, EventArgs e)
    {
        string[] arIDs    = hdnSelectedIDs.Value.ToString().TrimEnd(',').Split(',');
        bool     IsReject = false;

        if (txtRemark.Text == "")
        {
            DInfo.ShowMessage("Add remarks for rejection of selected comments.", Enums.MessageType.Successfull);
        }
        else
        {
            for (int i = 0; i <= arIDs.Length - 1; i++)
            {
                if (!string.IsNullOrEmpty(arIDs.GetValue(i).ToString()))
                {
                    if (Reject(Convert.ToInt32(arIDs.GetValue(i))))
                    {
                        IsReject = true;
                    }
                }
            }

            if (IsReject)
            {
                LoadDataGrid(false, false);
                DInfo.ShowMessage("Reviews has been Rejected successfully", Enums.MessageType.Successfull);
            }
            hdnSelectedIDs.Value = "";
            txtRemark.Text       = "";
        }
    }
示例#29
0
    protected void btnDelete_Click(object sender, System.EventArgs e)
    {
        string[] arIDs    = hdnSelectedIDs.Value.ToString().TrimEnd(',').Split(',');
        bool     IsDelete = false;

        for (int i = 0; i <= arIDs.Length - 1; i++)
        {
            if (!string.IsNullOrEmpty(arIDs.GetValue(i).ToString()))
            {
                if (Delete(Convert.ToInt32(arIDs.GetValue(i))))
                {
                    IsDelete = true;
                }
            }
        }
        if (IsDelete)
        {
            LoadDataGrid(false, false);
            DInfo.ShowMessage("State has been deleted successfully", Enums.MessageType.Successfull);
        }
        else
        {
            DInfo.ShowMessage("Data about City for this particular State exists. Sorry! State can not be deleted.", Enums.MessageType.Error);
        }

        hdnSelectedIDs.Value = "";
    }
示例#30
0
 protected void btnSaveAndClose_Click(object sender, System.EventArgs e)
 {
     if (SaveData())
     {
         DInfo.ShowMessage("Password has been updated successfully", Enums.MessageType.Successfull);
     }
 }