public DataTable InsertMerchantSmvRequestToRevise(MerchantSmvRequestModel merchantSmvRequestModel)
    {
        DataTable dt = null;

        try
        {
            return(dt = new MerchantSmvRequestGateway().InsertMerchantSmvRequestToRevise(merchantSmvRequestModel));
        }
        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)
        {
        }
    }
Beispiel #3
0
    public DataTable InsertMerchantSmvRequestToRevise(MerchantSmvRequestModel merchantSmvRequestModel)
    {
        DataTable dt = null;

        try
        {
            OpenConnection();
            ArrayList arlSqlParameter = new ArrayList();
            arlSqlParameter.Add(new SqlParameter("@BuyerId", merchantSmvRequestModel.BuyerId));
            arlSqlParameter.Add(new SqlParameter("@MerchantId", merchantSmvRequestModel.MerchantId));
            arlSqlParameter.Add(new SqlParameter("@SampleStageId", merchantSmvRequestModel.SampleStageId));
            arlSqlParameter.Add(new SqlParameter("@PreviousSampleStage", merchantSmvRequestModel.PreviousSampleStage));
            arlSqlParameter.Add(new SqlParameter("@IsActive", merchantSmvRequestModel.IsActive));
            arlSqlParameter.Add(new SqlParameter("@StyleNumber", merchantSmvRequestModel.StyleNumber));
            arlSqlParameter.Add(new SqlParameter("@DesignNumber", merchantSmvRequestModel.DesignNumber));
            arlSqlParameter.Add(new SqlParameter("@FabricId", merchantSmvRequestModel.FabricId));
            arlSqlParameter.Add(new SqlParameter("@ProductCategoryId", merchantSmvRequestModel.ProductCategoryId));
            arlSqlParameter.Add(new SqlParameter("@ReasonToRevised", merchantSmvRequestModel.ReasonToRevised));
            arlSqlParameter.Add(new SqlParameter("@ApproxOrderQtn", merchantSmvRequestModel.ApproxOrderQtn));
            arlSqlParameter.Add(new SqlParameter("@CostingDeadLine", merchantSmvRequestModel.CostingDeadLine));
            arlSqlParameter.Add(new SqlParameter("@Comments", merchantSmvRequestModel.Comments));
            arlSqlParameter.Add(new SqlParameter("@SendToUserId", merchantSmvRequestModel.SendToUserId));
            arlSqlParameter.Add(new SqlParameter("@PostedBy", merchantSmvRequestModel.PostedBy));
            arlSqlParameter.Add(new SqlParameter("@UpdatedBy", merchantSmvRequestModel.UpdatedBy));
            arlSqlParameter.Add(new SqlParameter("@IsOption", merchantSmvRequestModel.IsOption));

            dt = this.ExecuteQuery("[KP].[USP_InsertMerchantSmvRequestToRevise]", arlSqlParameter);
            return(dt);
        }
        catch (Exception ex)
        {
            throw ex;
        }
        finally
        {
            CloseConnection();
        }
    }
Beispiel #4
0
    protected void sendButton_Click(object sender, EventArgs e)
    {
        MerchantSmvRequestModel merchantSmvRequestModel = new MerchantSmvRequestModel();
        MerchantSmvRequestBLL   merchantSmvRequestBLL   = new MerchantSmvRequestBLL();
        DataTable dt = new DataTable();

        try
        {
            int value = 0;
            merchantSmvRequestModel.BuyerId = Convert.ToInt32(buyerDropDownList.SelectedValue);
            value = Convert.ToInt32(sampleStageHiddenField.Value);
            merchantSmvRequestModel.SampleStageId       = value;
            merchantSmvRequestModel.StyleNumber         = styleNumberTextBox.Text;
            merchantSmvRequestModel.FabricId            = Convert.ToInt32(fabricDropDownList.SelectedValue);
            merchantSmvRequestModel.ProductCategoryId   = Convert.ToInt32(productDropDownList.SelectedValue);
            merchantSmvRequestModel.ApproxOrderQtn      = Convert.ToInt32(quantityTextBox.Text);
            merchantSmvRequestModel.CostingDeadLine     = costingDeadLineTextBox.Text;
            merchantSmvRequestModel.Comments            = commentsTextBox.Text;
            merchantSmvRequestModel.SendToUserId        = Convert.ToInt32(sendToDropDownList.SelectedValue);
            merchantSmvRequestModel.MerchantId          = Convert.ToInt32(merchantId);
            merchantSmvRequestModel.IsActive            = 1;
            merchantSmvRequestModel.PreviousSampleStage = 0;
            merchantSmvRequestModel.DesignNumber        = DesignNumberTextBox.Text;
            merchantSmvRequestModel.IsOption            = Convert.ToInt32(optionDropDownList.SelectedValue);

            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();


            if (requestId == 0)
            {
                merchantSmvRequestModel.PostedBy  = Convert.ToInt32(merchantId);
                merchantSmvRequestModel.UpdatedBy = 0;
                dt = merchantSmvRequestBLL.InsertMerchantSmvRequest(merchantSmvRequestModel);

                if (dt.Rows.Count > 0)
                {
                    bool success = Convert.ToBoolean(dt.Rows[0]["Success"]);
                    if (success)
                    {
                        messageLabel.Text = "<p Style ='font-size:20px;color:Red; margin-top:20px;'>Already Exists</p>";
                    }
                    else
                    {
                        messageLabel.Text = "<p Style ='font-size:20px;color:Red; margin-top:20px;'>SMV Information Successfully Sended</p>";
                        PdfFileUpload(pdfFileName);
                        ClearData();
                        table = LoadPendingMerchantRequest(Convert.ToInt32(merchantId));
                    }
                }
            }
        }
        catch (Exception ex)
        {
        }
    }