예제 #1
0
        public string GetExcelDataV2(int labelingPackagingID, string listLPDetails, string listLPSparepartDetails, out Library.DTO.Notification notification)
        {
            notification = new Library.DTO.Notification()
            {
                Type = Library.DTO.NotificationType.Success
            };
            ReportDataObject2 ds = new ReportDataObject2();

            try
            {
                SqlDataAdapter adap = new SqlDataAdapter();
                adap.SelectCommand             = new SqlCommand("LabelingPackagingMng_function_GetExcelDataProduct", new SqlConnection(Library.Helper.GetSQLConnectionString()));
                adap.SelectCommand.CommandType = System.Data.CommandType.StoredProcedure;
                adap.SelectCommand.Parameters.AddWithValue("@LabelingPackagingID", labelingPackagingID);
                adap.SelectCommand.Parameters.AddWithValue("@ListLPDetails", listLPDetails);
                adap.SelectCommand.Parameters.AddWithValue("@ListLPSparepartDetails", listLPSparepartDetails);

                adap.TableMappings.Add("Table", "LabelingPackaging");
                adap.TableMappings.Add("Table1", "LabelingPackagingDetail");
                adap.TableMappings.Add("Table2", "LabelingPackagingOtherFile");
                adap.Fill(ds);

                return(Library.Helper.CreateReportFileWithEPPlus2(ds, "LabelingPackagingOverviewV2"));
            }
            catch (Exception ex)
            {
                notification.Type    = Library.DTO.NotificationType.Error;
                notification.Message = ex.Message;
                if (ex.InnerException != null && !string.IsNullOrEmpty(ex.InnerException.Message))
                {
                    notification.DetailMessage.Add(ex.InnerException.Message);
                }
                return(string.Empty);
            }
        }
예제 #2
0
        public string GetReportClientOfferOverview(string validFrom, string validTo, out Library.DTO.Notification notification)
        {
            notification = new Library.DTO.Notification()
            {
                Type = Library.DTO.NotificationType.Success
            };
            ReportDataObject2 ds = new ReportDataObject2();

            try
            {
                SqlDataAdapter adap = new SqlDataAdapter();
                adap.SelectCommand             = new SqlCommand("ClientOfferMng_function_GetReportClientOffer", new SqlConnection(Library.Helper.GetSQLConnectionString()));
                adap.SelectCommand.CommandType = System.Data.CommandType.StoredProcedure;
                adap.SelectCommand.Parameters.AddWithValue("@ValidFrom", validFrom);
                adap.SelectCommand.Parameters.AddWithValue("@ValidTo", validTo);

                adap.TableMappings.Add("Table", "ClientOffer");
                adap.TableMappings.Add("Table1", "ClientOfferCostDetail");
                adap.TableMappings.Add("Table2", "LeftItem");
                adap.TableMappings.Add("Table3", "ClientCostTypeGroup");
                adap.TableMappings.Add("Table4", "ClientOfferAdditionalDetail");
                adap.TableMappings.Add("Table5", "LeftItem_Additional");
                adap.TableMappings.Add("Table6", "ClientOfferConditionDetail");
                adap.TableMappings.Add("Table7", "LeftItem_Condition");
                adap.Fill(ds);

                return(Library.Helper.CreateReportFileWithEPPlus2(ds, "ClientTransportOfferOverview"));
            }
            catch (Exception ex)
            {
                notification.Type    = Library.DTO.NotificationType.Error;
                notification.Message = ex.Message;
                if (ex.InnerException != null && !string.IsNullOrEmpty(ex.InnerException.Message))
                {
                    notification.DetailMessage.Add(ex.InnerException.Message);
                }
                return(string.Empty);
            }
        }
예제 #3
0
        public string GetExportBarcode(System.Collections.Hashtable filters, out Library.DTO.Notification notification)
        {
            notification      = new Library.DTO.Notification();
            notification.Type = Library.DTO.NotificationType.Success;

            string fileName = string.Empty;

            try
            {
                ReportDataObject2 ds2  = new ReportDataObject2();
                SqlDataAdapter    adap = new SqlDataAdapter();

                adap.SelectCommand             = new SqlCommand("ReportMng_SampleOrder_function_PrintHangTag", new SqlConnection(Library.Helper.GetSQLConnectionString()));
                adap.SelectCommand.CommandType = System.Data.CommandType.StoredProcedure;
                adap.SelectCommand.Parameters.AddWithValue("@sampleProductIDs", filters["keyIDs"].ToString().Trim());
                adap.SelectCommand.Parameters.AddWithValue("@qntBarcodes", filters["qntBarcode"].ToString().Trim());

                adap.TableMappings.Add("Table", "ReportMng_SampleOrder_HangTag_View");
                adap.Fill(ds2);

                ds2.AcceptChanges();

                foreach (var item in ds2.ReportMng_SampleOrder_HangTag_View.Where(o => !o.IsSampleProductUDNull()))
                {
                    item.BarCode = Library.Helper.QRCodeImageFile(item.SampleProductUD);
                }

                fileName = Library.Helper.CreateReportFileWithEPPlus(ds2, "SampleOrder_HangTag");
            }
            catch (Exception ex)
            {
                notification.Type    = Library.DTO.NotificationType.Error;
                notification.Message = ex.Message;
            }

            return(fileName);
        }