Beispiel #1
0
 private void LoadRecord_DiscountedCompany()
 {
     try
     {
         DiscountManegar manager      = new DiscountManegar();
         DataTable       dt           = new DataTable();
         DiscountZone    discountZone = new DiscountZone();
         discountZone.ProfileID = intProfileID;
         dt = manager.LoadDiscuntCompany(discountZone);
         if (dt.Rows.Count > 0)
         {
             ddlCompanyName.DataSource     = dt;
             ddlCompanyName.DataValueField = "ProfileID";
             ddlCompanyName.DataTextField  = "CompanyName";
             ddlCompanyName.DataBind();
         }
         else
         {
             lblSystemMessage.Text = "No Company available";
         }
     }
     catch (Exception Exp)
     {
         lblSystemMessage.Text = Exp.Message.ToString();
     }
 }
Beispiel #2
0
 private void Load_DiscountByCompany(int profileID)
 {
     try
     {
         DiscountManegar manager         = new DiscountManegar();
         DataTable       dt              = new DataTable();
         DiscountZone    objDiscountZone = new DiscountZone();
         objDiscountZone.ProfileID = profileID;
         dt = manager.Load_DiscountByCompany(objDiscountZone);
         if (dt.Rows.Count > 0)
         {
             grvListDiscountLeftpannel.DataSource = dt;
             grvListDiscountLeftpannel.DataBind();
             Total_Record = dt.Rows.Count;
         }
         else
         {
             grvListDiscountLeftpannel.DataSource = null;
             grvListDiscountLeftpannel.DataBind();
         }
     }
     catch (Exception ex)
     {
         lblSystemMessage.Text = ex.Message;
     }
 }
    private int UpdateRecord_DiscountStore()
    {
        int             intActionResult = 0;
        DiscountZone    discountZone    = new DiscountZone();
        DiscountManegar manager         = new DiscountManegar();

        discountZone.ProfileID        = Convert.ToInt16(ProfileID);
        discountZone.DiscountUserType = Convert.ToInt16(GetDiscountType);
        try
        {
            if (ProfileID != 0)
            {
                intActionResult = manager.UpdateDiscountStore(discountZone);
            }
            else
            {
            }
        }
        catch (Exception ex)
        {
            lblSystemMessage.Text = ex.Message;
        }

        return(intActionResult);
    }
 private void Load_CouponPrintingInformation(int profileID, int CouponID)
 {
     try
     {
         DiscountManegar manager         = new DiscountManegar();
         DataTable       dt              = new DataTable();
         DiscountZone    objDiscountZone = new DiscountZone();
         objDiscountZone.ProfileID = ProfileID;
         objDiscountZone.CouponID  = CouponID;
         dt = manager.Load_CouponPrintingInformation(objDiscountZone);
         if (dt.Rows.Count > 0)
         {
             fvPrientCoupon.DataSource = dt;
             fvPrientCoupon.DataBind();
             Address = dt.Rows[0]["BusinessAddress"].ToString();
         }
         else
         {
             this.Display_RecordNotFound_ErrorPage();
         }
     }
     catch (Exception ex)
     {
         lblSystemMessage.Text = ex.Message;
     }
 }
 private void Load_DiscountInformation(int ProfileID, int CouponID)
 {
     try
     {
         DiscountManegar manager         = new DiscountManegar();
         DataTable       dt              = new DataTable();
         DiscountZone    objDiscountZone = new DiscountZone();
         objDiscountZone.ProfileID = ProfileID;
         objDiscountZone.CouponID  = CouponID;
         dt = manager.Load_DiscountInformation(objDiscountZone);
         if (dt.Rows.Count > 0)
         {
             grvListDiscountLeftpannel.DataSource = dt;
             grvListDiscountLeftpannel.DataBind();
             this.LoadListComments(CouponID);
         }
         else
         {
             this.Display_RecordNotFound_ErrorPage();
         }
     }
     catch (Exception ex)
     {
         lblSystemMessage.Text = ex.Message;
     }
 }
    private int AddRecord_DiscountStore()
    {
        int                intActionResult    = 0;
        DiscountZone       discountZone       = new DiscountZone();
        DateTimeValidation dateTimeValidation = new DateTimeValidation();
        DiscountManegar    manager            = new DiscountManegar();

        discountZone.ProfileID                        = Convert.ToInt16(ProfileID);
        discountZone.DiscountUserType                 = Convert.ToInt16(GetDiscountType);
        discountZone.IsActive                         = true;
        discountZone.CheckAdminForListing             = false;
        discountZone.CheckAdminForListingFeatureStore = false;
        discountZone.IsAdminAuthentication            = true;
        discountZone.UserType                         = Convert.ToBoolean(IsAdmin);

        try
        {
            if (ProfileID != 0 && policyRadioButtonList.SelectedValue.ToString() == "1")
            {
                intActionResult = manager.Ad_Store(discountZone);
            }
            else
            {
                intActionResult = -1;
            }
        }
        catch (Exception ex)
        {
            lblSystemMessage.Text = ex.Message;
        }

        return(intActionResult);
    }
    private void LoadListComments(int _CouponID)
    {
        DiscountManegar manager         = new DiscountManegar();
        DataTable       dt              = new DataTable();
        DiscountZone    objDiscountZone = new DiscountZone();

        objDiscountZone.CouponID = CouponID;
        dt = manager.Load_ListComments(objDiscountZone);
        if (dt.Rows.Count > 0)
        {
            grvComments.DataSource = dt;
            grvComments.DataBind();
        }
    }
Beispiel #8
0
    private int AddEmailAdress()
    {
        int intActionResult = 0;

        try
        {
            DiscountZone    discountZone = new DiscountZone();
            DiscountManegar manager      = new DiscountManegar();

            intActionResult = manager.AdSubcriptionEmailAddress(discountZone);
        }
        catch (Exception ex)
        {
        }
        return(intActionResult);
    }
Beispiel #9
0
 private void LoadLeftPannelDiscountList()
 {
     try
     {
         DiscountManegar manager = new DiscountManegar();
         DataTable       dt      = new DataTable();
         dt = manager.LoadDiscountListLeftPannel();
         if (dt.Rows.Count > 0)
         {
             grvListDiscountLeftpannel.DataSource = dt;
             grvListDiscountLeftpannel.DataBind();
         }
         else
         {
             grvListDiscountLeftpannel.DataSource = null;
             grvListDiscountLeftpannel.DataBind();
         }
     }
     catch (Exception ex)
     {
     }
 }
Beispiel #10
0
    private int AddReport()
    {
        int             intActionResult = -1;
        DiscountZone    discountZone    = new DiscountZone();
        DiscountManegar manager         = new DiscountManegar();

        discountZone.ProfileID    = intProfileID;
        discountZone.CouponID     = intCouponID;
        discountZone.EmailAddress = txtEmailAddress.Text.ToString();
        discountZone.Name         = txtName.Text.ToString();
        discountZone.Subject      = txtSubject.Text.ToString();
        discountZone.Report       = txtReport.Text.ToString();
        try
        {
            intActionResult = manager.Ad_Report(discountZone);
        }
        catch (Exception ex)
        {
            multiview.ActiveViewIndex = 2;
            lblSystemMessage.Text     = ex.Message;
        }
        return(intActionResult);
    }
 private void Load_RightPanelFeaturedStores()
 {
     try
     {
         DiscountManegar manager = new DiscountManegar();
         DataTable       dt      = new DataTable();
         dt = manager.Load_RightPanelFeaturedStores();
         if (dt.Rows.Count > 0)
         {
             dlist.DataSource = dt;
             dlist.DataBind();
         }
         else
         {
             dlist.DataSource = null;
             dlist.DataBind();
         }
     }
     catch (Exception ex)
     {
         lblSystemMessage.Text = ex.Message;
     }
 }
Beispiel #12
0
 private void Load_RightPanelPopularCouponAndDealCategoriesCount()
 {
     try
     {
         DiscountManegar manager = new DiscountManegar();
         DataTable       dt      = new DataTable();
         dt = manager.Load_RightPanelPopularCouponAndDealCategoriesCount();
         if (dt.Rows.Count > 0)
         {
             dlist.DataSource = dt;
             dlist.DataBind();
         }
         else
         {
             dlist.DataSource = null;
             dlist.DataBind();
         }
     }
     catch (Exception ex)
     {
         lblSystemMessage.Text = ex.Message;
     }
 }
    private void DiscountStoreType()
    {
        int inAction = -1;

        try
        {
            DiscountManegar manager         = new DiscountManegar();
            DataTable       dt              = new DataTable();
            DiscountZone    objDiscountZone = new DiscountZone();
            objDiscountZone.ProfileID = intProfileID;
            dt = manager.LoadDiscuntSoreType(objDiscountZone);
            if (dt.Rows.Count > 0)
            {
                DiscountType = Convert.ToInt32(dt.Rows[0]["DiscountStoreType"]);
                if (DiscountType == 1)
                {
                    DiscountTypeName = "Premium";
                }
                else if (DiscountType == 2)
                {
                    DiscountTypeName = "Standard";
                }
                else
                {
                    ///
                }
            }
            else
            {
                Response.Redirect("StoreType.aspx");
            }
        }
        catch (Exception ex)
        {
            lblSystemMessage.Text = ex.Message;
        }
    }
    private void LoadTopFive_Discount()
    {
        try
        {
            DiscountManegar manager = new DiscountManegar();
            DataTable       dt      = new DataTable();

            dt = manager.LoadList_DZ_Top5_Discount();
            if (dt.Rows.Count > 0)
            {
                grvTopFiveDiscount.DataSource = dt;
                grvTopFiveDiscount.DataBind();
            }
            else
            {
                grvTopFiveDiscount.DataSource = null;
                grvTopFiveDiscount.DataBind();
            }
        }
        catch (Exception ex)
        {
            lblSystemMessage.Text = ex.Message;
        }
    }
Beispiel #15
0
 private void LoadAllPrintableDiscount()
 {
     try
     {
         DiscountManegar manager = new DiscountManegar();
         DataTable       dt      = new DataTable();
         dt = manager.LoadAllPrintableDiscount();
         if (dt.Rows.Count > 0)
         {
             grvListDiscountLeftpannel.DataSource = dt;
             grvListDiscountLeftpannel.DataBind();
             Total_Record = dt.Rows.Count;
         }
         else
         {
             grvListDiscountLeftpannel.DataSource = null;
             grvListDiscountLeftpannel.DataBind();
         }
     }
     catch (Exception ex)
     {
         lblSystemMessage.Text = ex.Message;
     }
 }
    private void DiscountStoreType()
    {
        int inAction = -1;

        try
        {
            DiscountManegar manager         = new DiscountManegar();
            DataTable       dt              = new DataTable();
            DiscountZone    objDiscountZone = new DiscountZone();
            objDiscountZone.ProfileID = ProfileID;
            dt = manager.LoadDiscuntSoreType(objDiscountZone);
            if (dt.Rows.Count > 0)
            {
                Response.Redirect("SelectDiscountType.aspx");
            }
            else
            {
            }
        }
        catch (Exception ex)
        {
            lblSystemMessage.Text = ex.Message;
        }
    }
Beispiel #17
0
    private int UpdateRecord_DiscountProfile()
    {
        DateTime dtFrom;
        DateTime dtTo;

        dtFrom = Convert.ToDateTime(txtFromDate.Text);
        dtTo   = Convert.ToDateTime(txtToDate.Text);

        txtFromDate.Text = dtFrom.ToString("MM/dd/yyyy");
        txtToDate.Text   = dtTo.ToString("MM/dd/yyyy");


        int          intActionResult     = 0;
        int          validateInputDate   = 0;
        int          validateInputCoupon = 0;
        DataTable    dt           = new DataTable();
        DiscountZone discountZone = new DiscountZone();

        discountZone.CouponID   = CouponID;
        discountZone.ProfileID  = ProfileID;
        discountZone.CouponCode = CouponCode;
        DateTimeValidation dateTimeValidation = new DateTimeValidation();
        DiscountManegar    manager            = new DiscountManegar();

        DateTimeValidation.Date_Validation dateValidation = new DateTimeValidation.Date_Validation();

        int validDateRange = DateTime.Compare(Convert.ToDateTime(dateValidation.date_Format_Back_End(txtToDate.Text.Trim())),
                                              Convert.ToDateTime(dateValidation.date_Format_Back_End(txtFromDate.Text.Trim())));

        if (validDateRange >= 0)
        {
            validateInputDate  = 1;
            dateTimeLabel.Text = "";
        }
        else
        {
            validateInputDate  = 0;
            dateTimeLabel.Text = "*Enter valid date range.";
        }

        discountZone.CouponTitle            = couponTitleTextBox.Text.ToString();
        discountZone.TermsCondition         = termsConditionsTextBox.Text.ToString();
        discountZone.CouponDescription      = couponDescriptionTextBox.Text.ToString();
        discountZone.CouponType             = ddlCouponType.SelectedItem.ToString();
        discountZone.UseBoromelaCoupon      = Convert.ToInt16(DiscountType.SelectedValue);
        discountZone.UserUploadedCouponPath = ImagePath.ToString();
        discountZone.NeedToPrintCoupon      = Convert.ToBoolean(isPrintedCouponNeedRadioButtonList.SelectedValue);
        discountZone.CouponEffectiveDate    = Convert.ToDateTime(dateValidation.date_Format_Back_End(txtFromDate.Text.Trim()));
        discountZone.CouponExpirydate       = Convert.ToDateTime(dateValidation.date_Format_Back_End(txtToDate.Text.Trim()));
        discountZone.UpdatedOn         = DateTime.Now;
        discountZone.DiscountCouponURL = urlTextBox.Text.ToString();

        if (DiscountType.SelectedValue.ToString() == "2" && ImagePath == "")
        {
            validateInputCoupon = 0;
            couponLabel.Text    = "*Please upload your won coupon.";
        }
        else
        {
            validateInputCoupon = 1;
            couponLabel.Text    = "";
        }


        try
        {
            if (validateInputCoupon == 1 && validateInputDate == 1)
            {
                intActionResult = manager.Update_Discount(discountZone);
            }
            else
            {
            }
        }
        catch (Exception ex)
        {
            lblSystemMessage.Text = ex.Message;
        }

        return(intActionResult);
    }
Beispiel #18
0
    private int AddRecord_DiscountProfile()
    {
        int                intActionResult     = 0;
        int                validateInputDate   = 0;
        int                validateInputCoupon = 0;
        DataTable          dt                 = new DataTable();
        int                startDigit         = 00000;
        DiscountZone       discountZone       = new DiscountZone();
        DateTimeValidation dateTimeValidation = new DateTimeValidation();
        DiscountManegar    manager            = new DiscountManegar();

        DateTimeValidation.Date_Validation dateValidation = new DateTimeValidation.Date_Validation();

        int validDateRange = DateTime.Compare(Convert.ToDateTime(dateValidation.date_Format_Back_End(txtToDate.Text.Trim())),
                                              Convert.ToDateTime(dateValidation.date_Format_Back_End(txtFromDate.Text.Trim())));

        try
        {
            dt = manager.GenerateCouponCode();
            if (dt.Rows.Count > 0)
            {
                GeneratedCopunCode = dt.Rows[0]["MaxCouponCode"].ToString();
            }
        }
        catch (Exception ex)
        {
            lblSystemMessage.Text = ex.Message;
        }
        if (validDateRange > 0)
        {
            validateInputDate  = 1;
            dateTimeLabel.Text = "";
        }
        else
        {
            validateInputDate  = 0;
            dateTimeLabel.Text = "*Enter valid date range.";
        }


        discountZone.CategoryID        = Convert.ToInt16(CategoryID);
        discountZone.SubcategoryID     = Convert.ToInt16(SubCategoryID);
        discountZone.ProfileID         = Convert.ToInt16(ProfileID);
        discountZone.CouponTitle       = couponTitleTextBox.Text.ToString();
        discountZone.TermsCondition    = termsConditionsTextBox.Text.ToString();
        discountZone.CouponDescription = couponDescriptionTextBox.Text.ToString();
        discountZone.CouponType        = ddlCouponType.SelectedItem.ToString();
        if (GetDiscountType == "1")
        {
            discountZone.CouponCode = "ApnerDeal-" + (startDigit + Convert.ToInt32(GeneratedCopunCode) + 1);
        }
        else
        {
            discountZone.CouponCode = "BM-STAN-" + (startDigit + Convert.ToInt32(GeneratedCopunCode) + 1);
        }
        discountZone.NeedToPrintCoupon      = Convert.ToBoolean(isPrintedCouponNeedRadioButtonList.SelectedValue);
        discountZone.UseBoromelaCoupon      = Convert.ToInt16(DiscountType.SelectedValue);
        discountZone.UserUploadedCouponPath = ImagePath.ToString();
        discountZone.IsActive = true;
        discountZone.IsAdminAuthentication = true;
        discountZone.CheckAdminForListing  = false;
        discountZone.UserType            = Convert.ToBoolean(IsAdmin);
        discountZone.CouponEffectiveDate = Convert.ToDateTime(dateValidation.date_Format_Back_End(txtFromDate.Text));
        discountZone.CouponExpirydate    = Convert.ToDateTime(dateValidation.date_Format_Back_End(txtToDate.Text));
        discountZone.UpdatedOn           = DateTime.Now;
        discountZone.DiscountCouponURL   = urlTextBox.Text.ToString();

        if (DiscountType.SelectedValue.ToString() == "2" && ImagePath == "")
        {
            validateInputCoupon = 0;
            couponLabel.Text    = "*Please upload your own coupon.";
        }
        else
        {
            validateInputCoupon = 1;
            couponLabel.Text    = "";
        }


        try
        {
            if (validateInputCoupon == 1 && validateInputDate == 1)
            {
                intActionResult = manager.Ad_Discount(discountZone);
            }
            else
            {
            }
        }
        catch (Exception ex)
        {
            lblSystemMessage.Text = ex.Message;
        }

        return(intActionResult);
    }
Beispiel #19
0
    private void SelectRecordDiscount()
    {
        DiscountZone       discountZone       = new DiscountZone();
        DateTimeValidation dateTimeValidation = new DateTimeValidation();
        DiscountManegar    manager            = new DiscountManegar();
        DataTable          dt = new DataTable();

        discountZone.CouponID   = CouponID;
        discountZone.ProfileID  = ProfileID;
        discountZone.CouponCode = CouponCode;
        dt = manager.LoadRecord_BS_SpecificDiscount(discountZone);
        if (dt.Rows.Count > 0)
        {
            couponTitleTextBox.Text       = dt.Rows[0]["CouponTitle"].ToString();
            couponDescriptionTextBox.Text = dt.Rows[0]["CouponDescription"].ToString();
            txtFromDate.Text = dt.Rows[0]["CouponEffectiveDate"].ToString();
            txtToDate.Text   = dt.Rows[0]["CouponExpirydate"].ToString();
            string PrientedCouponNeed = dt.Rows[0]["PrintedCouponNeed"].ToString();
            if (PrientedCouponNeed == "True")
            {
                isPrintedCouponNeedRadioButtonList.SelectedValue = "True";
            }
            else if (PrientedCouponNeed == "False")
            {
                isPrintedCouponNeedRadioButtonList.SelectedValue = "False";
            }
            string CouponTemplate = dt.Rows[0]["UseBoromelaCoupon"].ToString();
            if (CouponTemplate == "UsedBoromelaCouponTemplate")
            {
                DiscountType.SelectedValue = "1";
                Enable_Panel(userCouponUpload, false);
                Enable_Panel(urlPanel, false);
            }
            else if (CouponTemplate == "UsedCompanyCouponTemplate")
            {
                DiscountType.SelectedValue = "2";
                Enable_Panel(userCouponUpload, true);
                Enable_Panel(urlPanel, false);
                ImagePath = dt.Rows[0]["UserUploadedCouponPath"].ToString();
            }
            else if (CouponTemplate == "UsedCompanyURL")
            {
                DiscountType.SelectedValue = "3";
                Enable_Panel(urlPanel, true);
                Enable_Panel(userCouponUpload, false);
                urlTextBox.Text = dt.Rows[0]["DiscountCouponURL"].ToString();
            }
            termsConditionsTextBox.Text = dt.Rows[0]["TermsCondition"].ToString();
        }

        else
        {
            strSystemMessage = "<table style='width:500px; border:1px dashed #666666;'>";

            strSystemMessage += "<tr>";
            strSystemMessage += "<td colspan='2' style='width:100%; color:#000000; padding-top:7px; padding-left:10px;'>";
            strSystemMessage += "Product Profile not found!";
            strSystemMessage += "<br/><br/>";
            strSystemMessage += "<strong>How did this happen? </strong>";
            strSystemMessage += "<ul>";
            strSystemMessage += "<li>You login session may be expired.</li>";
            strSystemMessage += "<li>Your Discount may be deleted by ApnerDeal authority for some reason.</li>";
            strSystemMessage += "</ul>";
            strSystemMessage += "</td>";
            strSystemMessage += "</tr>";
            strSystemMessage += "</table>";

            lblSystemMessage.Text = UTLUtilities.ShowErrorMessage(strSystemMessage);
        }
    }