public DataTable InsertMerchantSmvRequestToRevise(MerchantSmvRequestModel merchantSmvRequestModel) { DataTable dt = null; try { return(dt = new MerchantSmvRequestGateway().InsertMerchantSmvRequestToRevise(merchantSmvRequestModel)); } catch (Exception ex) { throw ex; } }
public string LoadPendingMerchantRequest(int MerchantId) { StringBuilder table = new StringBuilder(); DataTable dt = new DataTable(); MerchantSmvRequestGateway merchantSmvRequestGateway = new MerchantSmvRequestGateway(); try { dt = merchantSmvRequestGateway.LoadPendingMerchantRequest(MerchantId); 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>Sending Date</th>" + "<th>Pdf File</th>" + "<th>Mail File</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]["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 DesignNumber = dt.Rows[i]["DesignNumber"].ToString(); string sendToUserId = dt.Rows[i]["SendToUserId"].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 = 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 mailfile = merchantId + buyerId + sampleStageId + fabricId + productCategoryId + styleNumber + "_" + DesignNumber + sendToUserId + ".msg"; if (File.Exists(filePath)) { table.Append("<td>" + file + "</td>"); } else { //table.Append("<td>" + "File Not Found" + "</td>"); table.Append("<td>" + file + "</td>"); } if (File.Exists(mailfilePath)) { table.Append("<td>" + mailfile + "</td>"); } else { //table.Append("<td>" + "File Not Found" + "</td>"); table.Append("<td>" + mailfile + "</td>"); } table.Append("</tr></tbody>"); } table.Append("</table>"); } else { table.Append("No Data Found"); } } catch (Exception ex) { } return(table.ToString()); }