예제 #1
0
        public bool GetUpdatePriceCalculation(DataTable dtPrice, double USD, double Transport, double Others, DateTime dtDate, string CreatedBy,
                                              string ModifiedBy, int TypeOfOperation, decimal MandyTax, decimal BMar, decimal insurance, decimal localtax, decimal addUpPrice)
        {
            DataTable dtTemp = new DataTable();

            dtTemp = dtPrice.Copy();
            dtTemp.Columns.Add("POPriceMB");
            dtTemp.Columns.Add("FOBPrice");
            dtTemp.Columns.Add("USA_Sea");
            dtTemp.Columns.Add("USA_Air");
            dtTemp.Columns.Add("USA_Air_West");
            dtTemp.Columns.Add("Europe_Sea");
            dtTemp.Columns.Add("Europe_Air");
            dtTemp.Columns.Add("Europe_Air_West");
            dtTemp.Columns.Add("India_Price");
            dtTemp.Columns.Add("Non_organic_India");
            dtTemp.Columns.Add("Non_organic_USA");
            for (int i = 0; i < dtPrice.Rows.Count; i++)
            {
                double price = 0;
                if (!string.IsNullOrEmpty(dtTemp.Rows[i]["PriceMB"].ToString()))
                {
                    price = Convert.ToDouble(dtTemp.Rows[i]["PriceMB"].ToString().Trim());
                }
                else
                {
                    price = 0;
                }
                dtTemp.Rows[i]["POPriceMB"] = price + Others;
                double pric = price + Others;
                double FOB  = ((((pric * (1 + (Convert.ToDouble(MandyTax) / 100))) + Transport) / (1 - (Convert.ToDouble(BMar) / 100))) / USD);

                dtTemp.Rows[i]["FOBPrice"]        = Math.Round(FOB, 1);
                dtTemp.Rows[i]["USA_Sea"]         = Math.Round(FOB + 2, 1);
                dtTemp.Rows[i]["USA_Air"]         = Math.Round(FOB + 7, 1);
                dtTemp.Rows[i]["USA_Air_West"]    = Math.Round(FOB + 10, 1);
                dtTemp.Rows[i]["Europe_Sea"]      = Math.Round((FOB + 2) * (1 + (Convert.ToDouble(insurance) / 100)), 1);
                dtTemp.Rows[i]["Europe_Air"]      = Math.Round((FOB + 7) * (1 + (Convert.ToDouble(insurance) / 100)), 1);
                dtTemp.Rows[i]["Europe_Air_West"] = Math.Round((FOB + 10) * (1 + (Convert.ToDouble(insurance) / 100)), 1);
                double lt     = (1 - (Convert.ToDouble(localtax) / 100));
                double iPrice = (((pric * (1 + (Convert.ToDouble(MandyTax) / 100))) + Transport) / (1 - (Convert.ToDouble(BMar) / 100))) / lt;
                dtTemp.Rows[i]["India_Price"] = Math.Round(iPrice, 1);
                double NonOrgInd = ((((price + 25) * 1.025) + 35) + 50);
                dtTemp.Rows[i]["Non_organic_India"] = Math.Round(NonOrgInd, 1);
                dtTemp.Rows[i]["Non_organic_USA"]   = Math.Round(NonOrgInd / USD, 1);
            }
            return(Product_DL.tblProductPrice_INSandUPD(dtTemp, dtDate, USD, Transport, Others, CreatedBy, ModifiedBy, TypeOfOperation, MandyTax, BMar, insurance, localtax, addUpPrice));
        }
예제 #2
0
 public DataTable GetProductDetailsNew()
 {
     return(Product_DL.GetProductDetailsNew());
 }
예제 #3
0
 public DataTable GetMaxHistoryIDSupplierProducts(string ProductID)
 {
     return(Product_DL.GetMaxHistoryIDSupplierProducts(ProductID));
 }
예제 #4
0
 public DataTable GetAllProducDetails()
 {
     return(Product_DL.GetAllProducDetails());
 }
        public DataTable BuildPlantation(int Year, int SeasonID, int ProdcutID)
        {
            DataTable dtProduct = new DataTable();

            if (ProdcutID > 0)
            {
                dtProduct = Product_DL.GetProductDetails(ProdcutID);
            }
            else
            {
                dtProduct = Product_DL.GetProductDetailsbySeason(SeasonID);
            }
            DataTable dtSeason = CategoryProduct_DL.GetSeasonDetails(SeasonID);

            DataTable NewPlantation = new DataTable();

            NewPlantation.Columns.Add("FarmerId");
            NewPlantation.Columns.Add("FarmerCode");
            NewPlantation.Columns.Add("FirstName");
            NewPlantation.Columns.Add("FarmerRegNumber");
            NewPlantation.Columns.Add("TotalAreaInHectares");
            NewPlantation.Columns.Add("FarmID");
            NewPlantation.Columns.Add("AreaCode");
            NewPlantation.Columns.Add("PlotArea");
            NewPlantation.Columns.Add("SeasonID");

            if (ProdcutID == 0)
            {
                foreach (DataRow dr in dtProduct.Rows)
                {
                    NewPlantation.Columns.Add("ProductId" + "_" + dr["ProductId"]);
                    NewPlantation.Columns.Add("PlantationId" + "_" + dr["ProductId"]);
                    NewPlantation.Columns.Add("PlantationArea" + "_" + dr["ProductId"]);
                    NewPlantation.Columns.Add("PlantationDate" + "_" + dr["ProductId"]);
                    NewPlantation.Columns.Add("FirstHarvestDate" + "_" + dr["ProductId"]);
                    NewPlantation.Columns.Add("FirstHerbaga" + "_" + dr["ProductId"]);
                    NewPlantation.Columns.Add("FirstDistillationDate" + "_" + dr["ProductId"]);
                    NewPlantation.Columns.Add("FirstDistillationUnitNO" + "_" + dr["ProductId"]);
                    NewPlantation.Columns.Add("FirstProductQuantity" + "_" + dr["ProductId"]);
                    NewPlantation.Columns.Add("SecondHarvestDate" + "_" + dr["ProductId"]);
                    NewPlantation.Columns.Add("SecondHerbaga" + "_" + dr["ProductId"]);
                    NewPlantation.Columns.Add("SecondDistillationDate" + "_" + dr["ProductId"]);
                    NewPlantation.Columns.Add("SecondDistillationUnitNO" + "_" + dr["ProductId"]);
                    NewPlantation.Columns.Add("SecondProductQuantity" + "_" + dr["ProductId"]);
                    NewPlantation.Columns.Add("TotalProductQuantity" + "_" + dr["ProductId"]);
                }
            }
            else
            {
                NewPlantation.Columns.Add("ProductId");
                NewPlantation.Columns.Add("PlantationId");
                NewPlantation.Columns.Add("PlantationArea");
                NewPlantation.Columns.Add("PlantationDate");
                NewPlantation.Columns.Add("FirstHarvestDate");
                NewPlantation.Columns.Add("FirstHerbaga");
                NewPlantation.Columns.Add("FirstDistillationDate");
                NewPlantation.Columns.Add("FirstDistillationUnitNO");
                NewPlantation.Columns.Add("FirstProductQuantity");
                NewPlantation.Columns.Add("SecondHarvestDate");
                NewPlantation.Columns.Add("SecondHerbaga");
                NewPlantation.Columns.Add("SecondDistillationDate");
                NewPlantation.Columns.Add("SecondDistillationUnitNO");
                NewPlantation.Columns.Add("SecondProductQuantity");
                NewPlantation.Columns.Add("TotalProductQuantity");
            }
            int count = 0, rowcount = 0;

            foreach (DataRow drproduct in dtProduct.Rows)
            {
                DataTable dtplantation = FarmPlantation_DL.BuildPlantation(Year, SeasonID, Convert.ToInt32(drproduct["ProductId"].ToString()));
                rowcount = 0;
                foreach (DataRow drplantation in dtplantation.Rows)
                {
                    DataRow newdr    = NewPlantation.NewRow();
                    DataRow drseason = dtSeason.Rows[0];
                    newdr["FarmerId"]            = drplantation["FarmerId"];
                    newdr["FarmerCode"]          = drplantation["FarmerCode"];
                    newdr["FirstName"]           = drplantation["FirstName"];
                    newdr["FarmerRegNumber"]     = drplantation["FarmerRegNumber"];
                    newdr["TotalAreaInHectares"] = drplantation["TotalAreaInHectares"];
                    newdr["FarmID"]   = drplantation["FarmID"];
                    newdr["AreaCode"] = drplantation["AreaCode"];
                    newdr["PlotArea"] = drplantation["PlotArea"];
                    newdr["SeasonID"] = SeasonID;
                    if (ProdcutID > 0)
                    {
                        newdr["ProductId"]                = ProdcutID;
                        newdr["PlantationId"]             = drplantation["PlantationId"];
                        newdr["PlantationArea"]           = drplantation["PlantationArea"];
                        newdr["PlantationDate"]           = drplantation["PlantationDate"];           //Convert.ToDateTime(drseason["StartDate"].ToString()).ToShortDateString();
                        newdr["FirstHarvestDate"]         = drplantation["FirstHarvestDate"];         //(Convert.ToDateTime(drseason["StartDate"].ToString()).AddDays(100)).ToShortDateString();
                        newdr["FirstHerbaga"]             = drplantation["FirstHerbaga"];             //"0";
                        newdr["FirstDistillationDate"]    = drplantation["FirstDistillationDate"];    //(Convert.ToDateTime(drseason["StartDate"].ToString()).AddDays(101)).ToShortDateString();
                        newdr["FirstDistillationUnitNO"]  = drplantation["FirstDistillationUnitNO"];  //"0";
                        newdr["FirstProductQuantity"]     = drplantation["FirstProductQuantity"];     //"0";
                        newdr["SecondHarvestDate"]        = drplantation["SecondHarvestDate"];        //(Convert.ToDateTime(drseason["StartDate"].ToString()).AddDays(145)).ToShortDateString(); ;
                        newdr["SecondHerbaga"]            = drplantation["SecondHerbaga"];            //"0";
                        newdr["SecondDistillationDate"]   = drplantation["SecondDistillationDate"];   //(Convert.ToDateTime(drseason["StartDate"].ToString()).AddDays(146)).ToShortDateString(); ;
                        newdr["SecondDistillationUnitNO"] = drplantation["SecondDistillationUnitNO"]; //"0";
                        newdr["SecondProductQuantity"]    = drplantation["SecondProductQuantity"];    //"0";
                        newdr["TotalProductQuantity"]     = drplantation["TotalProductQuantity"];     //"0";
                    }
                    else
                    {
                        if (count == 0)
                        {
                            newdr["ProductId" + "_" + drproduct["ProductId"]]                = drproduct["ProductId"];
                            newdr["PlantationId" + "_" + drproduct["ProductId"]]             = drplantation["PlantationId"];             //"0";
                            newdr["PlantationArea" + "_" + drproduct["ProductId"]]           = drplantation["PlantationArea"];           //"0";
                            newdr["PlantationDate" + "_" + drproduct["ProductId"]]           = drplantation["PlantationDate"];           //Convert.ToDateTime(drseason["StartDate"].ToString()).ToShortDateString();
                            newdr["FirstHarvestDate" + "_" + drproduct["ProductId"]]         = drplantation["FirstHarvestDate"];         // (Convert.ToDateTime(drseason["StartDate"].ToString()).AddDays(100)).ToShortDateString();
                            newdr["FirstHerbaga" + "_" + drproduct["ProductId"]]             = drplantation["FirstHerbaga"];             // "0";
                            newdr["FirstDistillationDate" + "_" + drproduct["ProductId"]]    = drplantation["FirstDistillationDate"];    // (Convert.ToDateTime(drseason["StartDate"].ToString()).AddDays(101)).ToShortDateString();
                            newdr["FirstDistillationUnitNO" + "_" + drproduct["ProductId"]]  = drplantation["FirstDistillationUnitNO"];  // "0";
                            newdr["FirstProductQuantity" + "_" + drproduct["ProductId"]]     = drplantation["FirstProductQuantity"];     // "0";
                            newdr["SecondHarvestDate" + "_" + drproduct["ProductId"]]        = drplantation["SecondHarvestDate"];        // (Convert.ToDateTime(drseason["StartDate"].ToString()).AddDays(145)).ToShortDateString(); ;
                            newdr["SecondHerbaga" + "_" + drproduct["ProductId"]]            = drplantation["SecondHerbaga"];            // "0";
                            newdr["SecondDistillationDate" + "_" + drproduct["ProductId"]]   = drplantation["SecondDistillationDate"];   // (Convert.ToDateTime(drseason["StartDate"].ToString()).AddDays(146)).ToShortDateString(); ;
                            newdr["SecondDistillationUnitNO" + "_" + drproduct["ProductId"]] = drplantation["SecondDistillationUnitNO"]; // "0";
                            newdr["SecondProductQuantity" + "_" + drproduct["ProductId"]]    = drplantation["SecondProductQuantity"];    // "0";
                            newdr["TotalProductQuantity" + "_" + drproduct["ProductId"]]     = drplantation["TotalProductQuantity"];     // "0";
                        }
                        if (count > 0)
                        {
                            if (rowcount < NewPlantation.Rows.Count)
                            {
                                NewPlantation.Rows[rowcount]["ProductId" + "_" + drproduct["ProductId"]]                = drproduct["ProductId"];
                                NewPlantation.Rows[rowcount]["PlantationId" + "_" + drproduct["ProductId"]]             = drplantation["PlantationId"];             //"0";
                                NewPlantation.Rows[rowcount]["PlantationArea" + "_" + drproduct["ProductId"]]           = drplantation["PlantationArea"];           //"0";
                                NewPlantation.Rows[rowcount]["PlantationDate" + "_" + drproduct["ProductId"]]           = drplantation["PlantationDate"];           //Convert.ToDateTime(drseason["StartDate"].ToString()).ToShortDateString();
                                NewPlantation.Rows[rowcount]["FirstHarvestDate" + "_" + drproduct["ProductId"]]         = drplantation["FirstHarvestDate"];         // (Convert.ToDateTime(drseason["StartDate"].ToString()).AddDays(100)).ToShortDateString();
                                NewPlantation.Rows[rowcount]["FirstHerbaga" + "_" + drproduct["ProductId"]]             = drplantation["FirstHerbaga"];             // "0";
                                NewPlantation.Rows[rowcount]["FirstDistillationDate" + "_" + drproduct["ProductId"]]    = drplantation["FirstDistillationDate"];    // (Convert.ToDateTime(drseason["StartDate"].ToString()).AddDays(101)).ToShortDateString();
                                NewPlantation.Rows[rowcount]["FirstDistillationUnitNO" + "_" + drproduct["ProductId"]]  = drplantation["FirstDistillationUnitNO"];  // "0";
                                NewPlantation.Rows[rowcount]["FirstProductQuantity" + "_" + drproduct["ProductId"]]     = drplantation["FirstProductQuantity"];     // "0";
                                NewPlantation.Rows[rowcount]["SecondHarvestDate" + "_" + drproduct["ProductId"]]        = drplantation["SecondHarvestDate"];        // (Convert.ToDateTime(drseason["StartDate"].ToString()).AddDays(145)).ToShortDateString(); ;
                                NewPlantation.Rows[rowcount]["SecondHerbaga" + "_" + drproduct["ProductId"]]            = drplantation["SecondHerbaga"];            // "0";
                                NewPlantation.Rows[rowcount]["SecondDistillationDate" + "_" + drproduct["ProductId"]]   = drplantation["SecondDistillationDate"];   // (Convert.ToDateTime(drseason["StartDate"].ToString()).AddDays(146)).ToShortDateString(); ;
                                NewPlantation.Rows[rowcount]["SecondDistillationUnitNO" + "_" + drproduct["ProductId"]] = drplantation["SecondDistillationUnitNO"]; // "0";
                                NewPlantation.Rows[rowcount]["SecondProductQuantity" + "_" + drproduct["ProductId"]]    = drplantation["SecondProductQuantity"];    // "0";
                                NewPlantation.Rows[rowcount]["TotalProductQuantity" + "_" + drproduct["ProductId"]]     = drplantation["TotalProductQuantity"];     // "0";
                            }
                        }
                    }
                    if (count == 0)
                    {
                        NewPlantation.Rows.Add(newdr);
                    }
                    rowcount += 1;
                }
                count += 1;
            }

            return(NewPlantation);
        }
예제 #6
0
 public DataTable GetProductDetails(string FarmerID, string Year)
 {
     return(Product_DL.GetProductDetails(FarmerID, Year));
 }
예제 #7
0
 public DataTable GetProductDetails(int ProductID)
 {
     return(Product_DL.GetProductDetails(ProductID));
 }
예제 #8
0
 public DataTable GetProductDetails(int seasonID, int CategoryID)
 {
     return(Product_DL.GetProductDetails(seasonID, CategoryID));
 }
예제 #9
0
 public DataTable GetUpdateProductPrice(string date)
 {
     return(Product_DL.GetUpdateProductPrice(date));
 }
예제 #10
0
 public DataTable GetProductPricebyName(string name, string creditDay)
 {
     return(Product_DL.GetProductPricebyName(name, creditDay));
 }
예제 #11
0
 public DataTable GetProductPricebyBuyer(string creditDay, string BuyerID)
 {
     return(Product_DL.GetProductPricebyBuyer(creditDay, BuyerID));
 }
예제 #12
0
 public DataTable GetProductPricebyName(string name)
 {
     return(Product_DL.GetProductPricebyName(name));
 }
예제 #13
0
 public bool Product_INS_UPT_DEL(int ProductID, string ProductCode, string ProductName, string Description, string ItcHsCode, int CategoryID, string CreatedBy, string ModifiedBy, int typeOperation, string Specification)
 {
     return(Product_DL.Product_INT_UPT_DEL(ProductID, ProductCode, ProductName, Description, ItcHsCode, CategoryID, CreatedBy, ModifiedBy, typeOperation, Specification));
 }
예제 #14
0
 public DataTable GetProductPrice()
 {
     return(Product_DL.GetProductPrice());
 }
예제 #15
0
 public string GetProductName(int productId)
 {
     return(Product_DL.GetProductName(productId));
 }
예제 #16
0
 public DataTable GetProductPrice(int TypeOfOperation)
 {
     return(Product_DL.GetProductPrice(TypeOfOperation));
 }
예제 #17
0
 public List <int> GetSeasonProdIds(int seasonId)
 {
     return(Product_DL.GetSeasonProdIds(seasonId));
 }
예제 #18
0
 public DataTable GetDetailsAllPriceswithDate(int typeofoperation, int Qty, DateTime createdDate)
 {
     return(Product_DL.GetDetailsAllPriceswithDate(typeofoperation, Qty, createdDate));
 }
예제 #19
0
 public DataTable GetProductDetails(string startDate, string endDate, string ProductID)
 {
     return(Product_DL.GetProductDetails(startDate, endDate, ProductID));
 }
예제 #20
0
 public DataTable GetProductCode(int ProductID)
 {
     return(Product_DL.GetProductCode(ProductID));
 }
예제 #21
0
 public DataTable GetProductDetails(string Productvalue)
 {
     return(Product_DL.GetProductDetails(Productvalue));
 }
예제 #22
0
 public DataTable GetDetailsAllPrices(int typeofoperation, int Qty, int productID, DateTime createDate)
 {
     return(Product_DL.GetDetailsAllPrices(typeofoperation, Qty, productID, createDate));
 }
예제 #23
0
 public DataTable GetProductDetailsbySeasonNew(int seasonid)
 {
     return(Product_DL.GetProductDetailsbySeasonNew(seasonid));
 }
        public DataTable BuildNEWPlantation(int Year, int SeasonID, int ProdcutID)
        {
            DataTable dtFarmer  = Farmer_DL.FarmDetails();
            DataTable dtProduct = Product_DL.GetProductDetailsbySeason(SeasonID);
            DataTable dtSeason  = CategoryProduct_DL.GetSeasonDetails(SeasonID);

            DataTable NewPlantation = new DataTable();

            NewPlantation.Columns.Add("FarmerId");
            NewPlantation.Columns.Add("FarmerCode");
            NewPlantation.Columns.Add("FirstName");
            NewPlantation.Columns.Add("FarmerRegNumber");
            NewPlantation.Columns.Add("TotalAreaInHectares");
            NewPlantation.Columns.Add("FarmID");
            NewPlantation.Columns.Add("AreaCode");
            NewPlantation.Columns.Add("PlotArea");
            NewPlantation.Columns.Add("SeasonID");

            if (ProdcutID == 0)
            {
                foreach (DataRow dr in dtProduct.Rows)
                {
                    NewPlantation.Columns.Add("ProductId" + "_" + dr["ProductId"]);
                    NewPlantation.Columns.Add("PlantationId" + "_" + dr["ProductId"]);
                    NewPlantation.Columns.Add("PlantationArea" + "_" + dr["ProductId"]);
                    NewPlantation.Columns.Add("PlantationDate" + "_" + dr["ProductId"]);
                    NewPlantation.Columns.Add("FirstHarvestDate" + "_" + dr["ProductId"]);
                    NewPlantation.Columns.Add("FirstHerbaga" + "_" + dr["ProductId"]);
                    NewPlantation.Columns.Add("FirstDistillationDate" + "_" + dr["ProductId"]);
                    NewPlantation.Columns.Add("FirstDistillationUnitNO" + "_" + dr["ProductId"]);
                    NewPlantation.Columns.Add("FirstProductQuantity" + "_" + dr["ProductId"]);
                    NewPlantation.Columns.Add("SecondHarvestDate" + "_" + dr["ProductId"]);
                    NewPlantation.Columns.Add("SecondHerbaga" + "_" + dr["ProductId"]);
                    NewPlantation.Columns.Add("SecondDistillationDate" + "_" + dr["ProductId"]);
                    NewPlantation.Columns.Add("SecondDistillationUnitNO" + "_" + dr["ProductId"]);
                    NewPlantation.Columns.Add("SecondProductQuantity" + "_" + dr["ProductId"]);
                    NewPlantation.Columns.Add("TotalProductQuantity" + "_" + dr["ProductId"]);
                }
            }
            else
            {
                NewPlantation.Columns.Add("ProductId");
                NewPlantation.Columns.Add("PlantationId");
                NewPlantation.Columns.Add("PlantationArea");
                NewPlantation.Columns.Add("PlantationDate");
                NewPlantation.Columns.Add("FirstHarvestDate");
                NewPlantation.Columns.Add("FirstHerbaga");
                NewPlantation.Columns.Add("FirstDistillationDate");
                NewPlantation.Columns.Add("FirstDistillationUnitNO");
                NewPlantation.Columns.Add("FirstProductQuantity");
                NewPlantation.Columns.Add("SecondHarvestDate");
                NewPlantation.Columns.Add("SecondHerbaga");
                NewPlantation.Columns.Add("SecondDistillationDate");
                NewPlantation.Columns.Add("SecondDistillationUnitNO");
                NewPlantation.Columns.Add("SecondProductQuantity");
                NewPlantation.Columns.Add("TotalProductQuantity");
            }
            int DateCount = 0;

            foreach (DataRow drFarmer in dtFarmer.Rows)
            {
                DataRow newdr    = NewPlantation.NewRow();
                DataRow drseason = dtSeason.Rows[0];
                newdr["FarmerId"]            = drFarmer["FarmerId"];
                newdr["FarmerCode"]          = drFarmer["FarmerCode"];
                newdr["FirstName"]           = drFarmer["FirstName"];
                newdr["FarmerRegNumber"]     = drFarmer["FarmerRegNumber"];
                newdr["TotalAreaInHectares"] = drFarmer["TotalAreaInHectares"];
                newdr["FarmID"]   = drFarmer["FarmID"];
                newdr["AreaCode"] = drFarmer["AreaCode"];
                newdr["PlotArea"] = drFarmer["PlotArea"];
                newdr["SeasonID"] = SeasonID;
                if (ProdcutID > 0)
                {
                    newdr["ProductId"]                = ProdcutID;
                    newdr["PlantationId"]             = "0";
                    newdr["PlantationArea"]           = "0";
                    newdr["PlantationDate"]           = Convert.ToDateTime(drseason["StartDate"].ToString()).AddDays(DateCount).ToShortDateString();
                    newdr["FirstHarvestDate"]         = (Convert.ToDateTime(drseason["StartDate"].ToString()).AddDays(DateCount + 100)).ToShortDateString();
                    newdr["FirstHerbaga"]             = "0";
                    newdr["FirstDistillationDate"]    = (Convert.ToDateTime(drseason["StartDate"].ToString()).AddDays(DateCount + 101)).ToShortDateString();
                    newdr["FirstDistillationUnitNO"]  = "0";
                    newdr["FirstProductQuantity"]     = "0";
                    newdr["SecondHarvestDate"]        = (Convert.ToDateTime(drseason["StartDate"].ToString()).AddDays(DateCount + 145)).ToShortDateString();;
                    newdr["SecondHerbaga"]            = "0";
                    newdr["SecondDistillationDate"]   = (Convert.ToDateTime(drseason["StartDate"].ToString()).AddDays(DateCount + 146)).ToShortDateString();;
                    newdr["SecondDistillationUnitNO"] = "0";
                    newdr["SecondProductQuantity"]    = "0";
                    newdr["TotalProductQuantity"]     = "0";
                }
                else
                {
                    foreach (DataRow dr in dtProduct.Rows)
                    {
                        newdr["ProductId" + "_" + dr["ProductId"]]                = dr["ProductId"];
                        newdr["PlantationId" + "_" + dr["ProductId"]]             = "0";
                        newdr["PlantationArea" + "_" + dr["ProductId"]]           = "0";
                        newdr["PlantationDate" + "_" + dr["ProductId"]]           = Convert.ToDateTime(drseason["StartDate"].ToString()).AddDays(DateCount).ToShortDateString();
                        newdr["FirstHarvestDate" + "_" + dr["ProductId"]]         = (Convert.ToDateTime(drseason["StartDate"].ToString()).AddDays(DateCount + 100)).ToShortDateString();
                        newdr["FirstHerbaga" + "_" + dr["ProductId"]]             = "0";
                        newdr["FirstDistillationDate" + "_" + dr["ProductId"]]    = (Convert.ToDateTime(drseason["StartDate"].ToString()).AddDays(DateCount + 101)).ToShortDateString();
                        newdr["FirstDistillationUnitNO" + "_" + dr["ProductId"]]  = "0";
                        newdr["FirstProductQuantity" + "_" + dr["ProductId"]]     = "0";
                        newdr["SecondHarvestDate" + "_" + dr["ProductId"]]        = (Convert.ToDateTime(drseason["StartDate"].ToString()).AddDays(DateCount + 145)).ToShortDateString();;
                        newdr["SecondHerbaga" + "_" + dr["ProductId"]]            = "0";
                        newdr["SecondDistillationDate" + "_" + dr["ProductId"]]   = (Convert.ToDateTime(drseason["StartDate"].ToString()).AddDays(DateCount + 146)).ToShortDateString();;
                        newdr["SecondDistillationUnitNO" + "_" + dr["ProductId"]] = "0";
                        newdr["SecondProductQuantity" + "_" + dr["ProductId"]]    = "0";
                        newdr["TotalProductQuantity" + "_" + dr["ProductId"]]     = "0";
                    }
                }
                if (DateCount < dtFarmer.Rows.Count)
                {
                    DateCount += 1;
                    if (Convert.ToDateTime(drseason["StartDate"].ToString()).AddDays(DateCount) > Convert.ToDateTime(drseason["EndDate"].ToString()))
                    {
                        DateCount = 0;
                    }
                }
                NewPlantation.Rows.Add(newdr);
            }


            return(NewPlantation);
        }