public void LoadSmvInfoRequestIdWise(int requestId)
    {
        int buyerIdForLoad = 0;

        try
        {
            MerchantGateway merchantGateway = new MerchantGateway();
            DataTable       dt = merchantGateway.LoadMerchantRequestInfoRequestIdWise(requestId);

            if (dt.Rows.Count > 0)
            {
                buyerNameDropDownList.SelectedValue = Convert.ToString(dt.Rows[0]["BuyerId"]);
                buyerIdForLoad = Convert.ToInt32(dt.Rows[0]["BuyerId"]);
                string value = Convert.ToString(dt.Rows[0]["SampleStageId"]);
                sampleStageHiddenField.Value = value;

                loadSampleStageForUpdate(buyerIdForLoad);

                sampleStageDropDownList.SelectedValue = sampleStageHiddenField.Value;
                fabricDropDownList.SelectedValue      = Convert.ToString(dt.Rows[0]["FabricId"]);
                styleNumberTextBox.Text           = Convert.ToString(dt.Rows[0]["StyleNumber"]);
                designTextBox.Text                = Convert.ToString(dt.Rows[0]["DesignNumber"]);
                ProductDropDownList.SelectedValue = Convert.ToString(dt.Rows[0]["ProductId"]);
            }
        }
        catch (Exception ex)
        {
        }
    }
Пример #2
0
    public string GetMerchantInfo(int merchantId)
    {
        StringBuilder   table           = new StringBuilder();
        DataTable       dt              = new DataTable();
        MerchantGateway merchantGateway = new MerchantGateway();

        try
        {
            dt = merchantGateway.GetMerchantInfo(merchantId);
            int count = 0;
            if (dt.Rows.Count > 0)
            {
                table.Append("<table class='table table-bordered'><thead><tr class='success'>" +
                             "<th>Serial No</th>" +
                             "<th>Merchant Name</th>" +
                             "<th>Login Id</th>" +
                             "<th>Is Active</th>" +
                             "<th>Posted By</th>" +
                             "<th>Posted On</th>" +
                             "<th>Updated By</th>" +
                             "<th>Updated On</th>" +
                             "<th>Action</th>" +
                             "</tr></thead >");
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    count++;

                    table.Append("<tbody><tr>");
                    table.Append("<td>" + count + "</td>");
                    table.Append("<td>" + dt.Rows[i]["MerchantName"] + "</td>");
                    table.Append("<td>" + dt.Rows[i]["LogInId"] + "</td>");
                    table.Append("<td>" + dt.Rows[i]["IsActive"] + "</td>");
                    table.Append("<td>" + dt.Rows[i]["PostedByName"] + "</td>");
                    table.Append("<td>" + dt.Rows[i]["PostedOn"] + "</td>");
                    table.Append("<td>" + dt.Rows[i]["UpdatedByName"] + "</td>");
                    table.Append("<td>" + dt.Rows[i]["UpdatedOn"] + "</td>");
                    table.Append("<td><a href ='NewMerchantEntryPanel.aspx?id=" + dt.Rows[i]["MerchantId"] + "'> EDIT </a> </td>");
                    table.Append("</tr></tbody>");
                }
                table.Append("</table>");
            }
            else
            {
                table.Append("No Data Found");
            }
        }
        catch (Exception ex)
        {
        }
        return(table.ToString());
    }
Пример #3
0
    public int UpdateMerchantInfo(MerchantModel merchant)
    {
        int             actionResult    = 0;
        MerchantGateway merchantGateway = new MerchantGateway();

        try
        {
            actionResult = merchantGateway.UpdateMerchantInfo(merchant);
            return(actionResult);
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
Пример #4
0
    public int UpdateMerchantRequest(int RequestId)
    {
        int actionResult = 0;

        try
        {
            MerchantGateway merchantGateway = new MerchantGateway();
            actionResult = merchantGateway.UpdateMerchantRequest(RequestId);

            return(actionResult);
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
Пример #5
0
    public DataTable InsertNewMerchant(MerchantModel merchant)
    {
        DataTable       dt = new DataTable();
        MerchantGateway merchantGateway = new MerchantGateway();

        try
        {
            dt = merchantGateway.InsertNewMerchant(merchant);

            return(dt);
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
    protected void sendButton_Click(object sender, EventArgs e)
    {
        MerchantSmvRequestModel merchantSmvRequestModel = new MerchantSmvRequestModel();
        MerchantGateway         merchantGateway         = new MerchantGateway();
        DataTable dt           = new DataTable();
        int       actionResult = 0;
        string    pdfFileName  = String.Empty;

        try
        {
            if (RequestId > 0)
            {
                dt = merchantGateway.LoadMerchantRequestInfoRequestIdWise(RequestId);
                if (dt.Rows.Count > 0)
                {
                    merchantSmvRequestModel.SmvRequestId      = RequestId;
                    merchantSmvRequestModel.MerchantId        = Convert.ToInt32(dt.Rows[0]["MerchantId"]);
                    merchantSmvRequestModel.BuyerId           = Convert.ToInt32(dt.Rows[0]["BuyerId"]);
                    merchantSmvRequestModel.SampleStageId     = Convert.ToInt32(dt.Rows[0]["SampleStageId"]);
                    merchantSmvRequestModel.StyleNumber       = dt.Rows[0]["StyleNumber"].ToString();
                    merchantSmvRequestModel.DesignNumber      = dt.Rows[0]["DesignNumber"].ToString();
                    merchantSmvRequestModel.ProductCategoryId = Convert.ToInt32(dt.Rows[0]["ProductId"]);
                    merchantSmvRequestModel.FabricId          = Convert.ToInt32(dt.Rows[0]["FabricId"]);
                    merchantSmvRequestModel.SendToUserId      = Convert.ToInt32(dt.Rows[0]["SendToUserId"]);

                    pdfFileName = merchantSmvRequestModel.MerchantId.ToString()
                                  + merchantSmvRequestModel.BuyerId.ToString()
                                  + merchantSmvRequestModel.SampleStageId.ToString()
                                  + merchantSmvRequestModel.FabricId.ToString()
                                  + merchantSmvRequestModel.ProductCategoryId.ToString()
                                  + merchantSmvRequestModel.StyleNumber.ToString()
                                  + "_" + merchantSmvRequestModel.DesignNumber.ToString()
                                  + merchantSmvRequestModel.SendToUserId.ToString();

                    actionResult = merchantGateway.UpdateMerchantRequest(merchantSmvRequestModel.SmvRequestId);
                    if (actionResult > 0)
                    {
                        PdfFileUpload(pdfFileName);
                    }
                }
            }
        }
        catch (Exception ex)
        {
        }
    }
Пример #7
0
    public void LoadMerchantInfoForUpdate(int loadMerchantId)
    {
        DataTable       dt = new DataTable();
        MerchantGateway merchantGateway = new MerchantGateway();

        try
        {
            if (loadMerchantId > 0)
            {
                dt = merchantGateway.GetMerchantInfo(loadMerchantId);
                if (dt.Rows.Count > 0)
                {
                    merchantNameTextBox.Text            = Convert.ToString(dt.Rows[0]["MerchantName"]);
                    loginIdTextBox.Text                 = Convert.ToString(dt.Rows[0]["LogInId"]);
                    paswordTextBox.Text                 = Convert.ToString(dt.Rows[0]["Password"]);
                    confirmPasswordTextBox.Text         = Convert.ToString(dt.Rows[0]["Password"]);
                    isAcctiveDropDownList.SelectedValue = Convert.ToString(dt.Rows[0]["IsActive"]);
                }
            }
        }
        catch (Exception ex)
        {
        }
    }
Пример #8
0
    public string LoadAllPendingSmvRequestOfCurrentDate(string FromDate, string Todate)
    {
        StringBuilder   table           = new StringBuilder();
        DataTable       dt              = new DataTable();
        MerchantGateway merchantGateway = new MerchantGateway();

        try
        {
            dt = merchantGateway.LoadAllPendingSmvRequestOfCurrentDate(FromDate, Todate);

            int count = 0;

            if (dt.Rows.Count > 0)
            {
                table.Append("<table class='table table-bordered' id='example'><thead><tr class='success'>" +
                             "<th>Serial No</th>" +
                             "<th>Request To</th>" +
                             "<th>Merchant Name</th>" +
                             "<th>Buyer Name</th>" +
                             "<th>Style Number</th>" +
                             "<th>Design Number</th>" +
                             "<th>Requested Sampel Stage</th>" +
                             "<th>Previous Sampel Stage</th>" +
                             "<th>Proguct Category</th>" +
                             "<th>Fabric</th>" +
                             "<th>Approx Order Qtn</th>" +
                             "<th>Costing Dead Line</th>" +
                             "<th>Special Comment</th>" +
                             "<th>Sending Date</th>" +

                             "</tr></thead >");
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    count++;

                    table.Append("<tbody><tr>");
                    table.Append("<td>" + count + "</td>");
                    table.Append("<td>" + dt.Rows[i]["SendToUser"] + "</td>");
                    table.Append("<td>" + dt.Rows[i]["MerchantName"] + "</td>");
                    table.Append("<td>" + dt.Rows[i]["BuyerName"] + "</td>");
                    table.Append("<td>" + dt.Rows[i]["StyleNumber"] + "</td>");
                    table.Append("<td>" + dt.Rows[i]["DesignNumber"] + "</td>");
                    table.Append("<td>" + dt.Rows[i]["SampelStage"] + "</td>");
                    table.Append("<td>" + dt.Rows[i]["PreviousSampleStageName"] + "</td>");
                    table.Append("<td>" + dt.Rows[i]["ProguctCategory"] + "</td>");
                    table.Append("<td>" + dt.Rows[i]["FabricName"] + "</td>");
                    table.Append("<td>" + dt.Rows[i]["ApproxOrderQtn"] + "</td>");
                    table.Append("<td>" + dt.Rows[i]["CostingDeadLine"] + "</td>");
                    table.Append("<td>" + dt.Rows[i]["SpecialComment"] + "</td>");
                    table.Append("<td>" + dt.Rows[i]["PostedOn"] + "</td>");

                    table.Append("</tr></tbody>");
                }
                table.Append("</table>");
            }
            else
            {
                table.Append("No Request Has Been Received ToDay");
            }


            return(table.ToString());
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
Пример #9
0
    public string LoadMerchantRequest(int userId)
    {
        StringBuilder   table           = new StringBuilder();
        DataTable       dt              = new DataTable();
        MerchantGateway merchantGateway = new MerchantGateway();

        try
        {
            dt = merchantGateway.LoadMerchantRequest(userId);

            int count = 0;
            if (dt.Rows.Count > 0)
            {
                table.Append("<table class='table table-bordered' id='example'><thead><tr class='success'>" +
                             "<th>Serial No</th>" +
                             "<th>Merchant Name</th>" +
                             "<th>Buyer Name</th>" +
                             "<th>Style Number</th>" +
                             "<th>Sampel Stage</th>" +
                             "<th>Proguct Category</th>" +
                             "<th>Fabric</th>" +
                             "<th>Approx Order Qtn</th>" +
                             "<th>Costing Dead Line</th>" +
                             "<th>Special Comment</th>" +
                             "<th>Send To User</th>" +
                             "<th>Sender</th>" +
                             "<th>Sending Date</th>" +
                             "<th>File</th>" +
                             "<th>Mail</th>" +
                             "<th>Action</th>" +
                             "<th>Send Mail</th>" +
                             "</tr></thead >");
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    count++;

                    table.Append("<tbody><tr>");
                    table.Append("<td>" + count + "</td>");
                    table.Append("<td>" + dt.Rows[i]["MerchantName"] + "</td>");
                    table.Append("<td>" + dt.Rows[i]["BuyerName"] + "</td>");
                    table.Append("<td>" + dt.Rows[i]["StyleNumber"] + "</td>");
                    table.Append("<td>" + dt.Rows[i]["SampelStage"] + "</td>");
                    table.Append("<td>" + dt.Rows[i]["ProguctCategory"] + "</td>");
                    table.Append("<td>" + dt.Rows[i]["FabricName"] + "</td>");
                    table.Append("<td>" + dt.Rows[i]["ApproxOrderQtn"] + "</td>");
                    table.Append("<td>" + dt.Rows[i]["CostingDeadLine"] + "</td>");
                    table.Append("<td>" + dt.Rows[i]["SpecialComment"] + "</td>");
                    table.Append("<td>" + dt.Rows[i]["SendToUser"] + "</td>");
                    table.Append("<td>" + dt.Rows[i]["PostedByName"] + "</td>");
                    table.Append("<td>" + dt.Rows[i]["PostedOn"] + "</td>");

                    string merchantId        = dt.Rows[i]["MerchantId"].ToString();
                    string buyerId           = dt.Rows[i]["BuyerId"].ToString();
                    string sampleStageId     = dt.Rows[i]["SampleStageId"].ToString();
                    string fabricId          = dt.Rows[i]["FabricId"].ToString();
                    string productCategoryId = dt.Rows[i]["ProductId"].ToString();
                    string styleNumber       = dt.Rows[i]["StyleNumber"].ToString();
                    string sendToUserId      = dt.Rows[i]["SendToUserId"].ToString();
                    string DesignNumber      = dt.Rows[i]["DesignNumber"].ToString();
                    //string currentURL = HttpContext.Current.Request.Url.AbsoluteUri;

                    Uri    uri        = HttpContext.Current.Request.Url;
                    string currentURL = uri.Scheme + Uri.SchemeDelimiter + uri.Host + ":" + uri.Port;
                    //string filePath = System.Web.Hosting.HostingEnvironment.MapPath(@"~/Files/Request/" + merchantId + buyerId + sampleStageId + fabricId + productCategoryId + styleNumber + "_" + DesignNumber + sendToUserId + ".pdf");
                    string filePath = currentURL + "/SMV/Files/Request/" + merchantId + buyerId + sampleStageId + fabricId + productCategoryId + styleNumber + "_" + DesignNumber + sendToUserId + ".pdf";
                    string file     = merchantId + buyerId + sampleStageId + fabricId + productCategoryId + styleNumber + "_" + DesignNumber + sendToUserId + ".pdf";


                    string mailFilePath = currentURL + "/SMV/Files/Request/Mail/" + merchantId + buyerId + sampleStageId + fabricId + productCategoryId + styleNumber + "_" + DesignNumber + sendToUserId + ".msg";
                    //string mailFilePath = System.Web.Hosting.HostingEnvironment.MapPath(@"~/Files/Request/Mail/" + merchantId + buyerId + sampleStageId + fabricId + productCategoryId + styleNumber + "_" + DesignNumber + sendToUserId + ".msg");

                    string mailFile = merchantId + buyerId + sampleStageId + fabricId + productCategoryId + styleNumber + "_" + DesignNumber + sendToUserId + ".msg";


                    if (File.Exists(filePath))
                    {
                        table.Append("<td>" + file + "<a href='" + filePath + "'>(Download)</a></td>");
                    }
                    else
                    {
                        //table.Append("<td>" + "File Not Found" + "</td>");
                        table.Append("<td>" + file + "<a href='" + filePath + "'>(Download)</a></td>");
                    }


                    if (File.Exists(mailFilePath))
                    {
                        table.Append("<td>" + mailFile + "<a href='" + mailFilePath + "'>(Download)</a></td>");
                    }
                    else
                    {
                        // table.Append("<td>" + "File Not Found" + "</td>");
                        table.Append("<td>" + mailFile + "<a href='" + mailFilePath + "'>(Download)</a></td>");
                    }

                    int PreviousSampleStage = Convert.ToInt32(dt.Rows[i]["PreviousSampleStage"]);
                    if (PreviousSampleStage > 0)
                    {
                        table.Append("<td><a href ='../SMV/CostingRevisedPanel.aspx?RequestId=" + dt.Rows[i]["RequestId"] + "'>Load For SMV</a></td>");
                    }
                    else
                    {
                        table.Append("<td><a href ='../SMV/CostingSmvPanel.aspx?RequestId=" + dt.Rows[i]["RequestId"] + "'>Load For SMV</a></td>");
                    }

                    table.Append("<td><a href ='SmvSentToMerchant.aspx?RequestId=" + dt.Rows[i]["RequestId"] + "'>Send</a></td>");

                    table.Append("</tr></tbody>");
                }
                table.Append("</table>");
            }
            else
            {
                table.Append("No Data Found");
            }
        }
        catch (Exception ex)
        {
        }
        return(table.ToString());
    }