public static List <LocationVM> GetLocation(string term) { SqlCommand cmd = new SqlCommand(); cmd.Connection = new SqlConnection(CommanFunctions.GetConnectionString); cmd.CommandText = "SP_QryGetLocation"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@term", term); SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); da.Fill(ds); List <LocationVM> objList = new List <LocationVM>(); if (ds != null && ds.Tables.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { LocationVM obj = new LocationVM(); obj.LocationID = CommanFunctions.ParseInt(ds.Tables[0].Rows[i]["LocationID"].ToString()); obj.CityID = CommanFunctions.ParseInt(ds.Tables[0].Rows[i]["CityID"].ToString()); obj.CountryID = CommanFunctions.ParseInt(ds.Tables[0].Rows[i]["CountryID"].ToString()); obj.Location = ds.Tables[0].Rows[i]["Location"].ToString(); obj.CityName = ds.Tables[0].Rows[i]["City"].ToString(); obj.CountryName = ds.Tables[0].Rows[i]["CountryName"].ToString(); objList.Add(obj); } } return(objList); }
public static List <TruckAssignVM> GetTruckDetailConsignments(string TDHNo, string ConsignmentNote, DateTime FromDate, DateTime ToDate) { SqlCommand cmd = new SqlCommand(); cmd.Connection = new SqlConnection(CommanFunctions.GetConnectionString); cmd.CommandText = "SP_GetTruckAssignList"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@FromDate", SqlDbType.VarChar); cmd.Parameters["@FromDate"].Value = FromDate.ToString("MM/dd/yyyy"); cmd.Parameters.Add("@ToDate", SqlDbType.VarChar); cmd.Parameters["@ToDate"].Value = ToDate.ToString("MM/dd/yyyy"); cmd.Parameters.Add("@ConsignmentNo", SqlDbType.VarChar); if (ConsignmentNote == null) { ConsignmentNote = ""; } cmd.Parameters["@ConsignmentNo"].Value = ConsignmentNote; cmd.Parameters.Add("@TDHNo", SqlDbType.VarChar); if (TDHNo == null) { TDHNo = ""; } cmd.Parameters["@TDHNo"].Value = TDHNo; SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); da.Fill(ds); List <TruckAssignVM> objList = new List <TruckAssignVM>(); if (ds != null && ds.Tables.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { TruckAssignVM obj = new TruckAssignVM(); obj.TruckDetailId = CommanFunctions.ParseInt(ds.Tables[0].Rows[i]["TruckDetailId"].ToString()); obj.ReceiptNo = ds.Tables[0].Rows[i]["ReceiptNo"].ToString(); obj.ConsignmentNo = ds.Tables[0].Rows[i]["ConsignmentNo"].ToString(); obj.TDDate = Convert.ToDateTime(ds.Tables[0].Rows[i]["TDDate"].ToString()); // CommanFunctions.ParseDate(ds.Tables[0].Rows[i]["RecPayDate"].ToString()); obj.RouteName = ds.Tables[0].Rows[i]["RouteName"].ToString(); obj.VechileRegistrationNo = ds.Tables[0].Rows[i]["RegNo"].ToString(); obj.Rent = Convert.ToDecimal(ds.Tables[0].Rows[i]["Rent"].ToString()); obj.OtherCharges = Convert.ToDecimal(ds.Tables[0].Rows[i]["OtherCharge"].ToString()); obj.TotalCharge = Convert.ToDecimal(ds.Tables[0].Rows[i]["TotalCharge"].ToString()); objList.Add(obj); } } return(objList); }
public static List <RevenueUpdateMasterVM> GetRevenueUpdateList(string ConsignmentNote, DateTime FromDate, DateTime ToDate) { SqlCommand cmd = new SqlCommand(); cmd.Connection = new SqlConnection(CommanFunctions.GetConnectionString); cmd.CommandText = "SP_GetRevenueUpdateList"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@FromDate", SqlDbType.VarChar); cmd.Parameters["@FromDate"].Value = FromDate.ToString("MM/dd/yyyy"); cmd.Parameters.Add("@ToDate", SqlDbType.VarChar); cmd.Parameters["@ToDate"].Value = ToDate.ToString("MM/dd/yyyy"); cmd.Parameters.Add("@ConsignmentNo", SqlDbType.VarChar); if (ConsignmentNote == null) { ConsignmentNote = ""; } cmd.Parameters["@ConsignmentNo"].Value = ConsignmentNote; SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); da.Fill(ds); List <RevenueUpdateMasterVM> objList = new List <RevenueUpdateMasterVM>(); if (ds != null && ds.Tables.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { RevenueUpdateMasterVM obj = new RevenueUpdateMasterVM(); obj.ID = CommanFunctions.ParseInt(ds.Tables[0].Rows[i]["ID"].ToString()); obj.ConsignmentNo = ds.Tables[0].Rows[i]["ConsignmentNo"].ToString(); obj.ConsignmentDate = Convert.ToDateTime(ds.Tables[0].Rows[i]["ConsignmentDate"].ToString()); // CommanFunctions.ParseDate(ds.Tables[0].Rows[i]["RecPayDate"].ToString()); obj.Currency = ds.Tables[0].Rows[i]["CurrencyName"].ToString(); obj.PaymentType = ds.Tables[0].Rows[i]["PaymentType"].ToString(); obj.InvoiceTo = ds.Tables[0].Rows[i]["InvoiceTo"].ToString(); obj.DebitAccountName = ds.Tables[0].Rows[i]["DebitAccountHead"].ToString(); obj.CreditAccountName = ds.Tables[0].Rows[i]["CreditAccountHead"].ToString(); obj.CustomerName = ds.Tables[0].Rows[i]["CustomerName"].ToString(); if (ds.Tables[0].Rows[i]["Amount"] == DBNull.Value) { obj.Amount = 0; } else { obj.Amount = CommanFunctions.ParseDecimal(ds.Tables[0].Rows[i]["Amount"].ToString()); } objList.Add(obj); } } return(objList); }
public static List <RevenueUpdateDetailVM> GetRevenueUpdateDetail(int ID) { SqlCommand cmd = new SqlCommand(); cmd.Connection = new SqlConnection(CommanFunctions.GetConnectionString); cmd.CommandText = "SP_GetRevenueUpdateDetail"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@ID", SqlDbType.Int); cmd.Parameters["@ID"].Value = ID; SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); da.Fill(ds); List <RevenueUpdateDetailVM> objList = new List <RevenueUpdateDetailVM>(); if (ds != null && ds.Tables.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { RevenueUpdateDetailVM obj = new RevenueUpdateDetailVM(); obj.ID = CommanFunctions.ParseInt(ds.Tables[0].Rows[i]["ID"].ToString()); obj.MasterID = CommanFunctions.ParseInt(ds.Tables[0].Rows[i]["MasterID"].ToString()); obj.CurrencyId = CommanFunctions.ParseInt(ds.Tables[0].Rows[i]["CurrencyId"].ToString()); obj.ExchangeRate = CommanFunctions.ParseDecimal(ds.Tables[0].Rows[i]["ExchangeRate"].ToString()); obj.RevenueCostMasterID = CommanFunctions.ParseInt(ds.Tables[0].Rows[i]["RevenueCostMasterID"].ToString()); obj.RevenueCost = ds.Tables[0].Rows[i]["RevenueComponent"].ToString(); obj.CustomerId = CommanFunctions.ParseInt(ds.Tables[0].Rows[i]["CustomerId"].ToString()); obj.Amount = CommanFunctions.ParseDecimal(ds.Tables[0].Rows[i]["Amount"].ToString()); obj.TaxPercent = CommanFunctions.ParseDecimal(ds.Tables[0].Rows[i]["TaxPercent"].ToString()); obj.TaxAmount = CommanFunctions.ParseDecimal(ds.Tables[0].Rows[i]["TaxAmount"].ToString()); obj.TotalCharge = CommanFunctions.ParseDecimal(ds.Tables[0].Rows[i]["TotalCharge"].ToString()); obj.AcHeadDebitId = CommanFunctions.ParseInt(ds.Tables[0].Rows[i]["AcHeadDebitId"].ToString()); obj.AcHeadCreditId = CommanFunctions.ParseInt(ds.Tables[0].Rows[i]["AcHeadCreditId"].ToString()); obj.PaymentModeId = CommanFunctions.ParseInt(ds.Tables[0].Rows[i]["PaymentModeId"].ToString()); obj.InvoiceTo = ds.Tables[0].Rows[i]["InvoiceTo"].ToString(); obj.DebitAccountName = ds.Tables[0].Rows[i]["DebitAccountHead"].ToString(); obj.CreditAccountName = ds.Tables[0].Rows[i]["CreditAccountHead"].ToString(); obj.Currency = ds.Tables[0].Rows[i]["CurrencyName"].ToString(); obj.CustomerName = ds.Tables[0].Rows[i]["CustomerName"].ToString(); obj.PaymentType = ds.Tables[0].Rows[i]["PaymentType"].ToString(); obj.InvoiceNo = ds.Tables[0].Rows[i]["InvoiceNo"].ToString(); objList.Add(obj); } } return(objList); }
public static List <CustomerInvoiceDetailVM> GenerateInvoice(DateTime FromDate, DateTime ToDate, int CustomerId, int FYearId, int InvoiceId) { SqlCommand cmd = new SqlCommand(); cmd.Connection = new SqlConnection(CommanFunctions.GetConnectionString); cmd.CommandText = "SP_GenerateInvoice"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@FromDate", FromDate.ToString("MM/dd/yyyy")); cmd.Parameters.AddWithValue("@ToDate", ToDate.ToString("MM/dd/yyyy")); cmd.Parameters.AddWithValue("@CustomerId", CustomerId); cmd.Parameters.AddWithValue("@FYearId", FYearId); cmd.Parameters.AddWithValue("@InvoiceId", InvoiceId); SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); da.Fill(ds); List <CustomerInvoiceDetailVM> objList = new List <CustomerInvoiceDetailVM>(); if (ds != null && ds.Tables.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { CustomerInvoiceDetailVM obj = new CustomerInvoiceDetailVM(); obj.CustomerInvoiceDetailID = CommanFunctions.ParseInt(ds.Tables[0].Rows[i]["CustomerInvoiceDetailID"].ToString()); obj.CustomerInvoiceID = CommanFunctions.ParseInt(ds.Tables[0].Rows[i]["CustomerInvoiceID"].ToString()); obj.InScanID = CommanFunctions.ParseInt(ds.Tables[0].Rows[i]["InScanId"].ToString()); obj.ConsignmentNo = ds.Tables[0].Rows[i]["ConsignmentNo"].ToString(); obj.AWBDateTime = Convert.ToDateTime(ds.Tables[0].Rows[i]["AWBDateTime"].ToString()); obj.FreightCharge = CommanFunctions.ParseDecimal(ds.Tables[0].Rows[i]["FreightCharge"].ToString()); obj.DocCharge = CommanFunctions.ParseDecimal(ds.Tables[0].Rows[i]["DocCharge"].ToString()); obj.CustomsCharge = CommanFunctions.ParseDecimal(ds.Tables[0].Rows[i]["CustomsCharge"].ToString()); obj.OtherCharge = CommanFunctions.ParseDecimal(ds.Tables[0].Rows[i]["OtherCharge"].ToString()); obj.TotalCharges = CommanFunctions.ParseDecimal(ds.Tables[0].Rows[i]["TotalCharges"].ToString()); obj.ConsigneeName = ds.Tables[0].Rows[i]["Consignee"].ToString(); obj.ConsigneeCountryName = ds.Tables[0].Rows[i]["ConsigneeCountryName"].ToString(); obj.Origin = ds.Tables[0].Rows[i]["Consignor"].ToString(); obj.ConsigneeName = ds.Tables[0].Rows[i]["Consignee"].ToString(); objList.Add(obj); } } return(objList); }
public static List <CustomerInvoiceVM> GetInvoiceList(DateTime FromDate, DateTime ToDate, string InvoiceNo, int FyearId) { SqlCommand cmd = new SqlCommand(); string strConnString = ConfigurationManager.ConnectionStrings["myConnectionString"].ConnectionString; cmd.Connection = new SqlConnection(strConnString); cmd.CommandText = "SP_GetInvoiceList"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@FromDate", FromDate.ToString("MM/dd/yyyy")); cmd.Parameters.AddWithValue("@ToDate", ToDate.ToString("MM/dd/yyyy")); cmd.Parameters.AddWithValue("@FYearId", FyearId); if (InvoiceNo == null) { InvoiceNo = ""; } cmd.Parameters.AddWithValue("@InvoiceNo", @InvoiceNo); SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); da.Fill(ds); List <CustomerInvoiceVM> objList = new List <CustomerInvoiceVM>(); CustomerInvoiceVM obj; if (ds != null && ds.Tables.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { obj = new CustomerInvoiceVM(); obj.CustomerInvoiceID = CommanFunctions.ParseInt(ds.Tables[0].Rows[i]["CustomerInvoiceID"].ToString()); obj.CustomerInvoiceNo = ds.Tables[0].Rows[i]["CustomerInvoiceNo"].ToString(); obj.InvoiceDate = Convert.ToDateTime(ds.Tables[0].Rows[i]["InvoiceDate"].ToString()); obj.CustomerName = ds.Tables[0].Rows[i]["CustomerName"].ToString(); obj.CustomerID = CommanFunctions.ParseInt(ds.Tables[0].Rows[i]["CustomerID"].ToString()); obj.InvoiceTotal = CommanFunctions.ParseDecimal(ds.Tables[0].Rows[i]["InvoiceTotal"].ToString()); objList.Add(obj); } } return(objList); }