예제 #1
0
        /// <summary>
        /// Add Commodity wise abstract details
        /// </summary>
        /// <param name="sw">Streamwriter</param>
        /// <param name="stockIssues">Stock issues entity</param>
        /// <param name="entity">Common entity</param>
        public void StockIssuesCommoditywiseAbstract(StreamWriter sw, List <SchemeIssueList> stockReceipt, CommonEntity entity)
        {
            int    count         = 11;
            string weighmentType = string.Empty;
            var    resultSet     = from d in stockReceipt
                                   group d by new { d.Commodity } into groupedData
                   select new
            {
                NetWt        = groupedData.Sum(s => s.Quantity),
                GroupByNames = groupedData.Key
            };

            AddAbstractHeader(sw, entity);
            foreach (var item in resultSet)
            {
                if (count >= 50)
                {
                    count = 11;
                    sw.WriteLine("--------------------------------------------------------");
                    sw.WriteLine((char)12);
                    AddAbstractHeader(sw, entity);
                }
                sw.Write(" ");
                sw.Write(report.StringFormatWithoutPipe(item.GroupByNames.Commodity, 31, 2));
                sw.Write(report.StringFormatWithoutPipe(report.DecimalformatForWeight(item.NetWt.ToString()), 18, 2));
                sw.WriteLine(" ");
                count = count + 2;
            }
            sw.WriteLine("--------------------------------------------------------");
            sw.WriteLine((char)12);
        }
예제 #2
0
        /// <summary>
        /// Write the Transaction Abstract data
        /// </summary>
        /// <param name="sw"></param>
        /// <param name="entity"></param>
        public void WriteTransactionForAbstract(StreamWriter sw, CommonEntity entity)
        {
            int iCount            = 10;
            var distinctCommodity = entity.dataSet.Tables[0].DefaultView.ToTable(true, "Commodity");
            //Date wise DO report
            string  sDoNo      = string.Empty;
            string  sCommodity = string.Empty;
            decimal dTotal     = 0;

            AddHeaderForTransactionReceipt(sw, entity);
            foreach (DataRow dateValue in distinctCommodity.Rows)
            {
                iCount = 11;
                bool CheckRepeatValue = false;
                sCommodity = string.Empty;
                sDoNo      = string.Empty;
                DataRow[] datas = entity.dataSet.Tables[0].Select("Commodity='" + dateValue["Commodity"] + "'");

                foreach (var item in datas)
                {
                    if (iCount >= 50)
                    {
                        //Add header again
                        iCount = 11;
                        sw.WriteLine("------------------------------------------------------------------------------------");
                        sw.WriteLine((char)12);
                        AddHeaderForTransactionReceipt(sw, entity);
                    }
                    sCommodity = Convert.ToString(item["Commodity"]);
                    if (sDoNo == sCommodity)
                    {
                        CheckRepeatValue = true;
                    }
                    else
                    {
                        CheckRepeatValue = false;
                        sDoNo            = sCommodity;
                    }
                    sw.Write(" ");
                    sw.Write(report.StringFormatWithoutPipe(CheckRepeatValue == false ? sCommodity : " ", 34, 2));
                    sw.Write(report.StringFormatWithoutPipe(item["Date"].ToString(), 10, 2));
                    sw.Write(report.StringFormatWithoutPipe(item["Trans_action"].ToString(), 21, 2));
                    sw.Write(report.StringFormatWithoutPipe(report.DecimalformatForWeight(item["Quantity"].ToString()), 15, 1));
                    sw.WriteLine("");
                    iCount  = iCount + 1;
                    dTotal += Convert.ToDecimal(item["Quantity"].ToString());
                }
                sw.WriteLine("------------------------------------------------------------------------------------");
                sw.Write(" ");
                sw.Write(report.StringFormatWithoutPipe(" ", 34, 2));
                sw.Write(report.StringFormatWithoutPipe("", 10, 2));
                sw.Write(report.StringFormatWithoutPipe("", 21, 2));
                sw.Write(report.StringFormatWithoutPipe(report.DecimalformatForWeight(dTotal.ToString()), 15, 1));
                sw.WriteLine("");
                sw.WriteLine("------------------------------------------------------------------------------------");
            }
            sw.WriteLine("------------------------------------------------------------------------------------");
            sw.WriteLine((char)12);
        }
예제 #3
0
 /// <summary>
 /// Add header for document receipt
 /// </summary>
 /// <param name="streamWriter">Stream writer to write the text file.</param>
 /// <param name="stockReceipt"></param>
 /// <param name="isDuplicate"></param>
 public void AddDocHeaderForReceipt(StreamWriter streamWriter, CommonEntity commonEntity, string reportName)
 {
     streamWriter.WriteLine(" ");
     streamWriter.WriteLine("                          TAMILNADU CIVIL SUPPLIES CORPORATION ");
     streamWriter.Write("       ");
     streamWriter.Write(report.StringFormatWithoutPipe(commonEntity.RName, 30, 1));
     streamWriter.Write(report.StringFormatWithoutPipe(reportName, 22, 2));
     streamWriter.Write(report.StringFormatWithoutPipe(commonEntity.GName, 30, 2));
     streamWriter.WriteLine("");
     streamWriter.Write(" Date From.: "); //"R00002                             DATE: 03/Jan/2011");
     streamWriter.Write(report.StringFormatWithoutPipe(report.FormatDate(commonEntity.FromDate), 13, 2));
     streamWriter.Write(" To : ");
     streamWriter.Write(report.StringFormatWithoutPipe(report.FormatDate(commonEntity.Todate), 13, 2));
     streamWriter.WriteLine(" ");
 }
예제 #4
0
 /// <summary>
 /// Add header for document receipt
 /// </summary>
 /// <param name="streamWriter">Stream writer to write the text file.</param>
 /// <param name="stockReceipt"></param>
 /// <param name="isDuplicate"></param>
 public void AddDocHeaderForReceipt(StreamWriter streamWriter, QuantityAccountEntity quantityAccount)
 {
     streamWriter.WriteLine(" ");
     streamWriter.WriteLine("                          TAMILNADU CIVIL SUPPLIES CORPORATION ");
     streamWriter.Write("       ");
     streamWriter.Write(report.StringFormatWithoutPipe(quantityAccount.RName, 30, 1));
     streamWriter.Write(report.StringFormatWithoutPipe("- Issues Abstract -", 22, 2));
     streamWriter.Write(report.StringFormatWithoutPipe(quantityAccount.GName, 30, 2));
     streamWriter.WriteLine("");
     streamWriter.Write(" Date From.: "); //"R00002                             DATE: 03/Jan/2011");
     streamWriter.Write(report.StringFormatWithoutPipe(report.FormatDate(quantityAccount.FromDate), 13, 2));
     streamWriter.Write(" To : ");
     streamWriter.Write(report.StringFormatWithoutPipe(report.FormatDate(quantityAccount.ToDate), 13, 2));
     streamWriter.WriteLine(" ");
 }
예제 #5
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="sw"></param>
 /// <param name="entity"></param>
 public void DateWiseCommodityIssueMemoReport(StreamWriter sw, CommonEntity entity)
 {
     try
     {
         int count = 10;
         int i     = 1;
         AddHeader(sw, entity);
         decimal TotalAmount = 0;
         foreach (DataRow row in entity.dataSet.Tables[0].Rows)
         {
             if (count >= 50)
             {
                 //Add header again
                 count = 11;
                 sw.WriteLine("-----------------------------------------------------------------------------------------------------------------------------------------------------");
                 sw.WriteLine((char)12);
                 AddHeader(sw, entity);
             }
             sw.Write(" ");
             sw.Write(report.StringFormatWithoutPipe(i.ToString(), 4, 2));
             sw.Write(report.StringFormatWithoutPipe(row["ReceivedFrom"].ToString(), 40, 2));
             sw.Write(report.StringFormatWithoutPipe(row["ReceiptNo"].ToString(), 11, 2));
             sw.Write(report.StringFormatWithoutPipe(report.FormatDirectDate(row["Date"].ToString()), 10, 2));
             sw.Write(report.StringFormatWithoutPipe(row["PaymentType"].ToString(), 3, 2));
             sw.Write(report.StringFormatWithoutPipe(row["DDNo"].ToString(), 15, 2));
             sw.Write(report.StringFormatWithoutPipe(row["DDDate"].ToString(), 10, 1));
             sw.Write(report.StringFormatWithoutPipe(report.Decimalformat(row["Amount"].ToString()), 15, 1));
             sw.Write(report.StringFormatWithoutPipe(row["Bank"].ToString(), 32, 2));
             sw.WriteLine("");
             TotalAmount += Convert.ToDecimal(report.Decimalformat(row["Amount"].ToString()));
             i            = i + 1;
             count        = count + 1;
         }
         sw.WriteLine("-----------------------------------------------------------------------------------------------------------------------------------------------------");
         sw.Write("                                                                TOTAL AMOUNT                       ");
         sw.Write(report.StringFormatWithoutPipe(report.Decimalformat(TotalAmount.ToString()), 15, 1));
         sw.WriteLine("");
         sw.WriteLine("-----------------------------------------------------------------------------------------------------------------------------------------------------");
         sw.WriteLine((char)12);
     }
     catch (Exception ex)
     {
         AuditLog.WriteError(ex.Message);
     }
 }
예제 #6
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sw"></param>
        /// <param name="entity"></param>
        public void DateWiseSchemeReceiptReport(StreamWriter sw, CommonEntity entity)
        {
            int count = 11;
            //  var dateList = entity.dataSet.Tables[0].DefaultView.ToTable(true, "Date");
            int    i               = 1;
            string SINO            = string.Empty;
            bool   isDataAvailable = false;

            //foreach (DataRow date in dateList.Rows)
            //{
            isDataAvailable = true;
            AddHeader(sw, entity);
            // DataRow[] data = entity.dataSet.Tables[0].Select("Date='" + date["Date"] + "'");
            foreach (DataRow row in entity.dataSet.Tables[0].Rows)
            {
                if (count >= 50)
                {
                    //Add header again
                    count = 11;
                    sw.WriteLine("---------------------------------------------------------------------------------------------------");
                    sw.WriteLine((char)12);
                    AddHeader(sw, entity);
                }
                sw.Write(report.StringFormatWithoutPipe(i.ToString(), 4, 2));
                sw.Write(report.StringFormatWithoutPipe(row["Ackno"].ToString(), 14, 2));
                sw.Write(report.StringFormatWithoutPipe(row["Date"].ToString(), 10, 2));
                sw.Write(report.StringFormatWithoutPipe(row["Commodity"].ToString(), 16, 2));
                sw.Write(report.StringFormatWithoutPipe(report.DecimalformatForWeight(row["Quantity"].ToString()), 20, 1));
                sw.Write(report.StringFormatWithoutPipe(Convert.ToString(row["RecdFrom"]).Trim(), 23, 2));
                sw.Write(report.StringFormatWithoutPipe(row["TruckMemoNo"].ToString(), 11, 2));
                sw.Write(report.StringFormatWithoutPipe(row["Lorryno"].ToString(), 10, 2));
                sw.WriteLine("");
                sw.WriteLine(" ");
                i = i + 1;
                count++;
            }
            sw.WriteLine("---------------------------------------------------------------------------------------------------");
            sw.WriteLine((char)12);
            //}
            if (!isDataAvailable)
            {
                sw.WriteLine("---------------------------------------------------------------------------------------------------");
                sw.WriteLine((char)12);
            }
        }
예제 #7
0
        /// <summary>
        /// Add header for document receipt
        /// </summary>
        /// <param name="streamWriter">Stream writer to write the text file.</param>
        /// <param name="stockReceipt"></param>
        /// <param name="isDuplicate"></param>
        public void AddDocHeaderForReceipt(StreamWriter streamWriter, DDChequeEntity chequeEntity)
        {
            streamWriter.WriteLine(" ");
            streamWriter.WriteLine("          TAMILNADU CIVIL SUPPLIES CORPORATION ");
            streamWriter.Write("       ");
            streamWriter.Write(report.StringFormatWithoutPipe(chequeEntity.RegionName, 30, 1));
            streamWriter.Write(report.StringFormatWithoutPipe("- RECEIPT -", 11, 2));
            streamWriter.Write(report.StringFormatWithoutPipe(chequeEntity.GodownName, 30, 2));
            streamWriter.WriteLine("");
            streamWriter.Write(" RECP.NO.: "); //"R00002                             DATE: 03/Jan/2011");
            streamWriter.Write(report.StringFormatWithoutPipe(chequeEntity.ReceiptNo, 25, 2));
            streamWriter.Write("   ");
            streamWriter.Write("DATE : ");
            streamWriter.Write(report.StringFormatWithoutPipe(report.FormatDate(chequeEntity.ReceiptDate), 13, 2));
            streamWriter.WriteLine("");
            streamWriter.WriteLine("------------------------------------------------------------------------------");
            streamWriter.Write("   Received with Thanks from Thiru / M/s.");
            streamWriter.Write(report.StringFormatWithoutPipe(chequeEntity.DDChequeItems[0].ReceivedFrom, 35, 2));
            streamWriter.WriteLine("");
            streamWriter.WriteLine("");
            streamWriter.Write(" Rupees ");
            string Rupees = string.Empty;

            try
            {
                NumberToWordConvertion numberToWord = new NumberToWordConvertion();
                //string[] split = chequeEntity.Total.Split('.');
                Rupees = numberToWord.GetNumberToWord(chequeEntity.Total);
                // ConvertNumbertoWords(Convert.ToInt64(split[0].ToString()));
            }
            catch (Exception ex)
            {
                AuditLog.WriteError(ex.Message + " " + ex.StackTrace);
            }
            streamWriter.Write(report.StringFormatWithoutPipe(Rupees, 68, 2));
            streamWriter.WriteLine("");
            report.AddMoreContent(streamWriter, Rupees, 68, 1);//Add content next line.
            streamWriter.WriteLine("");
            streamWriter.WriteLine(" by Cash/DD/Cheque ");
            streamWriter.WriteLine("------------------------------------------------------------------------------");
            streamWriter.WriteLine(" DD/Cheque No.      Date               Bank                      Amount");
            streamWriter.WriteLine("------------------------------------------------------------------------------");
        }
        /// <summary>
        /// Add header for document receipt
        /// </summary>
        /// <param name="streamWriter">Stream writer to write the text file.</param>
        /// <param name="deliveryOrderList"></param>
        /// <param name="isDuplicate"></param>
        public void AddDocHeaderForDeliveryOrder(StreamWriter streamWriter, DocumentDeliveryOrderEntity deliveryOrderEntity, bool isDuplicate = false)
        {
            streamWriter.WriteLine("|==========================================================================================================|");
            streamWriter.WriteLine("|                                                                                                          |");
            streamWriter.WriteLine("|                                       TAMILNADU CIVIL SUPPLIES CORPORATION                               |");
            streamWriter.Write("|                                              ");
            streamWriter.Write(manageReport.StringFormatWithoutPipe("REGION : ", 9, 1));
            streamWriter.Write(manageReport.StringFormat(deliveryOrderEntity.RegionName, 50, 2));
            streamWriter.WriteLine("");
            streamWriter.WriteLine("|                                                                                                          |");
            streamWriter.WriteLine("|                                      DELIVERY ORDER                                                      |");
            streamWriter.WriteLine("|==========================================================================================================|");
            streamWriter.Write("|TRANSACTION:");
            streamWriter.Write(manageReport.StringFormatWithoutPipe(deliveryOrderEntity.TransactionName, 21, 2));
            streamWriter.Write("GODOWN NAME: ");
            streamWriter.Write(manageReport.StringFormat(deliveryOrderEntity.GodownName, 59, 2));
            streamWriter.WriteLine(" ");
            streamWriter.Write("|DELIVERY ORDER: ");
            streamWriter.Write(manageReport.StringFormatWithoutPipe(deliveryOrderEntity.Dono, 16, 2));
            streamWriter.Write("DATE: ");
            streamWriter.Write(manageReport.StringFormatWithoutPipe(manageReport.FormatIndianDate(deliveryOrderEntity.DoDate.ToString()), 66, 2));
            streamWriter.Write("|");
            streamWriter.WriteLine(" ");
            streamWriter.WriteLine("|==========================================================================================================|");

            streamWriter.Write("|ISSUE TO:");
            streamWriter.Write(manageReport.StringFormatWithoutPipe(deliveryOrderEntity.ReceivorName, 96, 2) + "|");
            streamWriter.WriteLine(" ");
            streamWriter.Write("|INDENT NO:");
            streamWriter.Write(manageReport.StringFormatWithoutPipe(deliveryOrderEntity.IndentNo, 21, 2));
            // streamWriter.Write(manageReport.StringFormatWithoutPipe("DATE: ", 25, 1));
            streamWriter.Write("PERMIT DATE:");
            streamWriter.Write(manageReport.StringFormatWithoutPipe(manageReport.FormatDate(deliveryOrderEntity.PermitDate.ToString()), 13, 2));
            streamWriter.Write("ORDER PERIOD ENDING:");
            streamWriter.Write(manageReport.StringFormatWithoutPipe(deliveryOrderEntity.OrderPeriod, 27, 2));
            streamWriter.Write("|");
            streamWriter.WriteLine(" ");
            streamWriter.WriteLine("|==========================================================================================================|");
        }
예제 #9
0
        ///</summary>
        ///
        /// <param name="sw"></param>
        /// <param name="entity"></param>
        public void DateWiseHullingDetails(StreamWriter sw, CommonEntity entity)
        {
            int    iCount          = 11;
            int    i               = 1;
            string SRNO            = string.Empty;
            bool   isDataAvailable = false;

            // foreach (DataRow dateValue in distinctDate.Rows)
            //{
            isDataAvailable = true;
            AddHeader(sw, entity);
            // DataRow[] datas = entity.dataSet.Tables[0].Select("HullingReportDate='" + dateValue["HullingReportDate"] + "'");
            foreach (DataRow dr in entity.dataSet.Tables[0].Rows)
            {
                if (iCount >= 50)
                {
                    iCount = 11;
                    sw.WriteLine("------------------------------------------------------------------------------------------------------------------------------------------|");
                    sw.WriteLine((char)12);
                    AddHeader(sw, entity);
                }
                //sIssuer = Convert.ToString(dr["DepositorName"]).Trim();
                sw.Write(report.StringFormatWithoutPipe(i.ToString(), 4, 2));
                sw.Write(report.StringFormatWithoutPipe(dr["SRNo"].ToString(), 18, 2));
                sw.Write(report.StringFormatWithoutPipe(report.FormatDirectDate(dr["SRDate"].ToString()), 16, 2));
                sw.Write(report.StringFormatWithoutPipe(Convert.ToString(dr["DepositorName"]).Trim(), 37, 2));
                sw.Write(report.StringFormatWithoutPipe(dr["ITDescription"].ToString(), 26, 2));
                sw.Write(report.StringFormatWithoutPipe(dr["NoPacking"].ToString(), 12, 1));
                sw.Write(report.StringFormatWithoutPipe(dr["Nkgs"].ToString(), 19, 1));
                sw.WriteLine("");
                sw.WriteLine(" ");
                i = i + 1;
                iCount++;
            }
            sw.WriteLine("------------------------------------------------------------------------------------------------------------------------------------------|");
            sw.WriteLine((char)12);
            if (!isDataAvailable)
            {
                sw.WriteLine("---------------------------------------------------------------------------------------------------------------------------------------|");
                sw.WriteLine((char)12);
            }
        }
예제 #10
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="sw"></param>
 /// <param name="entity"></param>
 public void DateWiseCommodityIssueMemoReport(StreamWriter sw, CommonEntity entity)
 {
     try
     {
         int count = 10;
         // var dateList = entity.dataSet.Tables[0].DefaultView.ToTable(true, "Issue_Date");
         int    i        = 1;
         string issuedTo = string.Empty;
         AddHeader(sw, entity);
         foreach (DataRow row in entity.dataSet.Tables[0].Rows)
         {
             if (count >= 50)
             {
                 //Add header again
                 count = 11;
                 sw.WriteLine("---------------------------------------------------------------------------------------------------------------");
                 sw.WriteLine((char)12);
                 AddHeader(sw, entity);
             }
             issuedTo = Convert.ToString(row["Issuedto"]).Trim();
             sw.Write(report.StringFormatWithoutPipe(i.ToString(), 4, 2));
             sw.Write(report.StringFormatWithoutPipe(row["Issue_Memono"].ToString(), 16, 1));
             sw.Write(report.StringFormatWithoutPipe(row["Issue_Date"].ToString(), 10, 1) + "  ");
             sw.Write(report.StringFormatWithoutPipe(row["Commodity"].ToString(), 17, 2));
             sw.Write(report.StringFormatWithoutPipe(row["Quantity"].ToString(), 18, 1));
             sw.Write(report.StringFormatWithoutPipe(issuedTo, 24, 2));
             sw.Write(report.StringFormatWithoutPipe(row["Lorryno"].ToString(), 11, 1));
             sw.WriteLine("");
             sw.WriteLine(" ");
             i     = i + 1;
             count = count + 2;
         }
         sw.WriteLine("---------------------------------------------------------------------------------------------------------------");
         sw.WriteLine((char)12);
     }
     catch (Exception ex)
     {
         AuditLog.WriteError(ex.Message);
     }
 }
예제 #11
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="sw"></param>
 /// <param name="entity"></param>
 public void DateWiseCommodityIssueMemoReport(StreamWriter sw, CommonEntity entity, DataTable ndt)
 {
     try
     {
         int count = 8;
         // var dateList = entity.dataSet.Tables[0].DefaultView.ToTable(true, "Issue_Date");
         int     pageNo   = 1;
         decimal Payment  = 0;
         decimal Ceral    = 0;
         decimal NonCeral = 0;
         AddHeader(sw, entity, pageNo);
         foreach (DataRow row in ndt.Rows)
         {
             if (count >= 50)
             {
                 //Add header again
                 pageNo++;
                 count = 8;
                 sw.WriteLine("------------------------------------------------------------------------------------------------------------------------------------------------------------------");
                 sw.WriteLine((char)12);
                 AddHeader(sw, entity, pageNo);
             }
             sw.Write(" ");
             sw.Write(report.StringFormatWithoutPipe(row["GodownName"].ToString(), 24, 2));
             sw.Write(report.StringFormatWithoutPipe(row["Society"].ToString(), 34, 2));
             sw.Write(report.StringFormatWithoutPipe(row["Dono"].ToString(), 10, 2));
             sw.Write(report.StringFormatWithoutPipe(row["Dodate"].ToString(), 10, 2) + "  ");
             sw.Write(report.StringFormatWithoutPipe(row["Chequeno"].ToString(), 10, 2));
             sw.Write(report.StringFormatWithoutPipe(row["Chequedate"].ToString(), 10, 2));
             sw.Write(report.StringFormatWithoutPipe(report.Decimalformat(row["PaymentAmount"].ToString()), 12, 1) + "  ");
             sw.Write(report.StringFormatWithoutPipe(row["Bank"].ToString(), 14, 2));
             sw.Write(report.StringFormatWithoutPipe(report.Decimalformat(row["Cereal"].ToString()), 12, 1));
             sw.Write(report.StringFormatWithoutPipe(report.Decimalformat(row["NonCereal"].ToString()), 12, 1));
             sw.WriteLine("");
             count     = count + 1;
             Payment  += !string.IsNullOrEmpty(row["PaymentAmount"].ToString()) ? Convert.ToDecimal(row["PaymentAmount"]) : 0;
             Ceral    += !string.IsNullOrEmpty(row["Cereal"].ToString()) ? Convert.ToDecimal(row["Cereal"]) : 0;
             NonCeral += !string.IsNullOrEmpty(row["NonCereal"].ToString()) ? Convert.ToDecimal(row["NonCereal"]) : 0;
         }
         sw.WriteLine("------------------------------------------------------------------------------------------------------------------------------------------------------------------");
         sw.Write(report.StringFormatWithoutPipe(" ", 25, 2));
         sw.Write(report.StringFormatWithoutPipe(" ", 34, 2));
         sw.Write(report.StringFormatWithoutPipe(" ", 10, 2));
         sw.Write(report.StringFormatWithoutPipe(" ", 10, 2) + "  ");
         sw.Write(report.StringFormatWithoutPipe(" ", 10, 2));
         sw.Write(report.StringFormatWithoutPipe("Total", 10, 2));
         sw.Write(report.StringFormatWithoutPipe(report.Decimalformat(Convert.ToString(Payment)), 12, 1) + "  ");
         sw.Write(report.StringFormatWithoutPipe("", 14, 2));
         sw.Write(report.StringFormatWithoutPipe(report.Decimalformat(Convert.ToString(Ceral)), 12, 1));
         sw.Write(report.StringFormatWithoutPipe(report.Decimalformat(Convert.ToString(NonCeral)), 12, 1));
         sw.WriteLine("");
         sw.WriteLine("------------------------------------------------------------------------------------------------------------------------------------------------------------------");
         sw.WriteLine((char)12);
     }
     catch (Exception ex)
     {
         AuditLog.WriteError(ex.Message + " " + ex.StackTrace);
     }
 }
예제 #12
0
 /// <summary>
 /// Add header for document receipt
 /// </summary>
 /// <param name="streamWriter">Stream writer to write the text file.</param>
 /// <param name="stockIssuesEntity"></param>
 /// <param name="isDuplicate"></param>
 public void AddDocHeaderForIssues(StreamWriter streamWriter, StackEntity stackEntity)
 {
     streamWriter.WriteLine("                                                                           ");
     streamWriter.WriteLine("               TAMILNADU CIVIL SUPPLIES CORPORATION                        ");
     streamWriter.Write("                ");
     streamWriter.Write(report.StringFormatWithoutPipe("REGION : ", 9, 1));
     streamWriter.Write(report.StringFormatWithoutPipe(stackEntity.RName, 45, 2));
     streamWriter.WriteLine("");
     streamWriter.Write("  Godown :");
     streamWriter.Write(report.StringFormatWithoutPipe(stackEntity.GName, 25, 2));
     streamWriter.WriteLine("");
     streamWriter.WriteLine("                             Formation Year: " + stackEntity.StackDate);
     streamWriter.WriteLine("------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");
     streamWriter.WriteLine("                                                                           OPENING BALANCE RECEIPT         RECEIPT    ISSUE                   ISSUE   BALANCE            BALANCE  STACK");
     streamWriter.WriteLine("  SNO     COMMODITY             STACKNO       FROM DATE  TO DATE            BAGS       QTY  BAGS     GU        QTY     BAGS           GR        QTY     BAGS                  QTY  STATUS   W/OFF QTY");
     streamWriter.WriteLine("------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");
 }
예제 #13
0
        /// <summary>
        /// Write the Sales Customer Details
        /// </summary>
        /// <param name="sw"></param>
        /// <param name="entity"></param>
        public void WriteHoPurchase(StreamWriter sw, CommonEntity entity)
        {
            int iCount            = 10;
            var distinctCoop      = entity.dataSet.Tables[0].DefaultView.ToTable(true, "Depositor");
            var distinctCommodity = entity.dataSet.Tables[0].DefaultView.ToTable(true, "Commodity");
            //var distinctCommodity = entity.dataSet.Tables[0].DefaultView.ToTable(true, "Commodity");
            int     i          = 1;
            string  sAckno     = string.Empty;
            string  sDepositor = string.Empty;
            string  sCommodity = string.Empty;
            decimal dTotal     = 0;
            decimal gTotal     = 0;
            bool    dAvailable = false;

            AddHeaderForHoPurchase(sw, entity);

            foreach (DataRow CommodityValue in distinctCommodity.Rows)
            {
                gTotal = 0;
                foreach (DataRow dateValue in distinctCoop.Rows)
                {
                    dAvailable = false;
                    iCount     = 11;
                    bool CheckRepeatValue = false;
                    sAckno     = string.Empty;
                    sDepositor = string.Empty;
                    DataRow[] datas = entity.dataSet.Tables[0].Select("Depositor='" + dateValue["Depositor"] + "' and Commodity='" + CommodityValue["Commodity"] + "'");

                    foreach (var item in datas)
                    {
                        dAvailable = true;
                        if (iCount >= 50)
                        {
                            //Add header again
                            iCount = 11;
                            sw.WriteLine("-------------------------------------------------------------------------------------------------------------------------------------------------------------|");
                            sw.WriteLine((char)12);
                            AddHeaderForHoPurchase(sw, entity);
                        }
                        sDepositor = Convert.ToString(item["Depositor"]);
                        if (sAckno == sDepositor)
                        {
                            CheckRepeatValue = true;
                        }
                        else
                        {
                            CheckRepeatValue = false;
                            sAckno           = sDepositor;
                        }
                        sw.Write(report.StringFormatWithoutPipe(i.ToString(), 4, 2));
                        sw.Write(report.StringFormatWithoutPipe(item["Ackno"].ToString(), 11, 2));
                        sw.Write(report.StringFormatWithoutPipe(report.FormatDirectDate(item["Date"].ToString()), 10, 2));
                        sw.Write(report.StringFormatWithoutPipe(CheckRepeatValue == false ? sDepositor : " ", 35, 2));
                        sw.Write(report.StringFormatWithoutPipe(item["Commodity"].ToString(), 27, 2));
                        sw.Write(report.StringFormatWithoutPipe(item["Bags"].ToString(), 6, 1));
                        sw.Write(report.StringFormatWithoutPipe(report.DecimalformatForWeight(item["Quantity"].ToString()), 14, 1));
                        sw.Write(report.StringFormatWithoutPipe((item["TruckMen"].ToString()), 16, 2));
                        sw.Write(report.StringFormatWithoutPipe((item["orderno"].ToString()), 14, 2));
                        sw.Write(report.StringFormatWithoutPipe((item["Lorryno"].ToString()), 13, 2));
                        sw.WriteLine("");
                        iCount  = iCount + 1;
                        dTotal += Convert.ToDecimal(item["Quantity"].ToString());
                        // gTotal += Convert.ToDecimal(item["Quantity"].ToString());

                        i = i + 1;
                    }
                    if (dAvailable)
                    {
                        sw.Write(" ");
                        sw.Write(report.StringFormatWithoutPipe(" ", 34, 2));
                        sw.Write(report.StringFormatWithoutPipe("", 27, 2));
                        sw.Write(report.StringFormatWithoutPipe("Total".ToString(), 11, 2));
                        sw.Write(report.StringFormatWithoutPipe(report.DecimalformatForWeight(dTotal.ToString()), 37, 1));
                        gTotal += dTotal;
                        dTotal  = 0;
                        sw.WriteLine("");
                    }
                }
                sw.Write(" ");
                sw.Write(report.StringFormatWithoutPipe(" ", 34, 2));
                sw.Write(report.StringFormatWithoutPipe("", 27, 2));
                sw.Write(report.StringFormatWithoutPipe("Grand Total".ToString(), 11, 2));
                sw.Write(report.StringFormatWithoutPipe(report.DecimalformatForWeight(gTotal.ToString()), 37, 1));
                dTotal = 0;
                sw.WriteLine("");
                sw.WriteLine("---------------------------------------------------------------------------------------------------------------------------------------------------------------|");
            }
        }
예제 #14
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sw"></param>
        /// <param name="entity"></param>
        public void SocietyWiseDOAllSchemeReport(StreamWriter sw, CommonEntity entity)
        {
            int count = 10;

            int     i               = 1;
            string  doNo            = string.Empty;
            string  fromWhomRcd     = string.Empty;
            bool    isDataAvailable = false;
            decimal Qty             = 0;
            decimal Rate            = 0;
            decimal C_Amount        = 0;
            decimal NC_Amount       = 0;
            decimal Toatal_C_Amount = 0;
            decimal Total_NC_Amount = 0;
            decimal Amount          = 0;

            decimal GrandTotal_C  = 0;
            decimal GrandTotal_NC = 0;
            decimal GrandTotal    = 0;

            count = 11;
            try
            {
                // dateList = entity.dataSet.Tables[0].DefaultView.ToTable(true, new string[] { "Coop", "Comodity" });
                var dateList = entity.dataSet.Tables[0].DefaultView.ToTable(true, "Coop");

                foreach (DataRow date in dateList.Rows)
                {
                    Qty       = 0;
                    Rate      = 0;
                    C_Amount  = 0;
                    NC_Amount = 0;
                    Amount    = 0;

                    Toatal_C_Amount = 0;
                    Total_NC_Amount = 0;

                    GrandTotal_C    = 0;
                    GrandTotal_NC   = 0;
                    GrandTotal      = 0;
                    isDataAvailable = true;

                    string doNoNext = string.Empty;
                    string coop     = string.Empty;
                    AddHeader(sw, entity);
                    coop = Convert.ToString(date["Coop"]);
                    DataRow[] data = entity.dataSet.Tables[0].Select("Coop='" + coop + "'");
                    var       distinctCommodity = report.ConvertDataRowToTable(data, entity.dataSet.Tables[0]).DefaultView.ToTable(true, "Comodity");
                    sw.WriteLine(report.StringFormatWithoutPipe(coop, 50, 2));

                    foreach (DataRow item in distinctCommodity.Rows)
                    {
                        Qty             = 0;
                        Rate            = 0;
                        C_Amount        = 0;
                        NC_Amount       = 0;
                        Amount          = 0;
                        Toatal_C_Amount = 0;
                        Total_NC_Amount = 0;
                        DataRow[] ndata = entity.dataSet.Tables[0].Select("Coop='" + coop + "' and Comodity='" + Convert.ToString(item["Comodity"]) + "'");
                        foreach (DataRow row in ndata)
                        {
                            C_Amount  = 0;
                            NC_Amount = 0;
                            if (count >= 50)
                            {
                                //Add header again
                                count = 11;
                                sw.WriteLine("---------------------------------------------------------------------------------------------------------------------------------");
                                sw.WriteLine((char)12);
                                AddHeader(sw, entity);
                            }
                            doNoNext  = row["Dono"].ToString();
                            C_Amount  = (row["C_Nc"].ToString() == "C") ? Convert.ToDecimal(row["Amount"]) : 0;
                            NC_Amount = (row["C_Nc"].ToString() == "NC") ? Convert.ToDecimal(row["Amount"]) : 0;
                            sw.Write(report.StringFormatWithoutPipe(row["GodownName"].ToString(), 25, 2));

                            sw.Write(report.StringFormatWithoutPipe(doNoNext, 11, 1));
                            sw.Write(report.StringFormatWithoutPipe(report.FormatDirectDate(row["Dodate"].ToString()), 10, 2));
                            sw.Write(report.StringFormatWithoutPipe(row["Comodity"].ToString(), 15, 2));
                            sw.Write(report.StringFormatWithoutPipe(row["Scheme"].ToString(), 11, 2));
                            sw.Write(report.StringFormatWithoutPipe(report.DecimalformatForWeight(row["Quantity"].ToString()), 11, 1));
                            sw.Write(report.StringFormatWithoutPipe(report.Decimalformat(row["Rate"].ToString()), 10, 1));
                            sw.Write(report.StringFormatWithoutPipe(report.Decimalformat(Convert.ToString(C_Amount)), 11, 1));
                            sw.Write(report.StringFormatWithoutPipe(report.Decimalformat(Convert.ToString(NC_Amount)), 11, 1));
                            sw.Write(report.StringFormatWithoutPipe(report.Decimalformat(row["Amount"].ToString()), 11, 1));
                            sw.WriteLine("");
                            Rate            += !string.IsNullOrEmpty(Convert.ToString(row["Rate"])) ? Convert.ToDecimal(row["Rate"].ToString()) : 0;
                            Toatal_C_Amount += !string.IsNullOrEmpty(Convert.ToString(C_Amount)) ? C_Amount : 0;
                            Total_NC_Amount += !string.IsNullOrEmpty(Convert.ToString(NC_Amount)) ? NC_Amount : 0;
                            Amount          += !string.IsNullOrEmpty(Convert.ToString(row["Amount"])) ? Convert.ToDecimal(row["Amount"].ToString()) : 0;
                            Qty             += !string.IsNullOrEmpty(Convert.ToString(row["Quantity"])) ? Convert.ToDecimal(row["Quantity"].ToString()) : 0;
                            i = i + 1;
                            count++;
                        }
                        sw.WriteLine("---------------------------------------------------------------------------------------------------------------------------------");
                        sw.Write(report.StringFormatWithoutPipe("", 36, 2));
                        sw.Write(report.StringFormatWithoutPipe("", 10, 2));
                        sw.Write(report.StringFormatWithoutPipe("", 15, 2));
                        sw.Write(report.StringFormatWithoutPipe("  Total ", 11, 1));
                        sw.Write(report.StringFormatWithoutPipe(Qty.ToString(), 11, 1));
                        sw.Write(report.StringFormatWithoutPipe(report.Decimalformat(Rate.ToString()), 10, 1));
                        sw.Write(report.StringFormatWithoutPipe(report.Decimalformat(Toatal_C_Amount.ToString()), 11, 1));
                        sw.Write(report.StringFormatWithoutPipe(report.Decimalformat(Total_NC_Amount.ToString()), 11, 1));
                        sw.Write(report.StringFormatWithoutPipe(report.Decimalformat(Amount.ToString()), 11, 1));
                        GrandTotal_C  += Toatal_C_Amount;
                        GrandTotal_NC += Total_NC_Amount;
                        GrandTotal    += Amount;
                        sw.WriteLine("");
                        sw.WriteLine("---------------------------------------------------------------------------------------------------------------------------------");
                    }
                    sw.WriteLine("---------------------------------------------------------------------------------------------------------------------------------");
                    sw.Write(report.StringFormatWithoutPipe("", 36, 2));
                    sw.Write(report.StringFormatWithoutPipe("", 10, 2));
                    sw.Write(report.StringFormatWithoutPipe("", 15, 2));
                    sw.Write(report.StringFormatWithoutPipe("  Demand ", 11, 1));
                    sw.Write(report.StringFormatWithoutPipe(" ", 11, 1));
                    sw.Write(report.StringFormatWithoutPipe(" ", 10, 1));
                    sw.Write(report.StringFormatWithoutPipe(report.Decimalformat(GrandTotal_C.ToString()), 11, 1));
                    sw.Write(report.StringFormatWithoutPipe(report.Decimalformat(GrandTotal_NC.ToString()), 11, 1));
                    sw.Write(report.StringFormatWithoutPipe(report.Decimalformat(GrandTotal.ToString()), 11, 1));
                    sw.WriteLine("");
                    sw.WriteLine("---------------------------------------------------------------------------------------------------------------------------------");

                    //Check Collections
                    sw.WriteLine((char)12);
                }
                if (!isDataAvailable)
                {
                    sw.WriteLine("---------------------------------------------------------------------------------------------------------------");
                    sw.WriteLine((char)12);
                }
            }
            catch (Exception ex)
            {
                AuditLog.WriteError(ex.Message);
            }
        }
예제 #15
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="sw"></param>
 /// <param name="entity"></param>
 public void CommodityWiseIssueMemoReport(StreamWriter sw, CommonEntity entity)
 {
     try
     {
         int     count     = 8;
         var     dateList  = entity.dataSet.Tables[0].DefaultView.ToTable(true, "Commodity");
         int     pageNo    = 1;
         decimal netweight = 0;
         AddHeader(sw, entity, pageNo);
         int i = 1;
         foreach (DataRow nrow in dateList.Rows)
         {
             netweight = 0;
             DataRow[] drdata = entity.dataSet.Tables[0].Select("Commodity='" + Convert.ToString(nrow["Commodity"]) + "'");
             foreach (DataRow row in drdata)
             {
                 if (count >= 50)
                 {
                     //Add header again
                     pageNo++;
                     count = 8;
                     sw.WriteLine("-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");
                     sw.WriteLine((char)12);
                     AddHeader(sw, entity, pageNo);
                 }
                 sw.Write("");
                 sw.Write(report.StringFormatWithoutPipe(i.ToString(), 4, 2));
                 sw.Write(report.StringFormatWithoutPipe(row["Issue_Date"].ToString(), 10, 2));
                 sw.Write(report.StringFormatWithoutPipe(row["Issueno"].ToString(), 11, 1) + " ");
                 sw.Write(report.StringFormatWithoutPipe(row["Commodity"].ToString(), 16, 2));
                 sw.Write(report.StringFormatWithoutPipe(report.DecimalformatForWeight(row["NetWt"].ToString()), 11, 1) + "  ");
                 sw.Write(report.StringFormatWithoutPipe(row["Stackno"].ToString(), 14, 2));
                 sw.Write(report.StringFormatWithoutPipe(row["remarks"].ToString(), 101, 2));
                 sw.WriteLine("");
                 count      = count + 1;
                 netweight += !string.IsNullOrEmpty(row["NetWt"].ToString()) ? Convert.ToDecimal(row["NetWt"]) : 0;
                 i++;
             }
             sw.WriteLine("-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");
             sw.Write("");
             sw.Write(report.StringFormatWithoutPipe("", 4, 2));
             sw.Write(report.StringFormatWithoutPipe("Total", 10, 2));
             sw.Write(report.StringFormatWithoutPipe("-", 11, 1) + " ");
             sw.Write(report.StringFormatWithoutPipe("-", 16, 2));
             sw.Write(report.StringFormatWithoutPipe(report.DecimalformatForWeight(Convert.ToString(netweight)), 11, 1) + "  ");
             sw.Write(report.StringFormatWithoutPipe("-", 14, 2));
             sw.Write(report.StringFormatWithoutPipe("-", 101, 2));
             sw.WriteLine("");
             sw.WriteLine("-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");
             count = count + 1;
         }
         sw.WriteLine((char)12);
     }
     catch (Exception ex)
     {
         AuditLog.WriteError(ex.Message + " " + ex.StackTrace);
     }
 }
예제 #16
0
        /// <summary>
        /// Add date wise stock issues
        /// </summary>
        /// <param name="sw">Stream writer</param>
        /// <param name="entity">Common eitity</param>
        public void DateWiseStockIssuesRegister(StreamWriter sw, CommonEntity entity)
        {
            int    count            = 10;
            var    dateList         = entity.dataSet.Tables[0].DefaultView.ToTable(true, "Issue_Date");
            int    i                = 1;
            string issueMemo        = string.Empty;
            string fromWhomRcd      = string.Empty;
            bool   CheckRepeatValue = false;
            string weighmentType    = string.Empty;

            foreach (DataRow date in dateList.Rows)
            {
                count = 11;
                string    issueMemoNext = string.Empty;
                DataRow[] data          = entity.dataSet.Tables[0].Select("Issue_Date='" + date["Issue_Date"] + "'");
                AddHeaderForDateWise(sw, Convert.ToString(date["Issue_Date"]));
                foreach (DataRow row in data)
                {
                    if (count >= 50)
                    {
                        //Add header again
                        count = 11;
                        sw.WriteLine("---------------------------------------------------------------------------------------------------------------------------------------------");
                        sw.WriteLine((char)12);
                        AddHeaderForDateWise(sw, Convert.ToString(date["Issue_Date"]));
                    }
                    weighmentType = row["ITBweighment"].ToString().ToUpper();
                    issueMemoNext = row["Issue_Memono"].ToString();
                    fromWhomRcd   = Convert.ToString(row["To_Whom_Issued"]).Trim();
                    if (issueMemo == issueMemoNext)
                    {
                        CheckRepeatValue = true;
                    }
                    else
                    {
                        CheckRepeatValue = false;
                        issueMemo        = issueMemoNext;
                    }
                    sw.Write(report.StringFormatWithoutPipe(CheckRepeatValue == false ? i.ToString() : " ", 4, 2));
                    sw.Write(report.StringFormatWithoutPipe(CheckRepeatValue == false ? issueMemoNext : " ", 11, 1));
                    sw.Write(report.StringFormatWithoutPipe(CheckRepeatValue == false ? row["DNo"].ToString() : " ", 11, 2));
                    sw.Write(report.StringFormatWithoutPipe(CheckRepeatValue == false ? row["Lorryno"].ToString() : " ", 11, 1));
                    sw.Write(report.StringFormatWithoutPipe(CheckRepeatValue == false ? fromWhomRcd : " ", 33, 2));
                    sw.Write(report.StringFormatWithoutPipe(row["Scheme"].ToString(), 12, 2));
                    sw.Write(report.StringFormatWithoutPipe(row["Stackno"].ToString(), 12, 1));
                    sw.Write(report.StringFormatWithoutPipe(row["NoPacking"].ToString(), 8, 1));
                    sw.Write(report.StringFormatWithoutPipe(row["Commodity"].ToString(), 17, 2));
                    sw.Write(report.StringFormatWithoutPipe(weighmentType == "NOS" ? row["NetWt"].ToString() : report.DecimalformatForWeight(row["NetWt"].ToString()), 14, 1));
                    sw.WriteLine("");
                    i = CheckRepeatValue == false ? i + 1 : i;
                    count++;
                }
                sw.WriteLine((char)12);
            }
            sw.WriteLine("---------------------------------------------------------------------------------------------------------------------------------------------");
            if (count == 11)
            {
                sw.WriteLine((char)12);
            }
        }
예제 #17
0
        /// <summary>
        /// Write the Sales Customer Details
        /// </summary>
        /// <param name="sw"></param>
        /// <param name="entity"></param>
        public void WriteSalesIssueMemo(StreamWriter sw, CommonEntity entity)
        {
            int iCount       = 11;
            int i            = 1;
            var distinctCoop = entity.dataSet.Tables[0].DefaultView.ToTable(true, "Coop");
            //var distinctCommodity = entity.dataSet.Tables[0].DefaultView.ToTable(true, "Commodity");
            string  sAckno     = string.Empty;
            string  sCoop      = string.Empty;
            string  sCommodity = string.Empty;
            decimal dTotal     = 0;
            decimal gTotal     = 0;

            AddHeaderForCustomerDetail(sw, entity);
            foreach (DataRow dateValue in distinctCoop.Rows)
            {
                bool CheckRepeatValue = false;
                sCoop      = string.Empty;
                sAckno     = string.Empty;
                sCommodity = string.Empty;
                DataRow[] datas = entity.dataSet.Tables[0].Select("Coop='" + dateValue["Coop"] + "'");
                //DataRow[] datac = entity.dataSet.Tables[0].Select("Commodity='" + dateValue["Commodity"] + "'");

                foreach (var item in datas)
                {
                    if (iCount >= 50)
                    {
                        //Add header again
                        iCount = 11;
                        sw.WriteLine("----------------------------------------------------------------------------------------------------------------------------------------------|");
                        sw.WriteLine((char)12);
                        AddHeaderForCustomerDetail(sw, entity);
                    }
                    sCoop = Convert.ToString(item["Coop"]);
                    if (sAckno == sCoop)
                    {
                        CheckRepeatValue = true;
                    }
                    else
                    {
                        CheckRepeatValue = false;
                        sAckno           = sCoop;
                    }
                    sw.Write(report.StringFormatWithoutPipe(i.ToString(), 4, 2));
                    sw.Write(report.StringFormatWithoutPipe(item["Ackno"].ToString(), 12, 2));
                    //sw.Write(report.StringFormatWithoutPipe(report.FormatDirectDate(dateValue["Date"].ToString()), 16, 2));
                    sw.Write(report.StringFormatWithoutPipe(report.FormatDirectDate(item["Date"].ToString()), 10, 2));
                    sw.Write(report.StringFormatWithoutPipe(CheckRepeatValue == false ? sCoop : " ", 35, 2));
                    sw.Write(report.StringFormatWithoutPipe(item["Scheme"].ToString(), 13, 2));
                    sw.Write(report.StringFormatWithoutPipe(item["Commodity"].ToString(), 27, 2));
                    sw.Write(report.StringFormatWithoutPipe(report.DecimalformatForWeight(item["Quantity"].ToString()), 11, 1));
                    sw.Write(report.StringFormatWithoutPipe((item["Rate"].ToString()), 10, 1));
                    sw.Write(report.StringFormatWithoutPipe((item["Value"].ToString()), 11, 1));
                    sw.WriteLine("");
                    iCount  = iCount + 1;
                    dTotal += Convert.ToDecimal(item["Quantity"].ToString());
                    gTotal += Convert.ToDecimal(item["Quantity"].ToString());
                    i       = i + 1;
                    iCount++;
                }
                //sw.WriteLine("-------------------------------------------------------------------------------------------------------------------------------------|");
                sw.Write(" ");
                sw.Write(report.StringFormatWithoutPipe(" ", 34, 2));
                sw.Write(report.StringFormatWithoutPipe("", 28, 2));
                sw.Write(report.StringFormatWithoutPipe("Total".ToString(), 11, 2));
                sw.Write(report.StringFormatWithoutPipe(report.DecimalformatForWeight(dTotal.ToString()), 41, 1));
                dTotal = 0;
                sw.WriteLine("");
                //sw.WriteLine("-------------------------------------------------------------------------------------------------------------------------------------|");
            }

            sw.WriteLine("----------------------------------------------------------------------------------------------------------------------------------------------|");
            sw.Write(" ");
            sw.Write(report.StringFormatWithoutPipe(" ", 34, 2));
            sw.Write(report.StringFormatWithoutPipe("", 28, 2));
            sw.Write(report.StringFormatWithoutPipe("Grand Total".ToString(), 12, 2));
            sw.Write(report.StringFormatWithoutPipe(report.DecimalformatForWeight(gTotal.ToString()), 40, 1));
            sw.WriteLine("");
            sw.WriteLine("----------------------------------------------------------------------------------------------------------------------------------------------|");
            sw.WriteLine((char)12);
        }
예제 #18
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sw"></param>
        /// <param name="entity"></param>
        public void SocietyWiseDOAllSchemeReport(StreamWriter sw, CommonEntity entity)
        {
            int count = 8;

            int     i                 = 1;
            string  doNo              = string.Empty;
            string  fromWhomRcd       = string.Empty;
            bool    isDataAvailable   = false;
            decimal Due               = 0;
            decimal Paid              = 0;
            decimal AdvanceCollection = 0;
            decimal Debit             = 0;

            decimal GrandTotal_Due   = 0;
            decimal GrandTotal_Paid  = 0;
            decimal GrandTotal_ADV   = 0;
            decimal GrandTotal_Debit = 0;

            try
            {
                // dateList = entity.dataSet.Tables[0].DefaultView.ToTable(true, new string[] { "Coop", "Comodity" });
                var dateList = entity.dataSet.Tables[0].DefaultView.ToTable(true, "issuername");
                AddHeader(sw, entity);
                foreach (DataRow date in dateList.Rows)
                {
                    Due  = 0;
                    Paid = 0;
                    AdvanceCollection = 0;
                    Debit             = 0;
                    isDataAvailable   = true;

                    string doNoNext = string.Empty;
                    string coop     = string.Empty;
                    coop = Convert.ToString(date["issuername"]);
                    DataRow[] data = entity.dataSet.Tables[0].Select("issuername='" + coop + "'");
                    i = 1;
                    foreach (DataRow row in data)
                    {
                        if (count >= 50)
                        {
                            //Add header again
                            count = 8;
                            sw.WriteLine("----------------------------------------------------------------------------------------------------------------------------------");
                            sw.WriteLine((char)12);
                            AddHeader(sw, entity);
                        }
                        sw.Write(report.StringFormatWithoutPipe(row["GodownName"].ToString(), 25, 2));

                        sw.Write(report.StringFormatWithoutPipe(row["Dono"].ToString(), 10, 2));
                        sw.Write(report.StringFormatWithoutPipe(i == 1 ? row["issuername"].ToString() : " ", 30, 2));
                        sw.Write(report.StringFormatWithoutPipe(report.FormatDirectDate(row["DoDate"].ToString()), 10, 2));
                        sw.Write(report.StringFormatWithoutPipe(report.Decimalformat(row["Due"].ToString()), 13, 1));
                        sw.Write(report.StringFormatWithoutPipe(report.Decimalformat(row["Paid"].ToString()), 12, 1));
                        sw.Write(report.StringFormatWithoutPipe(report.Decimalformat(row["AdvanceCollection"].ToString()), 13, 1));
                        sw.Write(report.StringFormatWithoutPipe(report.Decimalformat(row["Debit"].ToString()), 12, 1));
                        sw.WriteLine("");
                        Due  += !string.IsNullOrEmpty(Convert.ToString(row["Due"])) ? Convert.ToDecimal(row["Due"].ToString()) : 0;
                        Paid += !string.IsNullOrEmpty(Convert.ToString(row["Paid"])) ? Convert.ToDecimal(row["Paid"].ToString()) : 0;
                        AdvanceCollection += !string.IsNullOrEmpty(Convert.ToString(row["AdvanceCollection"])) ? Convert.ToDecimal(row["AdvanceCollection"].ToString()) : 0;
                        Debit             += !string.IsNullOrEmpty(Convert.ToString(row["Debit"])) ? Convert.ToDecimal(row["Debit"].ToString()) : 0;
                        i = 2;
                        count++;
                    }
                    sw.WriteLine("----------------------------------------------------------------------------------------------------------------------------------");
                    sw.Write(report.StringFormatWithoutPipe(" ", 35, 2));
                    sw.Write(report.StringFormatWithoutPipe(" ", 30, 2));
                    sw.Write(report.StringFormatWithoutPipe("Total", 10, 2));
                    sw.Write(report.StringFormatWithoutPipe(report.Decimalformat(Due.ToString()), 13, 1));
                    sw.Write(report.StringFormatWithoutPipe(report.Decimalformat(Paid.ToString()), 12, 1));
                    sw.Write(report.StringFormatWithoutPipe(report.Decimalformat(AdvanceCollection.ToString()), 13, 1));
                    sw.Write(report.StringFormatWithoutPipe(report.Decimalformat(Debit.ToString()), 12, 1));
                    sw.WriteLine("");
                    GrandTotal_Due   += Due;
                    GrandTotal_Paid  += Paid;
                    GrandTotal_ADV   += AdvanceCollection;
                    GrandTotal_Debit += Debit;
                    sw.WriteLine("----------------------------------------------------------------------------------------------------------------------------------");
                }
                sw.WriteLine("----------------------------------------------------------------------------------------------------------------------------------");
                sw.Write(report.StringFormatWithoutPipe(" ", 35, 2));
                sw.Write(report.StringFormatWithoutPipe(" ", 20, 2));
                sw.Write(report.StringFormatWithoutPipe("Grand Total", 20, 2));
                sw.Write(report.StringFormatWithoutPipe(report.Decimalformat(GrandTotal_Due.ToString()), 13, 1));
                sw.Write(report.StringFormatWithoutPipe(report.Decimalformat(GrandTotal_Paid.ToString()), 12, 1));
                sw.Write(report.StringFormatWithoutPipe(report.Decimalformat(GrandTotal_ADV.ToString()), 13, 1));
                sw.Write(report.StringFormatWithoutPipe(report.Decimalformat(GrandTotal_Debit.ToString()), 12, 1));
                sw.WriteLine("");
                sw.WriteLine("----------------------------------------------------------------------------------------------------------------------------------");
                //Check Collections
                sw.WriteLine((char)12);
                if (!isDataAvailable)
                {
                    sw.WriteLine("----------------------------------------------------------------------------------------------------------------------------------");
                    sw.WriteLine((char)12);
                }
            }
            catch (Exception ex)
            {
                AuditLog.WriteError(ex.Message);
            }
        }
예제 #19
0
 /// <summary>
 /// Add header for document receipt
 /// </summary>
 /// <param name="streamWriter">Stream writer to write the text file.</param>
 /// <param name="stockIssuesEntity"></param>
 /// <param name="isDuplicate"></param>
 public void AddDocHeaderForIssues(StreamWriter streamWriter, List <StackCardEntity> stackCardEntities, StackEntity stackEntity)
 {
     streamWriter.WriteLine("                                                                           ");
     streamWriter.WriteLine("               TAMILNADU CIVIL SUPPLIES CORPORATION                        ");
     streamWriter.Write("                ");
     streamWriter.Write(report.StringFormatWithoutPipe("REGION : ", 9, 1));
     streamWriter.Write(report.StringFormatWithoutPipe(stackEntity.RName, 45, 2));
     streamWriter.WriteLine("");
     streamWriter.Write("  Commodity: ");
     streamWriter.Write(report.StringFormatWithoutPipe(stackEntity.ITName, 25, 2));
     streamWriter.Write("  Godown :");
     streamWriter.Write(report.StringFormatWithoutPipe(stackEntity.GName, 25, 2));
     streamWriter.WriteLine("");
     streamWriter.WriteLine("                                             Stack.No: " + stackEntity.TStockNo);
     streamWriter.WriteLine("----|--------------------------------|-----------------------------------------|");
     streamWriter.WriteLine("    |        RECEIPT                 |              ISSUES                     |");
     streamWriter.WriteLine("----|--------------------------------|-----------------------------------------|");
     streamWriter.WriteLine("Slno|  DATE      Bags.   Quantity    |   Bags.     Quantity         Clo.Bal.   |");
     streamWriter.WriteLine("----|--------------------------------|-----------------------------------------|");
 }
예제 #20
0
        /// <summary>
        /// Add header for document receipt
        /// </summary>
        /// <param name="streamWriter">Stream writer to write the text file.</param>
        /// <param name="stockReceipt"></param>
        /// <param name="isDuplicate"></param>
        public void AddDocHeaderForReceipt(StreamWriter streamWriter, DocumentStockReceiptList stockReceipt, bool isDuplicate = false)
        {
            streamWriter.WriteLine("|----------------------------------------------------------------------------------------------------------|");
            streamWriter.WriteLine("|                                                                                                          |");
            streamWriter.WriteLine("|                                                                                                          |");
            streamWriter.WriteLine("|                                       TAMILNADU CIVIL SUPPLIES CORPORATION                               |");
            streamWriter.Write("|                                           ");
            streamWriter.Write(report.StringFormatWithoutPipe("REGION : ", 9, 1));
            streamWriter.Write(report.StringFormat(stockReceipt.RegionName, 53, 2));
            streamWriter.WriteLine("");
            streamWriter.WriteLine("|                                                                                                          |");
            streamWriter.WriteLine("|                                                                                                          |");
            if (isDuplicate)
            {
                streamWriter.WriteLine("|                                      STOCK RECEIPT ACKNOWLEDGMENT            DUPLICATE COPY              |");
            }
            else
            {
                streamWriter.WriteLine("|                                      STOCK RECEIPT ACKNOWLEDGMENT                                        |");
            }
            streamWriter.WriteLine("|----------------------------------------------------------------------------------------------------------|");
            streamWriter.Write("|ACKNOWLEDGEMENT NO:");
            streamWriter.Write(report.StringFormatWithoutPipe(stockReceipt.SRNo, 21, 2));
            streamWriter.Write("ALLOTMENT/RELEASE ORDER: ");
            streamWriter.Write(report.StringFormatWithoutPipe(stockReceipt.OrderNo + " " + stockReceipt.PAllotment, 16, 2));
            streamWriter.Write("GATE PASS : "******"", 10, 2));
            streamWriter.Write("|");
            streamWriter.WriteLine(" ");

            streamWriter.Write("|              DATE:");
            streamWriter.Write(report.StringFormatWithoutPipe(report.FormatDate(stockReceipt.SRDate.ToString()), 21, 2));
            streamWriter.Write(report.StringFormatWithoutPipe("DATE: ", 25, 1));
            streamWriter.Write(report.StringFormatWithoutPipe(report.FormatDate(stockReceipt.OrderDate.ToString()), 38, 2));
            streamWriter.Write("|");
            streamWriter.WriteLine(" ");

            streamWriter.Write("|PERIOD OF ALLOTMENT:");
            streamWriter.Write(report.StringFormatWithoutPipe(report.FormatDate(stockReceipt.SRDate.ToString()), 30, 2));
            streamWriter.Write("Transaction Type: ");
            streamWriter.Write(report.StringFormatWithoutPipe(stockReceipt.TransactionName, 36, 2));
            streamWriter.Write("|");
            streamWriter.WriteLine(" ");

            streamWriter.Write("|RECEIVING GODOWN:");
            streamWriter.Write(report.StringFormatWithoutPipe(stockReceipt.GodownName, 30, 2));
            streamWriter.Write("DEPOSITOR'S NAME:");
            streamWriter.Write(report.StringFormatWithoutPipe(stockReceipt.DepositorName, 40, 2));
            streamWriter.Write("|");
            streamWriter.WriteLine(" ");

            streamWriter.WriteLine("|----------------------------------------------------------------------------------------------------------|");
            streamWriter.WriteLine("||--------------------------------------------------------------------------------------------------------||");
            streamWriter.WriteLine("||SNo |STACK NO   |COMMODITY           | SCHEME       |UNIT WEIGHT  |NO.OF |  Gross        NET   |% OF    ||");
            streamWriter.WriteLine("||    |           |                    |              |             |  UNIT|   WEIGHT in Kgs/NOs |MOISTURE||");
            streamWriter.WriteLine("||--------------------------------------------------------------------------------------------------------||");
        }
예제 #21
0
        /// <summary>
        /// Add header for document receipt
        /// </summary>
        /// <param name="streamWriter">Stream writer to write the text file.</param>
        /// <param name="stockIssuesEntity"></param>
        /// <param name="isDuplicate"></param>
        public void AddDocHeaderForIssues(StreamWriter streamWriter, DocumentStockIssuesEntity stockIssuesEntity, bool isDuplicate = false)
        {
            streamWriter.WriteLine("---------------------------------------------------------------------------------------------------------------");
            streamWriter.WriteLine("|                                                                                                             |");
            streamWriter.WriteLine("|                                                                                                             |");
            streamWriter.WriteLine("|                                          TAMILNADU CIVIL SUPPLIES CORPORATION                               |");
            streamWriter.Write("|                                              ");
            streamWriter.Write(report.StringFormatWithoutPipe("REGION : ", 9, 1));
            streamWriter.Write(report.StringFormat(stockIssuesEntity.RegionName, 53, 2));
            streamWriter.WriteLine("");
            streamWriter.WriteLine("|                                                                                                             |");
            streamWriter.WriteLine("|                                                                                                             |");
            if (isDuplicate)
            {
                streamWriter.WriteLine("|                                      STOCK ISSUE - ISSUE MEMO                DUPLICATE COPY                 |");
            }
            else
            {
                streamWriter.WriteLine("|                                      STOCK ISSUE - ISSUE MEMO                                               |");
            }
            streamWriter.WriteLine("|-------------------------------------------------------------------------------------------------------------|");
            streamWriter.Write("|ISSUE MEMO NO  :   ");
            streamWriter.Write(report.StringFormatWithoutPipe(stockIssuesEntity.SINo, 21, 2));
            streamWriter.Write("DATE: ");
            streamWriter.Write(report.StringFormatWithoutPipe(report.FormatDate(stockIssuesEntity.SIDate.ToString()), 12, 2));
            streamWriter.Write("TIME:");
            streamWriter.Write(report.StringFormatWithoutPipe(report.GetCurrentTime(DateTime.Now), 14, 2));
            streamWriter.Write(report.StringFormatWithoutPipe((stockIssuesEntity.IssueRegularAdvance.ToUpper() == "R" ? "REGULAR" : "ADVANCE"), 8, 2));
            streamWriter.Write(report.StringFormat(stockIssuesEntity.IRelates, 20, 2));
            streamWriter.WriteLine(" ");

            streamWriter.Write("|ISSUING GODOWN :   ");
            streamWriter.Write(report.StringFormatWithoutPipe(stockIssuesEntity.GodownName, 21, 2));
            streamWriter.Write(report.StringFormatWithoutPipe("TO WHOM ISSUED:", 15, 1));
            streamWriter.Write(report.StringFormatWithoutPipe(stockIssuesEntity.ReceiverName, 51, 2));
            streamWriter.Write("|");
            streamWriter.WriteLine(" ");
            try
            {
                streamWriter.Write("|                                         ");
                streamWriter.Write(report.StringFormatWithoutPipe("ISSUER CODE  :", 15, 1));
                streamWriter.Write(report.StringFormatWithoutPipe(stockIssuesEntity.IssuerCode, 51, 2));
                streamWriter.Write("|");
                streamWriter.WriteLine(" ");
            }
            catch (Exception ex)
            {
                AuditLog.WriteError(ex.Message);
            }
            streamWriter.WriteLine("||------------------------------------------------------------------------------------------------------|-----|");
            streamWriter.WriteLine("||SNo|  STACK NO  |    COMMODITY                  |  SCHEME      |UNIT WEIGHT  |NO.OFUNITS|   NET Wt/Nos|MOI% |");
            streamWriter.WriteLine("||------------------------------------------------------------------------------------------------------|-----|");
        }
예제 #22
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sw"></param>
        /// <param name="entity"></param>
        public void DateWiseCommodityIssueMemoReport(StreamWriter sw, CommonEntity entity)
        {
            try
            {
                int count = 8;
                int i     = 1;
                AddHeader(sw, entity);
                decimal TotalAmount = 0;
                foreach (DataRow row in entity.dataSet.Tables[0].Rows)
                {
                    if (count >= 50)
                    {
                        //Add header again
                        count = 8;
                        sw.WriteLine("------------------------------------------------------------------------------------------------------------------------------------------------------------");
                        sw.WriteLine((char)12);
                        AddHeader(sw, entity);
                    }
                    sw.Write(report.StringFormatWithoutPipe(row["GodownName"].ToString(), 25, 2));

                    sw.Write(report.StringFormatWithoutPipe(row["Coop"].ToString(), 33, 2));
                    sw.Write(report.StringFormatWithoutPipe(row["Dono"].ToString(), 10, 2));
                    sw.Write(report.StringFormatWithoutPipe(report.FormatDirectDate(row["Dodate"].ToString()), 10, 2));
                    sw.Write(report.StringFormatWithoutPipe(row["Comodity"].ToString(), 26, 2));
                    sw.Write(report.StringFormatWithoutPipe(row["Scheme"].ToString(), 12, 2));
                    sw.Write(report.StringFormatWithoutPipe(report.DecimalformatForWeight(row["Quantity"].ToString()), 12, 1) + "    ");
                    sw.Write(report.StringFormatWithoutPipe(report.Decimalformat(row["Rate"].ToString()), 6, 1) + " ");
                    sw.Write(report.StringFormatWithoutPipe(report.Decimalformat(row["Amount"].ToString()), 10, 1));
                    sw.WriteLine("");
                    TotalAmount += Convert.ToDecimal(report.Decimalformat(row["Amount"].ToString()));
                    i            = i + 1;
                    count        = count + 1;
                }
                sw.WriteLine("------------------------------------------------------------------------------------------------------------------------------------------------------------");
                sw.Write(report.StringFormatWithoutPipe(" ", 33, 2));
                sw.Write(report.StringFormatWithoutPipe(" ", 35, 2));
                sw.Write(report.StringFormatWithoutPipe(" ", 10, 2));
                sw.Write(report.StringFormatWithoutPipe(" ", 26, 2));
                sw.Write(report.StringFormatWithoutPipe(" ", 12, 2));
                sw.Write(report.StringFormatWithoutPipe(" ", 12, 1) + "    ");
                sw.Write(report.StringFormatWithoutPipe(report.Decimalformat(TotalAmount.ToString()), 18, 1));
                sw.WriteLine("");
                sw.WriteLine("------------------------------------------------------------------------------------------------------------------------------------------------------------");
                sw.WriteLine((char)12);
            }
            catch (Exception ex)
            {
                AuditLog.WriteError(ex.Message);
            }
        }
예제 #23
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sw"></param>
        /// <param name="entity"></param>
        public void WriteSalesIssueMemoAbstract(StreamWriter sw, CommonEntity entity)
        {
            try
            {
                int count             = 10;
                var distinctCommodity = entity.dataSet.Tables[0].DefaultView.ToTable(true, "Commodity");
                // var dateList = entity.dataSet.Tables[0].DefaultView.ToTable(true, "Issue_Date");
                int     i          = 1;
                string  society    = string.Empty;
                string  sCommodity = string.Empty;
                decimal dTotal     = 0;
                decimal gTotal     = 0;
                AddHeader(sw, entity);
                foreach (DataRow dateValue in distinctCommodity.Rows)
                {
                    sCommodity = string.Empty;
                    DataRow[] datas = entity.dataSet.Tables[0].Select("Commodity='" + dateValue["Commodity"] + "'");
                    //DataRow[] datac = entity.dataSet.Tables[0].Select("Commodity='" + dateValue["Commodity"] + "'");

                    foreach (var row in datas)
                    {
                        if (count >= 50)
                        {
                            //Add header again
                            count = 11;
                            sw.WriteLine("---------------------------------------------------------------------------------------------------------------------|");
                            sw.WriteLine((char)12);
                            AddHeader(sw, entity);
                        }
                        society = Convert.ToString(row["Society"]).Trim();
                        sw.Write(report.StringFormatWithoutPipe(i.ToString(), 4, 2));
                        sw.Write(report.StringFormatWithoutPipe(society, 30, 2));
                        sw.Write(report.StringFormatWithoutPipe(row["Scheme"].ToString(), 16, 2));
                        sw.Write(report.StringFormatWithoutPipe(row["Commodity"].ToString(), 27, 2) + "  ");
                        sw.Write(report.StringFormatWithoutPipe(report.DecimalformatForWeight(row["Quantity"].ToString()), 10, 1));
                        sw.Write(report.StringFormatWithoutPipe(row["Rate"].ToString(), 10, 1));
                        sw.Write(report.StringFormatWithoutPipe(row["Value"].ToString(), 10, 1));
                        //sw.WriteLine("");
                        sw.WriteLine(" ");
                        dTotal += Convert.ToDecimal(row["Quantity"].ToString());
                        gTotal += Convert.ToDecimal(row["Quantity"].ToString());
                        i       = i + 1;
                        count   = count + 2;
                    }
                    //sw.WriteLine("--------------------------------------------------------------------------------------------------------------------------------|");
                    sw.Write(" ");
                    sw.Write(report.StringFormatWithoutPipe(" ", 34, 2));
                    sw.Write(report.StringFormatWithoutPipe("Total".ToString(), 11, 2));
                    sw.Write(report.StringFormatWithoutPipe("", 16, 2));
                    sw.Write(report.StringFormatWithoutPipe(report.DecimalformatForWeight(dTotal.ToString()), 28, 1));
                    sw.WriteLine(" ");
                    //sw.WriteLine("");
                    dTotal = 0;
                    //sw.WriteLine("--------------------------------------------------------------------------------------------------------------------------------|");
                }
                sw.WriteLine("---------------------------------------------------------------------------------------------------------------------|");
                sw.Write(" ");
                sw.Write(report.StringFormatWithoutPipe(" ", 34, 2));
                sw.Write(report.StringFormatWithoutPipe("Grand Total".ToString(), 11, 2));
                sw.Write(report.StringFormatWithoutPipe("", 16, 2));
                sw.Write(report.StringFormatWithoutPipe(report.DecimalformatForWeight(gTotal.ToString()), 28, 1));
                sw.WriteLine("");
                sw.WriteLine("---------------------------------------------------------------------------------------------------------------------|");
                sw.WriteLine((char)12);
            }
            catch (Exception ex)
            {
                AuditLog.WriteError(ex.Message);
            }
        }
예제 #24
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sw"></param>
        /// <param name="entity"></param>
        public void DateWiseCommodityReceiptReport(StreamWriter sw, CommonEntity entity)
        {
            int     count           = 10;
            var     dateList        = entity.dataSet.Tables[0].DefaultView.ToTable(true, "Commodity");
            int     i               = 1;
            string  ackNo           = string.Empty;
            string  fromWhomRcd     = string.Empty;
            bool    isDataAvailable = false;
            decimal Qty             = 0;
            int     Bags            = 0;

            count = 11;
            foreach (DataRow date in dateList.Rows)
            {
                isDataAvailable = true;
                Bags            = 0;
                Qty             = 0;
                string ackNoNext = string.Empty;
                AddHeader(sw, entity);
                DataRow[] data = entity.dataSet.Tables[0].Select("Commodity='" + date["Commodity"] + "'");
                foreach (DataRow row in data)
                {
                    if (count >= 50)
                    {
                        //Add header again
                        count = 11;
                        sw.WriteLine("------------------------------------------------------------------------------------------------------------------------------------------------------------------|");
                        sw.WriteLine((char)12);
                        AddHeader(sw, entity);
                    }
                    ackNoNext   = row["Ackno"].ToString();
                    fromWhomRcd = Convert.ToString(row["RecdFrom"]).Trim();

                    sw.Write(report.StringFormat(i.ToString(), 4, 2));
                    sw.Write(report.StringFormat(ackNoNext, 11, 1));
                    sw.Write(report.StringFormat(row["Date"].ToString(), 10, 1));
                    sw.Write(report.StringFormat(row["Commodity"].ToString(), 16, 2));
                    sw.Write(report.StringFormat(row["Bags_No"].ToString(), 8, 1));
                    sw.Write(report.StringFormat(row["Quantity"].ToString(), 17, 1));
                    sw.Write(report.StringFormat(fromWhomRcd, 21, 2));
                    sw.Write(report.StringFormat(row["Lorryno"].ToString(), 11, 1));
                    sw.Write(report.StringFormat(row["TruckMemoNo"].ToString(), 15, 1));
                    sw.Write(report.StringFormat(row["Truckmemodate"].ToString(), 11, 1));
                    sw.Write(report.StringFormat(row["Orderno"].ToString(), 11, 2));
                    sw.Write(report.StringFormat("", 8, 1));
                    sw.Write(report.StringFormat("", 7, 1));
                    sw.WriteLine("");
                    Bags += !string.IsNullOrEmpty(Convert.ToString(row["Bags_No"])) ? Convert.ToInt32(row["Bags_No"].ToString()) : 0;
                    Qty  += !string.IsNullOrEmpty(Convert.ToString(row["Quantity"])) ? Convert.ToDecimal(row["Quantity"].ToString()) : 0;
                    i     = i + 1;
                    count++;
                }
                sw.WriteLine("------------------------------------------------------------------------------------------------------------------------------------------------------------------|");
                sw.Write(report.StringFormat("", 4, 2));
                sw.Write(report.StringFormat("  Total ", 11, 1));
                sw.Write(report.StringFormatWithoutPipe(" ", 10, 1));
                sw.Write(report.StringFormatWithoutPipe(" ", 16, 2));
                sw.Write(report.StringFormatWithoutPipe(Bags.ToString(), 8, 1));
                sw.Write(report.StringFormatWithoutPipe(Qty.ToString(), 17, 1));
                sw.WriteLine(" ");
                sw.WriteLine("------------------------------------------------------------------------------------------------------------------------------------------------------------------|");
                //Total

                sw.WriteLine((char)12);
            }
            if (!isDataAvailable)
            {
                sw.WriteLine("------------------------------------------------------------------------------------------------------------------------------------------------------------------|");
                sw.WriteLine((char)12);
            }
        }
예제 #25
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sw"></param>
        /// <param name="entity"></param>
        public void TruckToRegionWiseReport(StreamWriter sw, CommonEntity entity)
        {
            int count = 10;

            int     i               = 1;
            string  doNo            = string.Empty;
            string  fromWhomRcd     = string.Empty;
            bool    isDataAvailable = false;
            decimal Total           = 0;
            decimal GrandTotal      = 0;
            int     pageno          = 1;

            count = 8;
            bool isfirst = true;

            try
            {
                // dateList = entity.dataSet.Tables[0].DefaultView.ToTable(true, new string[] { "Coop", "Comodity" });
                var dateList = entity.dataSet.Tables[0].DefaultView.ToTable(true, "DepositorName");
                AddHeader(sw, entity, pageno);
                foreach (DataRow depdata in dateList.Rows)
                {
                    Total           = 0;
                    GrandTotal      = 0;
                    isDataAvailable = true;
                    isfirst         = true;
                    string PackingType = string.Empty;
                    string depositor   = string.Empty;
                    depositor = Convert.ToString(depdata["DepositorName"]);
                    DataRow[] data = entity.dataSet.Tables[0].Select("DepositorName='" + depositor + "'");
                    var       distinctCommodity = report.ConvertDataRowToTable(data, entity.dataSet.Tables[0]).DefaultView.ToTable(true, "ITDescription");

                    foreach (DataRow item in distinctCommodity.Rows)
                    {
                        Total = 0;
                        DataRow[] ndata = entity.dataSet.Tables[0].Select("DepositorName='" + depositor + "' and ITDescription='" + Convert.ToString(item["ITDescription"]) + "'");
                        foreach (DataRow row in ndata)
                        {
                            if (count >= 50)
                            {
                                //Add header again
                                pageno++;
                                count = 8;
                                sw.WriteLine("-------------------------------------------------------------------------------------------------------------------------------------------");
                                sw.WriteLine((char)12);
                                AddHeader(sw, entity, pageno);
                            }
                            PackingType = row["PBWeight"].ToString(); //PBWeight
                            sw.Write(report.StringFormatWithoutPipe(i.ToString(), 4, 2));
                            sw.Write(report.StringFormatWithoutPipe(row["STNo"].ToString(), 11, 2));
                            sw.Write(report.StringFormatWithoutPipe(report.FormatDirectDate(row["STDate"].ToString()), 10, 2) + "  ");
                            sw.Write(report.StringFormatWithoutPipe(isfirst == true ? row["DepositorName"].ToString() : " ", 20, 2));
                            sw.Write(report.StringFormatWithoutPipe(isfirst == true ? row["RGNAME"].ToString() : " ", 15, 2));
                            sw.Write(report.StringFormatWithoutPipe(row["ITDescription"].ToString(), 15, 1));
                            sw.Write(report.StringFormatWithoutPipe(row["SCName"].ToString(), 11, 2));
                            sw.Write(report.StringFormatWithoutPipe(row["NoPacking"].ToString(), 6, 1));
                            sw.Write(report.StringFormatWithoutPipe(PackingType.ToUpper() == "NOS" ? row["Nkgs"].ToString() : report.DecimalformatForWeight(row["Nkgs"].ToString()), 15, 1));
                            sw.Write(report.StringFormatWithoutPipe(row["LNo"].ToString(), 21, 2));
                            sw.WriteLine("");
                            Total += !string.IsNullOrEmpty(Convert.ToString(row["Nkgs"])) ? Convert.ToDecimal(row["Nkgs"].ToString()) : 0;
                            i      = i + 1;
                            count++;
                            isfirst = false;
                        }
                        sw.Write(report.StringFormatWithoutPipe("", 4, 1));
                        sw.Write(report.StringFormatWithoutPipe("", 11, 2));
                        sw.Write(report.StringFormatWithoutPipe("", 10, 2) + "  ");
                        sw.Write(report.StringFormatWithoutPipe(" ", 20, 2));
                        sw.Write(report.StringFormatWithoutPipe(" ", 15, 2));
                        sw.Write(report.StringFormatWithoutPipe("", 10, 1));
                        sw.Write(report.StringFormatWithoutPipe("Total", 16, 1));
                        sw.Write(report.StringFormatWithoutPipe("", 6, 2));
                        sw.Write(report.StringFormatWithoutPipe(report.DecimalformatForWeight(Total.ToString()), 15, 1));
                        sw.WriteLine("");
                        count++;
                        GrandTotal += Total;
                    }

                    sw.Write(report.StringFormatWithoutPipe("", 4, 1));
                    sw.Write(report.StringFormatWithoutPipe("", 11, 2));
                    sw.Write(report.StringFormatWithoutPipe("", 10, 2) + "  ");
                    sw.Write(report.StringFormatWithoutPipe(" ", 20, 2));
                    sw.Write(report.StringFormatWithoutPipe(" ", 15, 2));
                    sw.Write(report.StringFormatWithoutPipe("", 10, 1));
                    sw.Write(report.StringFormatWithoutPipe("Grand Total", 16, 1));
                    sw.Write(report.StringFormatWithoutPipe("", 6, 2));
                    sw.Write(report.StringFormatWithoutPipe(report.DecimalformatForWeight(GrandTotal.ToString()), 15, 1));
                    sw.WriteLine("");
                    count++;
                }
                if (!isDataAvailable)
                {
                    sw.WriteLine("-------------------------------------------------------------------------------------------------------------------------------------------");
                    sw.WriteLine((char)12);
                }
            }
            catch (Exception ex)
            {
                AuditLog.WriteError(ex.Message);
            }
        }
예제 #26
0
        /// <summary>
        /// Add header for document receipt
        /// </summary>
        /// <param name="streamWriter">Stream writer to write the text file.</param>
        /// <param name="truckMemoList"></param>
        /// <param name="isDuplicate"></param>
        public void AddDocHeaderForTruckMemo(StreamWriter streamWriter, DocumentStockTransferDetails truckMemoList, bool isDuplicate = false)
        {
            streamWriter.WriteLine("|----------------------------------------------------------------------------------------------------------|");
            streamWriter.WriteLine("|                                                                                                          |");
            streamWriter.WriteLine("|                                                                                                          |");
            streamWriter.WriteLine("|                                       TAMILNADU CIVIL SUPPLIES CORPORATION                               |");
            streamWriter.Write("|                                           ");
            streamWriter.Write(report.StringFormatWithoutPipe("REGION : ", 9, 1));
            streamWriter.Write(report.StringFormat(truckMemoList.RegionName, 53, 2));
            streamWriter.WriteLine("");
            streamWriter.WriteLine("|                                                                                                          |");
            streamWriter.WriteLine("|                                                                                                          |");
            if (isDuplicate)
            {
                streamWriter.WriteLine("|                                      STOCK ISSUE TRUCK MEMO            DUPLICATE COPY                    |");
            }
            else
            {
                streamWriter.WriteLine("|                                      STOCK ISSUE TRUCK MEMO                                              |");
            }
            streamWriter.WriteLine("|----------------------------------------------------------------------------------------------------------|");
            streamWriter.Write("|TRUCK MEMO NO:");
            streamWriter.Write(report.StringFormatWithoutPipe(truckMemoList.STNo, 21, 2));
            streamWriter.Write("ALLOTMENT/RELEASE ORDER: ");
            streamWriter.Write(report.StringFormatWithoutPipe(truckMemoList.RNo, 12, 2));
            streamWriter.Write("MOVE. ORDER NO: ");
            streamWriter.Write(report.StringFormatWithoutPipe(truckMemoList.MNo, 15, 2));
            streamWriter.Write("|");
            streamWriter.WriteLine(" ");

            streamWriter.Write("|              DATE:");
            streamWriter.Write(report.StringFormatWithoutPipe(report.FormatDate(truckMemoList.STDate.ToString()), 21, 2));
            streamWriter.Write(report.StringFormatWithoutPipe("TIME: ", 25, 1));
            streamWriter.Write(report.StringFormatWithoutPipe(report.GetCurrentTime(DateTime.Now), 16, 2));
            streamWriter.Write("DATE:");
            streamWriter.Write(report.StringFormatWithoutPipe(report.FormatDate(truckMemoList.RDate.ToString()), 16, 2));
            streamWriter.Write("|");
            streamWriter.WriteLine(" ");

            streamWriter.Write("|ISSUING GODOWN   :");
            streamWriter.Write(report.StringFormatWithoutPipe(truckMemoList.GodownName, 30, 2));
            streamWriter.Write("RECEIVER NAME: ");
            streamWriter.Write(report.StringFormatWithoutPipe(truckMemoList.ReceivingName, 41, 2));
            streamWriter.Write("|");
            streamWriter.WriteLine(" ");

            streamWriter.WriteLine("|----------------------------------------------------------------------------------------------------------|");
            streamWriter.WriteLine("||--------------------------------------------------------------------------------------------------------||");
            streamWriter.WriteLine("||SNo |STACK NO   |COMMODITY           | SCHEME       |UNIT WEIGHT  |NO.OF |  Gross        NET   |% OF    ||");
            streamWriter.WriteLine("||    |           |                    |              |             |  UNIT|   WEIGHT in Kgs/NOs |MOISTURE||");
            streamWriter.WriteLine("||--------------------------------------------------------------------------------------------------------||");
        }
예제 #27
0
        public void WriteTruckMemoForDateWise(StreamWriter sw, CommonEntity entity)
        {
            int iCount       = 10;
            var distinctDate = entity.dataSet.Tables[0].DefaultView.ToTable(true, "Issue_Date");
            //Date wise DO report
            int    i       = 1;
            string sIssuer = string.Empty;
            string sDoNo   = string.Empty;

            foreach (DataRow dateValue in distinctDate.Rows)
            {
                iCount = 11;
                bool      CheckRepeatValue = false;
                string    sDoNo1           = string.Empty;
                DataRow[] datas            = entity.dataSet.Tables[0].Select("Issue_Date='" + dateValue["Issue_Date"] + "'");
                AddHeader(sw, Convert.ToString(dateValue["Issue_Date"]));
                foreach (DataRow dr in datas)
                {
                    if (iCount >= 50)
                    {
                        //Add header again
                        iCount = 11;
                        sw.WriteLine("------------------------------------------------------------------------------------------------------------------------------------------------");
                        sw.WriteLine((char)12);
                        AddHeader(sw, Convert.ToString(dateValue["Issue_Date"]));
                    }
                    sDoNo1 = dr["Truck_Memono"].ToString();
                    if (sDoNo == sDoNo1)
                    {
                        CheckRepeatValue = true;
                    }
                    else
                    {
                        CheckRepeatValue = false;
                        sDoNo            = sDoNo1;
                    }

                    sIssuer = Convert.ToString(dr["To_Whom_Issued"]).Trim();
                    sw.Write(report.StringFormatWithoutPipe(CheckRepeatValue == false ? i.ToString() : " ", 4, 2));
                    sw.Write(report.StringFormatWithoutPipe(CheckRepeatValue == false ? dr["Truck_Memono"].ToString() : " ", 12, 2));
                    sw.Write(report.StringFormatWithoutPipe(CheckRepeatValue == false ? dr["Mono"].ToString() : " ", 15, 2));
                    sw.Write(report.StringFormatWithoutPipe(CheckRepeatValue == false ? dr["RoNo"].ToString() : " ", 11, 2));
                    sw.Write(report.StringFormatWithoutPipe(CheckRepeatValue == false ? sIssuer : " ", 31, 2));
                    sw.Write(report.StringFormatWithoutPipe(dr["Scheme"].ToString(), 10, 2));
                    sw.Write(report.StringFormatWithoutPipe(dr["Stackno"].ToString(), 10, 2));
                    sw.Write(report.StringFormatWithoutPipe(dr["NoBags"].ToString(), 7, 1));
                    sw.Write(report.StringFormatWithoutPipe(dr["Commodity"].ToString(), 25, 2));
                    sw.Write(report.StringFormatWithoutPipe(report.DecimalformatForWeight(dr["NetWt"].ToString()), 9, 1));
                    sw.WriteLine("");
                    iCount = iCount + 1;
                    i      = CheckRepeatValue == false ? i + 1 : i;
                }
                sw.WriteLine("------------------------------------------------------------------------------------------------------------------------------------------------");
                sw.WriteLine((char)12);
            }
        }
예제 #28
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="sw"></param>
 /// <param name="entity"></param>
 public void DateWiseCommodityWiseGUGRReport(StreamWriter sw, CommonEntity entity)
 {
     try
     {
         int     count    = 8;
         var     dateList = entity.dataSet.Tables[0].DefaultView.ToTable(true, "Date");
         int     pageNo   = 1;
         decimal qty      = 0;
         int     Bags     = 0;
         AddHeader(sw, entity, pageNo);
         int i = 1;
         foreach (DataRow nrow in dateList.Rows)
         {
             DataRow[] drdata = entity.dataSet.Tables[0].Select("Date='" + Convert.ToString(nrow["Date"]) + "'");
             foreach (DataRow row in drdata)
             {
                 if (count >= 50)
                 {
                     //Add header again
                     pageNo++;
                     count = 8;
                     sw.WriteLine("--------------------------------------------------------------------------------------------------------");
                     sw.WriteLine((char)12);
                     AddHeader(sw, entity, pageNo);
                 }
                 sw.Write("");
                 sw.Write(report.StringFormatWithoutPipe(row["Ackno"].ToString(), 10, 2));
                 sw.Write(report.StringFormatWithoutPipe(row["Date"].ToString(), 10, 2));
                 sw.Write(report.StringFormatWithoutPipe(row["Commodity"].ToString(), 16, 2));
                 sw.Write(report.StringFormatWithoutPipe("0", 8, 2));
                 sw.Write(report.StringFormatWithoutPipe(row["Quantity"].ToString(), 9, 2));
                 sw.Write(report.StringFormatWithoutPipe(row["stackno"].ToString(), 10, 2));
                 //  sw.Write(report.StringFormatWithoutPipe(report.DecimalformatForWeight(row["Quantity"].ToString()), 11, 1) + "  ");
                 sw.Write(report.StringFormatWithoutPipe(row["Year"].ToString(), 5, 1));
                 sw.Write(report.StringFormatWithoutPipe(row["Commodity"].ToString(), 16, 2));
                 sw.WriteLine("");
                 count = count + 1;
                 //  qty += !string.IsNullOrEmpty(row["Quantity"].ToString()) ? Convert.ToDecimal(row["Quantity"]) : 0;
                 Bags += !string.IsNullOrEmpty(Convert.ToString(row["Quantity"])) ? Convert.ToInt32(row["Quantity"].ToString()) : 0;
                 i++;
             }
             //  count = count + 1;
         }
         sw.WriteLine("--------------------------------------------------------------------------------------------------------");
         sw.Write("");
         sw.Write(report.StringFormatWithoutPipe("", 10, 2));
         sw.Write(report.StringFormatWithoutPipe("Total", 10, 2));
         sw.Write(report.StringFormatWithoutPipe("-", 16, 2));
         sw.Write(report.StringFormatWithoutPipe("-", 8, 2));
         sw.Write(report.StringFormatWithoutPipe((Convert.ToString(Bags)), 9, 2));
         // sw.Write(report.StringFormatWithoutPipe(report.DecimalformatForWeight(Convert.ToString(qty)), 11, 1) + "  ");
         sw.Write(report.StringFormatWithoutPipe("-", 14, 2));
         sw.Write(report.StringFormatWithoutPipe("-", 101, 2));
         sw.WriteLine("");
         sw.WriteLine("--------------------------------------------------------------------------------------------------------");
         sw.WriteLine((char)12);
     }
     catch (Exception ex)
     {
         AuditLog.WriteError(ex.Message + " " + ex.StackTrace);
     }
 }