//public static List<PostingJob> GetPendingPostingJobs(int companyId) //{ // List<PostingJob> pendingJobList = new List<PostingJob>(); // try // { // string strErr = ""; // CRSDAL dal = new CRSDAL(); // dal.AddParameter("p_CompanyID", companyId, ParameterDirection.Input); // dal.AddParameter("p_StatusId", 1, ParameterDirection.Input); // DataSet dstOutPut = dal.ExecuteSelect("spJainTallyGet_PostingStatus", CommandType.StoredProcedure, 0, ref strErr, "p_ErrMessage", false, "", false); // if (dstOutPut != null && dstOutPut.Tables != null && dstOutPut.Tables.Count > 0) // { // for (int j = 0; j < dstOutPut.Tables.Count; j++) // { // if (dstOutPut.Tables[j] != null && dstOutPut.Tables[j].Rows != null && dstOutPut.Tables[j].Rows.Count > 0) // { // for (int i = 0; i < dstOutPut.Tables[j].Rows.Count; i++) // { // PostingJob pJob = new PostingJob(); // pJob.CompanyId = companyId; // pJob.JobId = Convert.ToInt32(dstOutPut.Tables[j].Rows[i]["jobid"].ToString()); // pJob.JourneyDate = Convert.ToDateTime(dstOutPut.Tables[j].Rows[i]["journeydate"].ToString()); // pendingJobList.Add(pJob); // } // } // } // } // } // catch (Exception ex) // { // Logger.WriteLog("PostingStatusAPI", "GetPendingPostingJobs", ex.Message); // } // return pendingJobList; //} public static List <PostingJob> GetPendingPostingJobsList(int companyId) { List <PostingJob> pendingJobList = new List <PostingJob>(); try { string strErr = ""; CRSDAL dal = new CRSDAL(); dal.AddParameter("p_CompanyID", companyId, ParameterDirection.Input); dal.AddParameter("p_StatusId", 1, ParameterDirection.Input); DataSet dstOutPut = dal.ExecuteSelect("spTallyGet_PostingStatus_20180130", CommandType.StoredProcedure, 0, ref strErr, "p_ErrMessage", false, "", false); if (dstOutPut != null && dstOutPut.Tables != null && dstOutPut.Tables.Count > 0) { for (int j = 0; j < dstOutPut.Tables.Count; j++) { if (dstOutPut.Tables[j] != null && dstOutPut.Tables[j].Rows != null && dstOutPut.Tables[j].Rows.Count > 0) { for (int i = 0; i < dstOutPut.Tables[j].Rows.Count; i++) { PostingJob pJob = new PostingJob(); pJob.CompanyId = companyId; pJob.JobId = Convert.ToInt32(dstOutPut.Tables[j].Rows[i]["jobid"].ToString()); pJob.JourneyDate = Convert.ToDateTime(dstOutPut.Tables[j].Rows[i]["journeydate"].ToString()); pendingJobList.Add(pJob); } } } } } catch (Exception ex) { Logger.WriteLog("PostingStatusAPI", "GetPendingPostingJobs", ex.Message); } return(pendingJobList); }
public static List<Cancellation> GetCancellation(int companyid,int intervalofdays) { List<Cancellation> CancellationList = new List<Cancellation>(); try { string strErr = ""; CRSDAL dal = new CRSDAL(); dal.AddParameter("p_companyId", companyid, ParameterDirection.Input); dal.AddParameter("p_interval", intervalofdays, ParameterDirection.Input); DataSet dsOutPut = dal.ExecuteSelect("spJainTallyGet_CancellationData", CommandType.StoredProcedure, 0, ref strErr, "p_ErrMessage", false, "", false); if (dsOutPut != null && dsOutPut.Tables != null && dsOutPut.Tables.Count > 0) { DataTable dtOutput = dsOutPut.Tables[0]; if (dtOutput != null && dtOutput.Rows != null && dtOutput.Rows.Count > 0) { for (int i = 0; i < dtOutput.Rows.Count; i++) { DataRow dr = dtOutput.Rows[i]; if (Convert.ToInt32(dr["DebitLedgerId"].ToString()) > 0 && Convert.ToInt32(dr["CreditLedgerId"].ToString()) > 0) { Cancellation c = new Cancellation(); c.BookingId = Convert.ToInt32(dr["bookingid"].ToString()); c.DebitLedgerId = Convert.ToInt32(dr["DebitLedgerId"].ToString()); c.CreditLedgerId = Convert.ToInt32(dr["CreditLedgerId"].ToString()); c.BaseFare = Convert.ToDecimal(dr["ActualTotalFare"].ToString()); c.GST = Convert.ToDecimal(dr["GST"].ToString()); c.IGST = Convert.ToDecimal(dr["IGST"].ToString()); c.RefundAmount = Convert.ToDecimal(dr["RefundAmt"].ToString()); c.Comm = Convert.ToDecimal(dr["AgentComm"].ToString()); c.CancelDate = Convert.ToDateTime(dr["CDate"].ToString()); c.CustomerName = Convert.ToString(dr["CustomerName"].ToString()); c.GSTNumber = Convert.ToString(dr["GSTNumber"].ToString()); c.CustomerStateName = Convert.ToString(dr["passengerstatename"].ToString()); c.TicketNo = Convert.ToString(dr["TicketNo"].ToString()); c.Docnumber = Convert.ToString(dr["docnumber"].ToString()); c.DocType = Convert.ToString(dr["doctype"].ToString()); CancellationList.Add(c); } } } } } catch (Exception ex) { Logger.WriteLog("CancellationAPI", "GetCancellation", ex.Message); // Logger.WriteLogAlert("Cancellation " + " Error for Bookigid: " + CancellationList[i].BookingId + " " + ex.Message); } return CancellationList; }
private static List <Journal> GetJournals(int companyId, string spName) { List <Journal> journalList = new List <Journal>(); try { string strErr = ""; CRSDAL dal = new CRSDAL(); dal.AddParameter("p_companyId", companyId, ParameterDirection.Input); DataSet dstOutPut = dal.ExecuteSelect(spName, CommandType.StoredProcedure, 0, ref strErr, "p_ErrMessage", false, "", false); if (dstOutPut != null && dstOutPut.Tables != null && dstOutPut.Tables.Count > 0) { for (int j = 0; j < dstOutPut.Tables.Count; j++) { if (dstOutPut.Tables[j] != null && dstOutPut.Tables[j].Rows != null && dstOutPut.Tables[j].Rows.Count > 0) { for (int i = 0; i < dstOutPut.Tables[j].Rows.Count; i++) { Journal jl = new Journal(); jl.Action = dstOutPut.Tables[j].Rows[i]["action"].ToString(); jl.AccSysId = dstOutPut.Tables[j].Rows[i]["accsysid"].ToString(); jl.AccSysPostDateTime = Convert.ToDateTime(dstOutPut.Tables[j].Rows[i]["accsyspostdatetime"].ToString()); jl.BookingId = Convert.ToInt64(dstOutPut.Tables[j].Rows[i]["bookingid"].ToString()); jl.CompanyId = Convert.ToInt32(dstOutPut.Tables[j].Rows[i]["companyid"].ToString()); jl.CurrencyId = Convert.ToInt32(dstOutPut.Tables[j].Rows[i]["currencyid"].ToString()); jl.DocFormattedNumber = dstOutPut.Tables[j].Rows[i]["docformattednumber"].ToString(); jl.DocNumber = dstOutPut.Tables[j].Rows[i]["docnumber"].ToString(); jl.DocSubtype = dstOutPut.Tables[j].Rows[i]["docsubtype"].ToString(); jl.DocType = dstOutPut.Tables[j].Rows[i]["doctype"].ToString(); jl.Narration = dstOutPut.Tables[j].Rows[i]["narration"].ToString(); jl.JournalDateTime = Convert.ToDateTime(dstOutPut.Tables[j].Rows[i]["journaldatetime"].ToString()); jl.JournalEntryDateTime = Convert.ToDateTime(dstOutPut.Tables[j].Rows[i]["journalentrydatetime"].ToString()); jl.JournalId = Convert.ToInt32(dstOutPut.Tables[j].Rows[i]["voucherjournalid"].ToString()); jl.Type = dstOutPut.Tables[j].Rows[i]["type"].ToString(); jl.UserId = Convert.ToInt32(dstOutPut.Tables[j].Rows[i]["userid"].ToString()); journalList.Add(jl); } } } } } catch (Exception) { throw; } return(journalList); }
public static List <GSTBooking> GetBranchGSTBookings(int companyid, int intervalofdays) { List <GSTBooking> gstbookingsList = new List <GSTBooking>(); try { string strErr = ""; CRSDAL dal = new CRSDAL(); dal.AddParameter("p_companyId", companyid, ParameterDirection.Input); dal.AddParameter("p_interval", intervalofdays, ParameterDirection.Input); DataSet dstOutPut = dal.ExecuteSelect("spJainTallyGet_GSTBookingDetails", CommandType.StoredProcedure, 0, ref strErr, "p_ErrMessage", false, "", false); if (dstOutPut != null && dstOutPut.Tables != null && dstOutPut.Tables.Count > 0) { for (int j = 0; j < dstOutPut.Tables.Count; j++) { if (dstOutPut.Tables[j] != null && dstOutPut.Tables[j].Rows != null && dstOutPut.Tables[j].Rows.Count > 0) { for (int i = 0; i < dstOutPut.Tables[j].Rows.Count; i++) { GSTBooking gb = new GSTBooking(); gb.BaseFare = Convert.ToDecimal(dstOutPut.Tables[j].Rows[i]["TotalFare"].ToString()); gb.TotalFare = Convert.ToDecimal(dstOutPut.Tables[j].Rows[i]["ActualTotalFare"].ToString()); gb.NetFare = Convert.ToDecimal(dstOutPut.Tables[j].Rows[i]["NetTotalFare"].ToString()); gb.BookingId = Convert.ToInt64(dstOutPut.Tables[j].Rows[i]["BookingID"].ToString()); gb.GSTNumber = Convert.ToString(dstOutPut.Tables[0].Rows[0]["GSTNumber"].ToString()); gb.DebitLedgerId = Convert.ToInt32(dstOutPut.Tables[j].Rows[i]["DebitLedgerid"].ToString()); gb.CreditLedgerId = Convert.ToInt32(dstOutPut.Tables[j].Rows[i]["CreditLedgerId"].ToString()); gb.GST = Convert.ToDecimal(dstOutPut.Tables[j].Rows[i]["GST"].ToString()); gb.IGST = Convert.ToDecimal(dstOutPut.Tables[j].Rows[i]["IGST"].ToString()); gb.Comm = Convert.ToDecimal(dstOutPut.Tables[j].Rows[i]["AgentComm"].ToString()); gb.CustomerName = Convert.ToString(dstOutPut.Tables[0].Rows[0]["CustomerName"].ToString()); gb.CustomerStateName = Convert.ToString(dstOutPut.Tables[0].Rows[0]["passengerstatename"].ToString()); gb.TicketNo = Convert.ToString(dstOutPut.Tables[j].Rows[i]["TicketNo"].ToString()); gb.DocNumber = Convert.ToString(dstOutPut.Tables[j].Rows[i]["docnumber"].ToString()); gb.DocType = Convert.ToString(dstOutPut.Tables[j].Rows[i]["doctype"].ToString()); gstbookingsList.Add(gb); } } } } } catch (Exception ex) { Logger.WriteLog("BookingsAPI", "GetBranchCardBookings", ex.Message); } return(gstbookingsList); }
public static List <Booking> GetBranchBookings(int companyid, DateTime journeyDate) { List <Booking> bookingsList = new List <Booking>(); try { string strErr = ""; CRSDAL dal = new CRSDAL(); dal.AddParameter("p_companyId", companyid, ParameterDirection.Input); dal.AddParameter("p_journeyDate", journeyDate, ParameterDirection.Input); DataSet dstOutPut = dal.ExecuteSelect("spKabraTallyGet_BranchBooking", CommandType.StoredProcedure, 0, ref strErr, "p_ErrMessage", false, "", false); if (dstOutPut != null && dstOutPut.Tables != null && dstOutPut.Tables.Count > 0) { for (int j = 0; j < dstOutPut.Tables.Count; j++) { // int table = dstOutPut.Tables.Count; if (dstOutPut.Tables[j] != null && dstOutPut.Tables[j].Rows != null && dstOutPut.Tables[j].Rows.Count > 0) { for (int i = 0; i < dstOutPut.Tables[j].Rows.Count; i++) { // int row = dstOutPut.Tables[table - 1].Rows.Count; Booking b = new Booking(); b.BranchId = Convert.ToInt32(dstOutPut.Tables[j].Rows[i]["branchid"].ToString()); b.BusID = Convert.ToInt32(dstOutPut.Tables[j].Rows[i]["busid"].ToString()); b.BranchName = Convert.ToString(dstOutPut.Tables[j].Rows[i]["branchname"].ToString()); b.JourneyDate = Convert.ToDateTime(dstOutPut.Tables[j].Rows[i]["chartdate"].ToString()); b.DebitLedgerId = Convert.ToInt32(dstOutPut.Tables[j].Rows[i]["Debitledgerid"].ToString()); b.CreditLedgerId = Convert.ToInt32(dstOutPut.Tables[j].Rows[i]["Creditledgerid"].ToString()); b.TotalAmount = Convert.ToDecimal(dstOutPut.Tables[j].Rows[i]["TotalFare"].ToString()); b.GST = Convert.ToDecimal(dstOutPut.Tables[j].Rows[i]["GST"].ToString()); b.NetAmount = Convert.ToDecimal(dstOutPut.Tables[j].Rows[i]["NetAmt"].ToString()); b.ClassId = Convert.ToInt32(dstOutPut.Tables[j].Rows[i]["ClassID"].ToString()); b.ClassName = Convert.ToString(dstOutPut.Tables[j].Rows[i]["classname"].ToString()); b.DocNumber = Convert.ToString(dstOutPut.Tables[j].Rows[i]["docnumber"].ToString()); //b.NetAmount = Convert.ToDecimal(dstOutPut.Tables[j].Rows[i]["NetAmt"].ToString()); bookingsList.Add(b); } } } } } catch (Exception ex) { Logger.WriteLog("BookingsAPI", "GetBranchBookings", ex.Message); } return(bookingsList); }
public static List <OnlineAgentDetails> GetOnlineAgentCollection(int companyid, DateTime journeyDate) { List <OnlineAgentDetails> AgentList = new List <OnlineAgentDetails>(); try { string strErr = ""; CRSDAL dal = new CRSDAL(); dal.AddParameter("p_companyId", companyid, ParameterDirection.Input); dal.AddParameter("p_journeyDate", journeyDate, ParameterDirection.Input); DataSet dsOutPut = dal.ExecuteSelect("spKabraTallyGet_OnlineAgentCollection", CommandType.StoredProcedure, 0, ref strErr, "p_ErrMessage", false, "", false); if (dsOutPut != null && dsOutPut.Tables != null && dsOutPut.Tables.Count > 0) { DataTable dtOutput = dsOutPut.Tables[0]; if (dtOutput != null && dtOutput.Rows != null && dtOutput.Rows.Count > 0) { for (int i = 0; i < dtOutput.Rows.Count; i++) { DataRow dr = dtOutput.Rows[i]; OnlineAgentDetails ac = new OnlineAgentDetails(); ac.AgentName = dr["AgentName"].ToString(); ac.AgentId = Convert.ToInt32(dr["agentid"].ToString()); ac.BusId = Convert.ToInt32(dr["busid"].ToString()); ac.DebitLedgerId = Convert.ToInt32(dr["DebitLedgerId"].ToString()); ac.CreditLedgerId = Convert.ToInt32(dr["CreditLedgerId"].ToString()); ac.NetAmount = Convert.ToDecimal(dr["NetAmt"].ToString()); ac.GST = Convert.ToDecimal(dr["GST"].ToString()); ac.Discount = Convert.ToDecimal(dr["Discount"].ToString()); ac.TotalFare = Convert.ToDecimal(dr["TotalFare"].ToString()); ac.AgentComm = Convert.ToDecimal(dr["AgentComm"].ToString()); ac.JourneyDate = Convert.ToDateTime(dr["journeydate"].ToString()); ac.Docnumber = Convert.ToString(dr["docnumber"].ToString()); ac.ClassName = dr["classname"].ToString(); ac.ClassID = Convert.ToInt32(dr["ClassID"].ToString()); AgentList.Add(ac); } } } } catch (Exception ex) { Logger.WriteLog("OnlineAgentAPI", "GetOnlineAgentCollection", ex.Message); } return(AgentList); }
public static List <Franchise> GetFranchiseCollection(int companyid, DateTime journeyDate) { List <Franchise> franchisecollectionList = new List <Franchise>(); try { string strErr = ""; CRSDAL dal = new CRSDAL(); dal.AddParameter("p_companyId", companyid, ParameterDirection.Input); dal.AddParameter("p_journeyDate", journeyDate, ParameterDirection.Input); DataSet dsOutPut = dal.ExecuteSelect("spKabraTallyGet_FranchiseBooking_test", CommandType.StoredProcedure, 0, ref strErr, "p_ErrMessage", false, "", false); if (dsOutPut != null && dsOutPut.Tables != null && dsOutPut.Tables.Count > 0) { DataTable dtOutput = dsOutPut.Tables[0]; if (dtOutput != null && dtOutput.Rows != null && dtOutput.Rows.Count > 0) { for (int i = 0; i < dtOutput.Rows.Count; i++) { DataRow dr = dtOutput.Rows[i]; Franchise fc = new Franchise(); fc.FranchiseId = Convert.ToInt32(dr["BranchID"].ToString()); fc.FranchiseName = dr["BranchName"].ToString(); fc.JourneyDate = Convert.ToDateTime(dr["Journeydate"].ToString()); fc.DebitLedgerId = Convert.ToInt32(dr["DebitLedgerId"].ToString()); fc.CreditLedgerId = Convert.ToInt32(dr["CreditLedgerId"].ToString()); //fc.FranchiseName = dr["DebitLedgerName"].ToString(); fc.NetAmount = Convert.ToDecimal(dr["NetAmt"].ToString()); fc.TotalAmt = Convert.ToDecimal(dr["TotalFare"].ToString()); fc.ServiceTax = Convert.ToDecimal(dr["GST"].ToString()); fc.Discount = Convert.ToDecimal(dr["Discount"].ToString()); fc.AggentComm = Convert.ToDecimal(dr["Commission"].ToString()); fc.DocNumber = Convert.ToString(dr["docnumber"].ToString()); fc.ClassID = Convert.ToInt32(dr["ClassID"].ToString()); fc.classname = Convert.ToString(dr["classname"].ToString()); franchisecollectionList.Add(fc); } } } } catch (Exception ex) { Logger.WriteLog("FranchiseAPI", "GetFranchiseCollection", ex.Message); } return(franchisecollectionList); }
public static List <BusWise> GetAttachedBusCollection(int companyid, int intervalofdays) { List <BusWise> BusWiseList = new List <BusWise>(); try { string strErr = ""; CRSDAL dal = new CRSDAL(); dal.AddParameter("p_companyId", companyid, ParameterDirection.Input); dal.AddParameter("p_interval", intervalofdays, ParameterDirection.Input); DataSet dsOutPut = dal.ExecuteSelect("spJainTallyGet_QuickView", CommandType.StoredProcedure, 0, ref strErr, "p_ErrMessage", false, "", false); if (dsOutPut != null && dsOutPut.Tables != null && dsOutPut.Tables.Count > 0) { DataTable dtOutput = dsOutPut.Tables[0]; if (dtOutput != null && dtOutput.Rows != null && dtOutput.Rows.Count > 0) { for (int i = 0; i < dtOutput.Rows.Count; i++) { DataRow dr = dtOutput.Rows[i]; BusWise bc = new BusWise(); bc.BusiD = Convert.ToInt32(dr["BusID"].ToString()); bc.BusNumber = dr["BusNumber"].ToString(); bc.JourneyDate = Convert.ToDateTime(dr["JourneyDate"].ToString()); bc.AccsysLedgerId = Convert.ToInt32(dr["accsysledgerid"].ToString()); bc.CommLedgerId = Convert.ToInt32(dr["CommLedgerid"].ToString()); bc.NetAmount = Convert.ToDecimal(dr["totalactualfare"].ToString()); bc.OfflineAgentComm = Convert.ToDecimal(dr["TotalOfflineAgentComm"].ToString()); bc.OnlineAgentComm = Convert.ToDecimal(dr["TotalOnlineAgentComm"].ToString()); bc.CGST = Convert.ToDecimal(dr["CGST"].ToString()); bc.SGST = Convert.ToDecimal(dr["CGST"].ToString()); bc.BusComm = Convert.ToDecimal(dr["Comm"].ToString()); bc.DocNumber = Convert.ToString(dr["docnumber"].ToString()); BusWiseList.Add(bc); } } } } catch (Exception ex) { Logger.WriteLog("AttachedBusAPI", "GetAttachedBusCollection", ex.Message); } return(BusWiseList); }
public static List <JournalDetail> GetJournalDetail(int JournalID, string type) { List <JournalDetail> jdList = new List <JournalDetail>(); try { string strErr = ""; CRSDAL dal = new CRSDAL(); dal.AddParameter("p_JournalId", JournalID, ParameterDirection.Input); DataSet dstOutPut = dal.ExecuteSelect("spTallyGet_JournalDetail_Kabra", CommandType.StoredProcedure, 0, ref strErr, "p_ErrMessage", false, "", false); if (dstOutPut != null && dstOutPut.Tables != null && dstOutPut.Tables.Count > 0) { for (int j = 0; j < dstOutPut.Tables.Count; j++) { if (dstOutPut.Tables[j] != null && dstOutPut.Tables[j].Rows != null && dstOutPut.Tables[j].Rows.Count > 0) { for (int i = 0; i < dstOutPut.Tables[j].Rows.Count; i++) { JournalDetail jd = new JournalDetail(); jd.Amount = Convert.ToDecimal(dstOutPut.Tables[j].Rows[i]["amount"].ToString()); jd.Description = dstOutPut.Tables[j].Rows[i]["description"].ToString(); jd.LedgerName = dstOutPut.Tables[j].Rows[i]["ledgername"].ToString(); jd.ClassName = dstOutPut.Tables[j].Rows[i]["classname"].ToString(); jd.IsDebit = Convert.ToInt16(dstOutPut.Tables[j].Rows[i]["isdebit"].ToString()); jd.LedgerId = Convert.ToInt32(dstOutPut.Tables[j].Rows[i]["accsysledgerid"].ToString()); jd.ClassId = Convert.ToInt32(dstOutPut.Tables[j].Rows[i]["accsysclassid"].ToString()); jd.JournalId = Convert.ToInt32(dstOutPut.Tables[j].Rows[i]["voucherjournalid"].ToString()); jdList.Add(jd); } } } } } catch (Exception ex) { Logger.WriteLog("AccountingAPI", "GetJournalDetail", ex.Message); } return(jdList); }
public static void UpdateTallyJournalIdInCRS(int journalId, string tallyId) { string strResult = ""; try { CRSDAL dal = new CRSDAL(); string strErr = ""; dal.AddParameter("p_journalId", journalId, ParameterDirection.Input); dal.AddParameter("p_accsysid", tallyId, 100, ParameterDirection.Input); //dal.AddParameter("p_ErrMsg", strErr, strErr.Length, ParameterDirection.Output); DataSet dstoutput = dal.ExecuteSelect("spKabraTallySet_JournalId", CommandType.StoredProcedure, 0, ref strErr, "p_ErrMessage", true, "", false); if (Convert.ToInt32(dstoutput.Tables[0].Rows[0]["countrow"].ToString()) == 0 || Convert.ToInt32(dstoutput.Tables[0].Rows[0]["countrow"].ToString()) > 1 || strErr != "") { Logger.WriteLogAlert("AccountingAPI " + "Error In UpdateTallyJournalIdInCRS" + "For JournalId :" + journalId + " " + strErr); } } catch (Exception ex) { Logger.WriteLogAlert("AccountingAPI " + "Error In UpdateTallyJournalIdInCRS" + "For JournalId :" + journalId + " " + ex); } }