protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e) { int rowIndex = e.RowIndex; Supplier supplier = new Supplier(); supplier.Supplier_Id = Convert.ToInt32(this.GridView1.DataKeys[rowIndex].Value); SupplierProvider provider = new SupplierProvider(); if (provider.Delete(supplier)) { this.Alert("删除成功!!!"); if (this.txt_Name.Text == "") { this.ListPager1.RecordCount = this.ListPager1.RecordCount - 1; this.BindSource(null); } else { this.ListPager1.RecordCount = this.ListPager1.RecordCount - 1; this.BindSource("%" + this.txt_Name.Text + "%"); } } }
public ActionResult AddSupplier([ModelBinder(typeof(JsonBinder <SupplierEntity>))] SupplierEntity entity) { SupplierProvider provider = new SupplierProvider(); entity.CreateTime = DateTime.Now; int line = 0; if (entity.SupNum.IsEmpty()) { entity.SupNum = SequenceProvider.GetSequence(typeof(SupplierEntity)); line = provider.AddSupplier(entity); } else { line = provider.Update(entity); } if (line > 0) { this.ReturnJson.AddProperty("d", "success"); } else { this.ReturnJson.AddProperty("d", ""); } return(Content(this.ReturnJson.ToString())); }
private SqlCommand ProcedureFunction(SupplierProvider provider) { SqlCommand command = new SqlCommand(); this.ConnectionOpen(); command.Connection = Connection; this.BeginTransaction(true); command.Transaction = this.Transaction; command.CommandType = CommandType.StoredProcedure; command.CommandText = StoredProcedureNames.SuppliersSet; command.Parameters.Add("@TINNumber", SqlDbType.VarChar).Value = provider.TINNumber; command.Parameters.Add("@Name", SqlDbType.VarChar).Value = provider.Name; command.Parameters.Add("@StatusID", SqlDbType.Int).Value = provider.StatusID; command.Parameters.Add("@ContactName", SqlDbType.VarChar).Value = provider.ContactName; command.Parameters.Add("@TypeID", SqlDbType.Int).Value = provider.TypeID; command.Parameters.Add("@VatRegNo", SqlDbType.VarChar).Value = provider.VatRegNo; command.Parameters.Add("@Address", SqlDbType.VarChar).Value = provider.Address; command.Parameters.Add("@CountryName", SqlDbType.VarChar).Value = provider.CountryName; command.Parameters.Add("@Phone", SqlDbType.VarChar).Value = provider.Phone; command.Parameters.Add("@Mobile", SqlDbType.VarChar).Value = provider.Mobile; command.Parameters.Add("@Email", SqlDbType.VarChar).Value = provider.Email; command.Parameters.Add("@Note", SqlDbType.VarChar).Value = provider.Note; command.Parameters.Add("@TarriffID", SqlDbType.Int).Value = provider.TarriffID; return(command); }
public bool Update(SupplierProvider provider) { bool isUpdate = false; try { SqlCommand command = null; command = ProcedureFunction(provider); command.Parameters.Add("@ID", SqlDbType.Int).Value = provider.ID; command.Parameters.Add("@UpdateUserID", SqlDbType.Int).Value = provider.UpdateUserID; command.Parameters.Add("@Option", SqlDbType.Int).Value = DBConstants.DataModificationOption.Update; command.ExecuteNonQuery(); this.CommitTransaction(); this.ConnectionClosed(); isUpdate = true; } catch (Exception exp) { this.RollbackTransaction(); throw new Exception(exp.Message); } finally { this.ConnectionClosed(); } return(isUpdate); }
public ActionResult doImportFile() { string msg = ""; try { string filename = WebUtil.GetFormValue <string>("Url", string.Empty); var path = Server.MapPath(filename); var dataset = ExcelHelper.LoadDataFromExcel(path, "供应商管理$", "", "2007"); List <SupplierEntity> list = new List <SupplierEntity>(); //获取产品信息, GetProCatInfo(dataset, list); if (list.Count > 0) { SupplierProvider provider = new SupplierProvider(); msg = provider.ImportProCateData(list); this.ReturnJson.AddProperty("d", msg); } } catch (Exception ex) { msg = ex.Message; this.ReturnJson.AddProperty("d", "error"); } return(Content(this.ReturnJson.ToString())); }
public bool Delete(SupplierProvider provider) { bool isDelete = false; try { SqlCommand command = new SqlCommand(); this.ConnectionOpen(); command.Connection = Connection; this.BeginTransaction(true); command.Transaction = this.Transaction; command.CommandType = CommandType.StoredProcedure; command.CommandText = StoredProcedureNames.SuppliersSet; command.Parameters.Add("@ID", SqlDbType.Int).Value = provider.ID; command.Parameters.Add("@Option", SqlDbType.Int).Value = DBConstants.DataModificationOption.Delete; command.ExecuteNonQuery(); this.CommitTransaction(); this.ConnectionClosed(); isDelete = true; } catch (Exception exp) { this.RollbackTransaction(); throw new Exception(exp.Message); } finally { this.ConnectionClosed(); } return(isDelete); }
/// <summary> /// 查询分页 /// </summary> /// <returns></returns> public ActionResult GetPage() { string CompanyID = WebUtil.GetFormValue <string>("CompanyID"); int PageIndex = WebUtil.GetFormValue <int>("PageIndex", 1); int PageSize = WebUtil.GetFormValue <int>("PageSize", 10); string SupName = WebUtil.GetFormValue <string>("SupName", string.Empty); string SupNum = WebUtil.GetFormValue <string>("SupNum", string.Empty); string Phone = WebUtil.GetFormValue <string>("Phone", string.Empty); int SupType = WebUtil.GetFormValue <int>("SupType", -1); SupplierEntity entity = new SupplierEntity(); entity.SupName = SupName; entity.SupNum = SupNum; entity.SupType = SupType; entity.Phone = Phone; PageInfo pageInfo = new PageInfo(); pageInfo.PageIndex = PageIndex; pageInfo.PageSize = PageSize; SupplierProvider provider = new SupplierProvider(CompanyID); List <SupplierEntity> list = provider.GetList(entity, ref pageInfo); DataListResult <SupplierEntity> result = new DataListResult <SupplierEntity>() { Code = (int)EResponseCode.Success, Message = "响应成功", Result = list, PageInfo = pageInfo }; return(Content(JsonHelper.SerializeObject(result))); }
public ActionResult Auto(string supName) { SupplierProvider provider = new SupplierProvider(); List <SupplierEntity> list = provider.GetList(); if (!list.IsNullOrEmpty() && !supName.IsEmpty()) { list = list.Where(a => a.SupNum.Contains(supName) || a.SupName.Contains(supName)).ToList(); } list = list.IsNull() ? new List <SupplierEntity>() : list; StringBuilder sb = new StringBuilder(); JsonObject jsonObject = null; foreach (SupplierEntity t in list) { jsonObject = new JsonObject(); jsonObject.AddProperty("SupNum", t.SupNum); jsonObject.AddProperty("SupName", t.SupName); jsonObject.AddProperty("ContactName", t.ContactName); jsonObject.AddProperty("Phone", t.Phone); sb.Append(jsonObject.ToString() + "\n"); } if (sb.Length == 0) { sb.Append("\n"); } return(Content(sb.ToString())); }
protected void ddlSupplierType_SelectedIndexChanged(object sender, EventArgs e) { ddlSupplier.Items.Clear(); SupplierProvider supplierProvider = new SupplierProvider(); int supplierTypeID = ddlSupplierType.SelectedValue.Toint(); DataTable dt = supplierProvider.GetSupplierByTypeID(supplierTypeID); ddlSupplier.DataSource = dt; ddlSupplier.DataBind(); }
protected void btn_Result_Click(object sender, EventArgs e) { Supplier supplier = new Supplier(); supplier.Supplier_Name = "%" + this.txt_Name.Text + "%"; SupplierProvider provider = new SupplierProvider(); this.ListPager1.RecordCount = provider.GetSize(supplier); this.BindSource(0, "%" + this.txt_Name.Text + "%"); this.ListPager1.PageChange += new PagerEventHandler(ListPager1_PageChange); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { SupplierProvider provider = new SupplierProvider(); this.ListPager1.RecordCount = provider.GetSize(); this.BindSource(0, null); } this.account.Text = Session["LOGINED"].ToString(); this.datetime.Text = this.BindDayWeek(); this.ListPager1.PageChange += new PagerEventHandler(ListPager1_PageChange); }
/// <summary> /// 查询供应商列表 /// </summary> /// <returns></returns> public ActionResult GetList() { string CompanyID = WebUtil.GetFormValue <string>("CompanyID"); SupplierProvider provider = new SupplierProvider(CompanyID); List <SupplierEntity> list = provider.GetList(); DataListResult <SupplierEntity> result = new DataListResult <SupplierEntity>() { Code = (int)EResponseCode.Success, Message = "响应成功", Result = list }; return(Content(JsonHelper.SerializeObject(result))); }
/// <summary> /// 查询供应商信息 /// </summary> /// <returns></returns> public ActionResult Single() { string CompanyID = WebUtil.GetFormValue <string>("CompanyID"); string SnNum = WebUtil.GetFormValue <string>("SnNum"); SupplierProvider provider = new SupplierProvider(CompanyID); SupplierEntity entity = provider.GetSupplier(SnNum); DataResult <SupplierEntity> result = new DataResult <SupplierEntity>() { Code = (int)EResponseCode.Success, Message = "响应成功", Result = entity }; return(Content(JsonHelper.SerializeObject(result))); }
public ActionResult Delete(string supNum) { SupplierProvider provider = new SupplierProvider(); int line = provider.Delete(supNum); if (line > 0) { this.ReturnJson.AddProperty("d", "success"); } else { this.ReturnJson.AddProperty("d", ""); } return(Content(this.ReturnJson.ToString())); }
/// <summary> /// 供应商下拉列表 /// </summary> /// <param name="roleNum"></param> /// <returns></returns> public static string GetSupNameList(string SupNum) { SupplierProvider provider = new SupplierProvider(); List <SupplierEntity> list = provider.GetList(); StringBuilder sb = new StringBuilder(); string storeTemplate = "<option value='{0}' {1}>{2}</option>"; if (!list.IsNullOrEmpty()) { foreach (SupplierEntity store in list) { sb.AppendFormat(storeTemplate, store.SupNum, store.SupNum == SupNum ? "selected='selected'" : string.Empty, store.SupName); } } return(sb.ToString()); }
private void BindText() { Supplier supplier = new Supplier(); supplier.Supplier_Id = Convert.ToInt32(id); SupplierProvider provider = new SupplierProvider(); DataTable table = new DataTable(); table = provider.Select(supplier); this.txt_name.Text = table.Rows[0]["supplier_name"].ToString(); this.txt_address.Text = table.Rows[0]["Supplier_address"].ToString(); this.txt_postcode.Text = table.Rows[0]["Supplier_postcode"].ToString(); this.txt_cell.Text = table.Rows[0]["Supplier_cell"].ToString(); this.txt_phone.Text = table.Rows[0]["Supplier_phone"].ToString(); this.txt_fax.Text = table.Rows[0]["Supplier_fax"].ToString(); this.txt_email.Text = table.Rows[0]["Supplier_email"].ToString(); this.txt_liaison.Text = table.Rows[0]["Supplier_liaison"].ToString(); }
public ActionResult GetSupplierList() { int pageIndex = WebUtil.GetFormValue <int>("pageIndex", 1); int pageSize = WebUtil.GetFormValue <int>("pageSize", 15); string SupNum = WebUtil.GetFormValue <string>("SupNum", string.Empty); SupplierProvider provider = new SupplierProvider(); SupplierEntity entity = new SupplierEntity(); List <SupplierEntity> list = provider.GetList(); if (!list.IsNullOrEmpty()) { List <SupplierEntity> listResult = list.Where(a => a.SupNum.Contains(SupNum) || a.SupName.Contains(SupNum)).ToList(); List <SupplierEntity> returnList = listResult.Skip((pageIndex - 1) * pageSize).Take(pageSize).OrderByDescending(a => a.ID).ToList(); string json = ConvertJson.ListToJson <SupplierEntity>(returnList, "List"); this.ReturnJson.AddProperty("Data", new JsonObject(json)); this.ReturnJson.AddProperty("RowCount", listResult.Count); } return(Content(this.ReturnJson.ToString())); }
public ActionResult AddSupplier() { string SupNum = WebUtil.GetQueryStringValue <string>("SupNum"); if (SupNum.IsEmpty()) { ViewBag.Supplier = new SupplierEntity(); ViewBag.SupType = EnumHelper.GetOptions <ESupType>((int)ESupType.Invented, "请选择供应商类型"); return(View()); } else { SupplierProvider provider = new SupplierProvider(); SupplierEntity entity = provider.GetSupplier(SupNum); entity = entity == null ? new SupplierEntity() : entity; ViewBag.SupType = EnumHelper.GetOptions <ESupType>(entity.SupType, "请选择供应商类型"); ViewBag.Supplier = entity; return(View()); } }
/// <summary> /// 绑定Users信息的数据源 /// </summary> private void BindSource(int start, string name) { if (name != null) { Supplier supplier = new Supplier(); supplier.Supplier_Name = name; SupplierProvider provider = new SupplierProvider(); DataTable table = provider.Select(supplier, start, this.ListPager1.PageSize); this.GridView1.DataSource = table.DefaultView; this.GridView1.DataBind(); } else { SupplierProvider provider = new SupplierProvider(); DataTable table = provider.GetAll(start, this.ListPager1.PageSize); this.GridView1.DataSource = table.DefaultView; this.GridView1.DataBind(); } }
/// <summary> /// 删除供应商 /// </summary> /// <returns></returns> public ActionResult Delete() { List <string> list = WebUtil.GetFormObject <List <string> >("List"); string CompanyID = WebUtil.GetFormValue <string>("CompanyID"); SupplierProvider provider = new SupplierProvider(CompanyID); int line = provider.Delete(list); DataResult result = new DataResult(); if (line > 0) { result.Code = (int)EResponseCode.Success; result.Message = string.Format("供应商删除成功,受影响行数{0}行", line); } else { result.Code = (int)EResponseCode.Exception; result.Message = "供应商删除失败"; } return(Content(JsonHelper.SerializeObject(result))); }
public ActionResult BatchDel(string SupNum) { SupplierProvider provider = new SupplierProvider(); var list = SupNum.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); List <string> ls = new List <string>(); int line = 0; foreach (string t in list) { line += provider.Delete(t); } if (line > 0) { this.ReturnJson.AddProperty("d", "success"); } else { this.ReturnJson.AddProperty("d", ""); } return(Content(this.ReturnJson.ToString())); }
/// <summary> /// 编辑供应商 /// </summary> /// <returns></returns> public ActionResult Edit() { SupplierEntity entity = WebUtil.GetFormObject <SupplierEntity>("Entity"); string CompanyID = WebUtil.GetFormValue <string>("CompanyID"); SupplierProvider provider = new SupplierProvider(CompanyID); int line = provider.Update(entity); DataResult result = new DataResult(); if (line > 0) { result.Code = (int)EResponseCode.Success; result.Message = "供应商修改成功"; } else { result.Code = (int)EResponseCode.Exception; result.Message = "供应商修改失败"; } return(Content(JsonHelper.SerializeObject(result))); }
protected void btn_sure_Click(object sender, EventArgs e) { Supplier supplier = this.AddSupplier(); SupplierProvider provider = new SupplierProvider(); switch (this.OperationFlag) { case Operation.Add: if (supplier.Supplier_Name == "" || supplier.Supplier_Liaison == "") { this.Alert("供应商名或联系人不能为空,修改失败!!!"); break; } if (this.IsSame() == 1) { break; } if (provider.Insert(supplier)) { this.Alert("添加成功!!!"); this.TextCancel(); } break; case Operation.Update: if (supplier.Supplier_Name == "" || supplier.Supplier_Liaison == "") { this.Alert("供应商名或联系人不能为空,修改失败!!!"); break; } if (provider.Update(supplier)) { this.Alert("修改成功!!!"); this.BindText(); } break; } }
public ActionResult ToExcel() { PageInfo pageInfo = new Git.Framework.DataTypes.PageInfo() { PageIndex = 1, PageSize = Int32.MaxValue }; string SupNum = WebUtil.GetFormValue <string>("SupNum", string.Empty); SupplierProvider provider = new SupplierProvider(); SupplierEntity entity = new SupplierEntity(); List <SupplierEntity> list = provider.GetList(); if (!list.IsNullOrEmpty()) { List <SupplierEntity> listResult = list.Where(a => a.SupNum.Contains(SupNum) || a.SupName.Contains(SupNum)).ToList(); listResult = listResult.IsNull() ? new List <SupplierEntity>() : listResult; if (listResult.IsNotNull()) { DataTable dt = new DataTable(); dt.Columns.Add(new DataColumn("序号 ")); dt.Columns.Add(new DataColumn("供应商编号")); dt.Columns.Add(new DataColumn("供应商名称")); dt.Columns.Add(new DataColumn("电话")); dt.Columns.Add(new DataColumn("传真")); dt.Columns.Add(new DataColumn("Email")); dt.Columns.Add(new DataColumn("联系人")); dt.Columns.Add(new DataColumn("地址")); dt.Columns.Add(new DataColumn("描述")); int count = 1; foreach (SupplierEntity t in listResult) { DataRow row = dt.NewRow(); row[0] = count; row[1] = t.SupNum; row[2] = t.SupName; row[3] = t.Phone; row[4] = t.Fax; row[5] = t.Email; row[6] = t.ContactName; row[7] = t.Address; row[8] = t.Description; dt.Rows.Add(row); count++; } string filePath = Server.MapPath("~/UploadFiles/"); if (!System.IO.Directory.Exists(filePath)) { System.IO.Directory.CreateDirectory(filePath); } string filename = string.Format("供应商管理{0}.xls", DateTime.Now.ToString("yyyyMMddHHmmss")); NPOIExcel excel = new NPOIExcel("供应商管理", "供应商", System.IO.Path.Combine(filePath, filename)); excel.ToExcel(dt); this.ReturnJson.AddProperty("Path", ("/UploadFiles/" + filename).Escape()); } else { this.ReturnJson.AddProperty("d", "无数据导出!") ; } } return(Content(this.ReturnJson.ToString())); }
protected void Page_Load(object sender, EventArgs e) { DataTable dt; var reportPath = new ReportPath(); var reportParameter = new ReportParameter(); var reportDocument = new ReportDocument(); int reportType = Request.QueryString["ReportType"].Toint(); DateTime fromDate = Request.QueryString["fromDate"].ToDate(); DateTime toDate = Request.QueryString["toDate"].ToDate(); DateTime aDate = Request.QueryString["aDate"].ToDate(); int reportOption = Request.QueryString["reportOption"].Toint(); int reportCategory = Request.QueryString["reportCategory"].Toint(); int productID = Request.QueryString["productID"].Toint(); var transactionID = Request.QueryString["transactionNo"]; string printOption = Request.QueryString["printOption"]; //******** Updated Datetime ********// DateTime?fDate; DateTime?tDate; DateTime?Date; switch (reportType) { #region Supplier Report case ReportType.SupplierReport: //////////// For Supplier Info report var supplierProvider = new SupplierProvider(); int supplierTypeID = Request.QueryString["SupplierTypeID"].ToInt(); dt = supplierProvider.GetSupplierByTypeID(supplierTypeID); if (dt != null && dt.Rows.Count > 0) { reportDocument.Load(reportPath.SupplierReportPath); GetValue(dt, reportParameter, reportDocument); } else { GetMsg(reportParameter, reportDocument, reportPath); } break; case ReportType.SupplierProductReport: //////////// For Supplier Product report supplierProvider = new SupplierProvider(); int supplierID = Request.QueryString["SupplierID"].ToInt(); dt = supplierProvider.GetByID(supplierID); if (dt != null && dt.Rows.Count > 0) { reportDocument.Load(reportPath.SupplierProductReportPath); GetValue(dt, reportParameter, reportDocument); } else { GetMsg(reportParameter, reportDocument, reportPath); } break; #endregion #region Requisition Report case ReportType.RequisitionReport: //////////// For Requisition report var requisitionProvider = new RequisitionProvider(); fDate = GetNullfDatetime(); tDate = GetNulltDatetime(); Date = GetNullaDatetime(); if (reportOption == 3) { var requisitionNo = Request.QueryString["transactionNo"].Trim(); dt = requisitionProvider.GetByID(requisitionNo); if (dt != null && dt.Rows.Count > 0) { reportDocument.Load(reportPath.RequisitionReportPath); GetValueWithDate(dt, reportParameter, reportDocument); } else { GetMsg(reportParameter, reportDocument, reportPath); } } else { dt = requisitionProvider.GetAllByDateWise(productID, transactionID, fDate, tDate, Date, reportOption); if (dt != null && dt.Rows.Count > 0) { if (reportOption == 2) { reportDocument.Load(reportPath.RequisitionReportPath); GetValueWithFromToDate(reportParameter, reportDocument, dt, fDate, tDate); } else if (reportOption == 1) { reportDocument.Load(reportPath.RequisitionReportPath); GetValueAGetDate(dt, reportParameter, reportDocument, Date); } } else { GetMsg(reportParameter, reportDocument, reportPath); } } break; #endregion #region Purchase Order Report case ReportType.PurchaseOrderReport: //////////// For Purchase Order report var purchaseOrderProvider = new PurchaseOrderProvider(); fDate = GetNullfDatetime(); tDate = GetNulltDatetime(); if (reportCategory == 1) { var purchaseOrderNo = Request.QueryString["transactionNo"].Trim(); dt = purchaseOrderProvider.GetByID(purchaseOrderNo); if (dt != null && dt.Rows.Count > 0) { decimal value = 0.00M; decimal totalValue = 0.00M; foreach (DataRow dr in dt.Rows) { value = Convert.ToDecimal(dr["Value"]); totalValue = totalValue + value; } string textValue = NumberToText(Convert.ToInt32(totalValue), true); System.Data.DataColumn newColumn = new System.Data.DataColumn("TotalAmountInText", typeof(System.String)); newColumn.DefaultValue = textValue; dt.Columns.Add(newColumn); reportDocument.Load(reportPath.PurchaseOrderReportPath); GetValueWithDate(dt, reportParameter, reportDocument); } else { GetMsg(reportParameter, reportDocument, reportPath); } } else if (reportCategory == 2) //// Purchase Order Detail Report - Single Product///////////////////// { dt = purchaseOrderProvider.GetAllData(productID); if (dt != null && dt.Rows.Count > 0) { reportDocument.Load(reportPath.PurchaseOrderDetailReportPath); GetValueWithFromToDate(reportParameter, reportDocument, dt, fDate, tDate); } else { GetMsg(reportParameter, reportDocument, reportPath); } } break; #endregion #region Delivery Challan Report case ReportType.DeliveryChallanReport: //////////// For Delivery Challan Report var deliveryChallanProvider = new DeliveryChallanProvider(); fDate = GetNullfDatetime(); tDate = GetNulltDatetime(); if (reportOption == 2) { var deliveryChallanNo = Request.QueryString["transactionNo"].Trim(); dt = deliveryChallanProvider.GetByID(deliveryChallanNo); if (dt != null && dt.Rows.Count > 0) { reportDocument.Load(reportPath.DeliveryChallanReportPath); GetValueWithDate(dt, reportParameter, reportDocument); } else { GetMsg(reportParameter, reportDocument, reportPath); } } else { //dt = purchaseOrderProvider.GetAllByDateWise(productID, transactionID, fDate, tDate, adate, reportOption); //if (dt != null && dt.Rows.Count > 0) //{ // if (reportOption == 2) // { // reportDocument.Load(reportPath.RequisitionReportPath); // GetValueWithFromToDate(reportParameter, reportDocument, dt, fDate, tDate); // } // else if (reportOption == 1) // { // reportDocument.Load(reportPath.RequisitionReportPath); // GetValueAGetDate(dt, reportParameter, reportDocument, adate); // } //} //else //{ // GetMsg(reportParameter, reportDocument, reportPath); //} } break; #endregion #region Production Requisition Report case ReportType.ProductionRequisitionReport: var productionRequisitionProvider = new ProductionRequisitionProvider(); fDate = GetNullfDatetime(); tDate = GetNulltDatetime(); if (reportOption == 2) { //var prodReqNo = Request.QueryString["transactionNo"].Trim(); //dt = productionRequisitionProvider.GetByID(prodReqNo); //if (dt != null && dt.Rows.Count > 0) //{ // reportDocument.Load(reportPath.ProductionRequisitionReportPath); // GetValueWithDate(dt, reportParameter, reportDocument); //} //else //{ // GetMsg(reportParameter, reportDocument, reportPath); //} } else { } break; #endregion #region Prodct Stock Report case ReportType.ProductCurrentStockReport: var productCurrentStockProvider = new ProductCurrentStockProvider { ProductID = Request.QueryString["ProductID"].ToInt(), DivisionID = Request.QueryString["DivisionID"].ToInt(), ProductType = Request.QueryString["ProductType"].ToInt(), FromDate = Request.QueryString["fromDate"].ToString(), Todate = Request.QueryString["todate"].ToString() }; if (productCurrentStockProvider.ProductID == 0) { dt = productCurrentStockProvider.GetDivisionAndItemwise(); if (dt != null && dt.Rows.Count > 0) { reportDocument.Load(reportPath.AllProductStockReportPath); GetValueWithDate(dt, reportParameter, reportDocument); } else { GetMsg(reportParameter, reportDocument, reportPath); } } else { var mushak16ProviderList = productCurrentStockProvider.GetAll(); if (mushak16ProviderList != null) { reportDocument.Load(reportPath.ProductIndividualStockReportPath); reportDocument.SetDataSource(mushak16ProviderList); GetAddressValue(reportParameter, reportDocument); technoCrystalReport.ReportSource = reportDocument; technoCrystalReport.DataBind(); } else { GetMsg(reportParameter, reportDocument, reportPath); } } break; #endregion #region LC Report case ReportType.LCReport: //////////// For LC report var lCProvider = new LCProvider(); fDate = GetNullfDatetime(); tDate = GetNulltDatetime(); if (reportCategory == 2) /////////////// LC Detail Report /////////////// { dt = lCProvider.GetByDateRangeWise(fromDate, toDate, reportCategory); if (dt != null && dt.Rows.Count > 0) { reportDocument.Load(reportPath.LCDetailReportPath); GetValueWithDate(dt, reportParameter, reportDocument); } else { GetMsg(reportParameter, reportDocument, reportPath); } } else if (reportCategory == 1) //// LC Summary Report ///////////////////// { dt = lCProvider.GetByDateRangeWise(fromDate, toDate, reportCategory); if (dt != null && dt.Rows.Count > 0) { reportDocument.Load(reportPath.LCSummaryReportPath); GetValueWithFromToDate(reportParameter, reportDocument, dt, fDate, tDate); } else { GetMsg(reportParameter, reportDocument, reportPath); } } break; #endregion #region BOE Report case ReportType.BOEReport: //////////// For BOE report var bOEProvider = new BOEProvider(); fDate = GetNullfDatetime(); tDate = GetNulltDatetime(); if (reportCategory == 2) { dt = bOEProvider.GetByDateRangeWise(fromDate, toDate, reportCategory); if (dt != null && dt.Rows.Count > 0) { reportDocument.Load(reportPath.BOEDetailReportPath); GetValueWithDate(dt, reportParameter, reportDocument); } else { GetMsg(reportParameter, reportDocument, reportPath); } } else if (reportCategory == 1) //// BOE Summary Report ///////////////////// { dt = bOEProvider.GetByDateRangeWise(fromDate, toDate, reportCategory); if (dt != null && dt.Rows.Count > 0) { reportDocument.Load(reportPath.BOESummaryReportPath); GetValueWithFromToDate(reportParameter, reportDocument, dt, fDate, tDate); } else { GetMsg(reportParameter, reportDocument, reportPath); } } break; #endregion #region QA Report case ReportType.QAReport: //////////// For QA report var qAQCRequisitionProvider = new QAQCRequisitionProvider(); fDate = GetNullfDatetime(); tDate = GetNulltDatetime(); Date = GetNullaDatetime(); dt = qAQCRequisitionProvider.GetDateWiseProductInfo(fDate, tDate, Date, productID); if (dt != null && dt.Rows.Count > 0) { { //if (reportOption == 1 && adate == null) //All product summary report //{ // reportDocument.Load(reportPath.QAReportPath); // GetValueWithDate(dt, reportParameter, reportDocument); //} //if (reportOption == 1 && adate == null) //All product summary report //{ // reportDocument.Load(reportPath.QAReportPath); // GetValueWithDate(dt, reportParameter, reportDocument); //} if (reportOption == 1) { reportDocument.Load(reportPath.QAReportPath); GetValueAGetDate(dt, reportParameter, reportDocument, Date); } else if (reportOption == 2) { reportDocument.Load(reportPath.QAReportPath); GetValueWithFromToDate(reportParameter, reportDocument, dt, fDate, tDate); } //else if (reportOption == 3) // Purchase ID wise report (showing product details). //{ // reportDocument.Load(reportPath.QAReportPath); // GetValueWithDate(dt, reportParameter, reportDocument, printOption); //} } } else { GetMsg(reportParameter, reportDocument, reportPath); } break; #endregion #region Eng. Internal Requisition Report case ReportType.EngineeringInternalRequiReport: //////////// For Eng Requi report var engRequisitionProvider = new EngineeringRequisitionProvider(); var engRequisitionNo = Request.QueryString["transactionNo"].Trim(); dt = engRequisitionProvider.GetByID(engRequisitionNo); if (dt != null && dt.Rows.Count > 0) { { reportDocument.Load(reportPath.EngInternalRequiReportPath); GetValueWithDate(dt, reportParameter, reportDocument); } } else { GetMsg(reportParameter, reportDocument, reportPath); } break; #endregion } }