Esempio n. 1
0
 /// <summary>
 /// Get the godown wise daily statement for a items.
 /// </summary>
 /// <param name="dataSet"></param>
 /// <param name="RegionCode">region code</param>
 /// <returns></returns>
 public List <DailyStockStatment> GetGodownwiseStock(DataSet dataSet, string RegionCode, string ItemCode)
 {
     try
     {
         List <DailyStockStatment> dailyStockStatments = new List <DailyStockStatment>();
         if (dataSet.Tables.Count > 2)
         {
             DataRow[] dataRows = dataSet.Tables[2].Select("RGCODE='" + RegionCode + "' AND ItemCode='" + ItemCode + "'");
             foreach (DataRow dr in dataRows)
             {
                 DailyStockStatment dailyStock = new DailyStockStatment
                 {
                     ItemCode       = Convert.ToString(dr["ItemCode"]),
                     Name           = Convert.ToString(dr["TNCSName"]),
                     RegionCode     = Convert.ToString(dr["RGCODE"]),
                     OpeningBalance = Convert.ToString(dr["OpeningBalance"]),
                     ClosingBalance = Convert.ToString(dr["ClosingBalance"]),
                     PhycialBalance = Convert.ToString(dr["PhycialBalance"]),
                     CSBalance      = Convert.ToString(dr["CSBalance"]),
                     Shortage       = Convert.ToString(dr["Shortage"]),
                     TotalReceipt   = Convert.ToString(dr["TotalReceipt"]),
                     IssueSales     = Convert.ToString(dr["IssueSales"]),
                     IssueOthers    = Convert.ToString(dr["IssueOthers"]),
                     LastUpdated    = Convert.ToDateTime(dr["LastUpdated"])
                 };
                 dailyStockStatments.Add(dailyStock);
             }
         }
         return(dailyStockStatments);
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Get the daily stock statement .
 /// </summary>
 /// <param name="dataSet">dataset for all table. item, region and godown wise data</param>
 /// <returns></returns>
 public List <DailyStockStatment> GetDailyStockStatments(DataSet dataSet)
 {
     try
     {
         List <DailyStockStatment> dailyStockStatments = new List <DailyStockStatment>();
         if (dataSet.Tables.Count > 0)
         {
             foreach (DataRow dr in dataSet.Tables[0].Rows)
             {
                 DailyStockStatment dailyStock = new DailyStockStatment
                 {
                     ItemCode       = Convert.ToString(dr["ItemCode"]),
                     Name           = Convert.ToString(dr["ITDescription"]),
                     OpeningBalance = Convert.ToString(dr["OpeningBalance"]),
                     ClosingBalance = Convert.ToString(dr["ClosingBalance"]),
                     PhycialBalance = Convert.ToString(dr["PhycialBalance"]),
                     CSBalance      = Convert.ToString(dr["CSBalance"]),
                     Shortage       = Convert.ToString(dr["Shortage"]),
                     TotalReceipt   = Convert.ToString(dr["TotalReceipt"]),
                     IssueSales     = Convert.ToString(dr["IssueSales"]),
                     IssueOthers    = Convert.ToString(dr["IssueOthers"]),
                     LastUpdated    = Convert.ToDateTime(dr["LastUpdated"]),
                     ListItems      = GetRegionwiseStock(dataSet, Convert.ToString(dr["ItemCode"]))
                 };
                 dailyStockStatments.Add(dailyStock);
             }
         }
         return(dailyStockStatments);
     }
     catch (Exception ex)
     {
         throw;
     }
 }