Exemplo n.º 1
0
    /// <summary>
    /// Loads SecondSubcategory List Based On SubcategoryID.
    /// </summary>
    private void LoadRecord_2ndSubcategory(int _CategoryID, int _SubcategoryID)
    {
        try
        {
            using (BC_Corporate_ProductProfile bcProductProfile = new BC_Corporate_ProductProfile())
            {
                ddl2ndSubCategory.Items.Clear();
                ddl2ndSubCategory.Items.Add(new ListItem("Select Second Subcategory", "-1"));

                DataTable dt2ndSubcategory = bcProductProfile.LoadRecord_2ndSubcategory(_CategoryID, _SubcategoryID);
                if (dt2ndSubcategory.Rows.Count > 0)
                {
                    ddl2ndSubCategory.DataSource     = dt2ndSubcategory;
                    ddl2ndSubCategory.DataValueField = "SecondSubcatID";
                    ddl2ndSubCategory.DataTextField  = "SecondSubCategory";
                    ddl2ndSubCategory.DataBind();
                }
                else
                {
                    lblSystemMessage.Text = UTLUtilities.ShowGeneralMessage("No Secondary sub category available");
                }
            }
        }
        catch (Exception Exp)
        {
            lblSystemMessage.Text = Exp.Message.ToString();
        }
    }
Exemplo n.º 2
0
    /// <summary>
    /// Loads all the Product Model Depending on SecondSuubcatID.
    /// </summary>
    private void LoadList_Model()
    {
        try
        {
            int categoryID     = Convert.ToInt32(ddlCategory.SelectedValue);
            int subCategoryID  = Convert.ToInt32(ddlSubcategory.SelectedValue);
            int secondSubcatID = Convert.ToInt32(ddl2ndSubCategory.SelectedValue);

            using (BC_Corporate_ProductProfile bcProductProfile = new BC_Corporate_ProductProfile())
            {
                DataTable dtModel = bcProductProfile.LoadList_Model(categoryID, subCategoryID, secondSubcatID);
                if (dtModel.Rows.Count > 0)
                {
                    ddlModel.Items.Clear();
                    ddlModel.Items.Add(new ListItem("Select Model", "-1"));
                    ddlModel.DataSource     = dtModel;
                    ddlModel.DataValueField = "ProductModelID";
                    ddlModel.DataTextField  = "ProductModel";
                    ddlModel.DataBind();
                }
                else
                {
                    ddlModel.Items.Clear();
                    ddlModel.Items.Add(new ListItem("Select Model", "-1"));
                    ddlModel.DataSource = null;
                    ddlModel.DataBind();
                    lblSystemMessage.Text = UTLUtilities.ShowGeneralMessage("No Model available");
                }
            }
        }
        catch (Exception Exp)
        {
            lblSystemMessage.Text = Exp.Message.ToString();
        }
    }
    /// <summary>
    /// Loads List of seller type epending On SubcategoryID from RealEstateSellerType table.
    /// </summary>
    /// <param name="intSubcategoryID"></param>
    private void LoadList_SellerType(int intSubcategoryID)
    {
        try
        {
            using (BC_Corporate_ProductProfile bcProductProfile = new BC_Corporate_ProductProfile())
            {
                ddlSellerType.Items.Clear();
                ddlSellerType.Items.Add(new ListItem("Select Seller Type", "-1"));

                DataTable dtSellerType = bcProductProfile.RealEstate_LoadList_SellerType(intSubcategoryID);
                if (dtSellerType.Rows.Count > 0)
                {
                    ddlSellerType.DataSource     = dtSellerType;
                    ddlSellerType.DataValueField = "SellerTypeID";
                    ddlSellerType.DataTextField  = "SellerType";
                    ddlSellerType.DataBind();
                }
                else
                {
                    lblSystemMessage.Text = UTLUtilities.ShowGeneralMessage("No Seller Type available.");
                }
            }
        }
        catch (Exception Exp)
        {
            lblSystemMessage.Text = Exp.Message.ToString();
        }
    }
Exemplo n.º 4
0
    protected void saveChangeInnerDiscount(object sender, EventArgs e)
    {
        int         rowsCount = GridView2.Rows.Count;
        GridViewRow gridRow;
        TextBox     effectiveDateTextBox;
        TextBox     expirydateTextBox;
        DateTime    effectiveDate;
        DateTime    expirydate;

        DateTimeValidation.Date_Validation dateValidation = new DateTimeValidation.Date_Validation();
        for (int i = 0; i <= rowsCount; i++)
        {
            gridRow              = GridView2.Rows[i];
            strCouponID          = GridView2.DataKeys[i]["CouponID"].ToString();
            strCouponCode        = GridView2.DataKeys[i]["CouponCode"].ToString();
            strProfileIDDiscount = GridView2.DataKeys[i]["ProfileID"].ToString();
            effectiveDateTextBox = (TextBox)gridRow.FindControl("effectiveDateTextBox");
            expirydateTextBox    = (TextBox)gridRow.FindControl("expirydateTextBox");
            if (Int32.TryParse(strCouponID, out intCouponID) && Int32.TryParse(strProfileIDDiscount, out intProfileIDDiscount) && DateTime.TryParse(dateValidation.date_Format_Back_End(effectiveDateTextBox.Text.Trim()), out effectiveDate) && DateTime.TryParse(dateValidation.date_Format_Back_End(expirydateTextBox.Text.Trim()), out expirydate))
            {
                try
                {
                    using (BC_Product bcProduct = new BC_Product())
                    {
                        DateTime EffDate = Convert.ToDateTime(effectiveDate);
                        success = success && bcProduct.Update_DiscounteffectiveDate(intCouponID, intProfileIDDiscount, effectiveDate, expirydate);
                    }
                }
                catch (Exception ex)
                {
                    success = false;
                    lblSystemMessageDiscount.Text = UTLUtilities.ShowErrorMessage("Error:" + ex.Message);
                }
            }
            else
            {
                success = false;
            }
            lblSystemMessageDiscount.Text = success ?
                                            UTLUtilities.ShowSuccessMessage("<br />Your discount date range were successfully updated!<br />") :
                                            UTLUtilities.ShowGeneralMessage("<br />Some Effective Date or Expiry Date updates failed! Please verify your Ads List!<br />");
        }

        this.LoadList_PostedAllDiscount();
    }