Beispiel #1
0
        public static BusDetailsModel GetAllBusses()
        {
            BusDetailsModel obj = new BusDetailsModel();

            obj.lstbusName = WayBillRepository.GetAllBuses().ToList();
            return(obj);
        }
Beispiel #2
0
        private void P1ClientTbl_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            DataGridView table = sender as DataGridView;

            if (table == null)
            {
                MessageBox.Show("Critical error.", "Error");
                return;
            }

            List <Waybill> waybills = WayBillRepository.GetAllEntities();
            int            clientID = (int)table.Rows[e.RowIndex > 0 ? e.RowIndex : 0].Cells["ID"].Value;

            this.UpdateP1WaybillTbl(waybills.Where(wb => wb.ClientID == clientID).ToList());

            List <AccumulationRegister> accumulations = AccumRegisterRepository.GetAllEntities().Where(a => a.ClientID == clientID).ToList();

            AccumulationRegister lastRecord = accumulations.Where(a => a.DateTime == accumulations.Max(ac => ac.DateTime)).FirstOrDefault();

            if (lastRecord == null)
            {
                P1TotalWbTxt.Text     = "waybills not found.";
                P1TotalRoamWbTxt.Text = "waybills not found.";
                return;
            }

            P1TotalWbTxt.Text     = lastRecord.TotalAmount.ToString();
            P1TotalRoamWbTxt.Text = lastRecord.RoamingAmount.ToString();
        }
Beispiel #3
0
        public FTPTransporter()
        {
            InitializeComponent();

            Environment.CurrentDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

            try
            {
                this.Settings = SettingsContainer.GetSettings();
            }
            catch (Exception ex)
            {
                EventLog.Source = "FtpTransporter";
                EventLog.WriteEntry(string.Format("{0}: {1}. {2}", ex.StackTrace, ex.Message, "Error to initialization settings from database."));
            }

            this.CanStop             = true;
            this.CanPauseAndContinue = true;
            this.AutoLog             = true;
            this.ServiceName         = this.Settings.ServiceName;
            EventLog.Source          = this.ServiceName;
            this.Logger     = new Logger(string.Format("{0}.{1}", this.ServiceName, "log"), this.ServiceName);
            this.Timer      = new Timer();
            this.FtpManager = new ManagerFtp(this.Settings.FtpUri, Convert.ToBoolean(this.Settings.FtpIsPassive),
                                             this.Settings.FtpTimeoutSec, this.Logger);
            this.WayBillRepository     = new WayBillRepository();
            this.TradeObjectRepository = new TradeObjectRepository();
        }
Beispiel #4
0
 public static bool BALSaveCouponDetails(CouponDetails model)
 {
     if (WayBillRepository.SaveCouponDetails(model) == 0)
     {
         return(false);
     }
     return(true);
 }
Beispiel #5
0
        public static bool SaveWaybillDetails(WayBillBookDetailsModel model)
        {
            var result = WayBillRepository.SaveWayBillDetails(model);

            if (result == 1)
            {
                return(true);
            }
            return(false);
        }
Beispiel #6
0
        public static bool BALSaveCashSheetSummary(CashSheetSummary model)
        {
            var _data = WayBillRepository.SaveCashSummary(model);

            if (_data == 1)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #7
0
        public static bool BALGenerateCashVivrani(int empid, int busid, int vivraniid)
        {
            var _data = WayBillRepository.GenerateCashVivrani(empid, busid, vivraniid);

            if (_data == 1)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #8
0
        public static bool GetLastTicketSerial(int ticketserialno, int ticketno, int busid)
        {
            var data = WayBillRepository.GetLastTicketSerial(ticketno, busid);

            if (data == 0)
            {
                return(true);
            }
            if (ticketserialno - data == 1)
            {
                return(true);
            }

            return(false);
        }
Beispiel #9
0
        public static bool GetLastWayBill(int waybillbook, int waybillbookno, int busid)
        {
            var data = WayBillRepository.GetLastWayBillSerial(waybillbookno, busid);

            if (data == 0)
            {
                return(true);
            }
            if (waybillbook - data == 1)
            {
                return(true);
            }

            return(false);
        }
Beispiel #10
0
        public static List <WayBillTicketViewModel> BALSaveWayBillEntry(WayBillTicketModel model)
        {
            //  List<WayBillViewModel> lstwaybillmodel;
            //if(model.NumberOfTicket>1 )
            //{
            //    lstwaybillmodel = new List<WayBillViewModel>();
            //    var lastticketnumber = model.TicketEnd;
            //    var tempfare = model.Fare;
            //    var startTicket= model.TicketStart;
            //    for (int a = startTicket; a <= lastticketnumber; a++)
            //    {
            //         model.TicketStart =startTicket++;
            //         model.TicketEnd = model.TicketStart;

            //         model.Fare = tempfare / model.NumberOfTicket;
            //        // model.NumberOfTicket;
            //lstwaybillmodel.Add(WayBillRepository.SaveWayBillDetailsEntry(model).FirstOrDefault());
            // }
            return(WayBillRepository.SaveWayBillDetailsEntry(model).ToList());
        }
Beispiel #11
0
 public static List <VivraniDetailsModel> AddVivraniDetails(VivraniDetails model)
 {
     model.vivranifuel.VivraniSerialID = model.vivraniSerialNumber;
     SaveVivraniFuelDeatils(model.vivranifuel);
     return(WayBillRepository.SaveVivraniDetails(model).ToList());
 }
Beispiel #12
0
 public static int BALGetGamanPatra()
 {
     return(WayBillRepository.GetGamanPatra());
 }
Beispiel #13
0
 public static List <CouponDetails> BALGetAllCouponDetails()
 {
     return(WayBillRepository.GetAllCouponDetails().ToList());
 }
Beispiel #14
0
 public static BusOwnerName GetOwnerDetails(string busId)
 {
     return(WayBillRepository.GetBusOwnNameDetails(busId).FirstOrDefault());
 }
Beispiel #15
0
 public static List <CashSheetDetailsModel> AddCashsheetOtherExpenses(CashSheetDetails model)
 {
     return(WayBillRepository.SaveCashOtherExpensesDetails(model).ToList());
 }
Beispiel #16
0
 public static bool BALUpdateVivrani(int vivraniid, decimal amount)
 {
     return(WayBillRepository.UpdateVivrani(vivraniid, amount));
 }
Beispiel #17
0
 public static bool BALCheckIfVivraniCreated(int busid, int empid)
 {
     return(WayBillRepository.CheckIfVivraniCreated(empid, busid));
 }
Beispiel #18
0
 public static CashSheetModel GetCashSheetSerialNumber(Vivirani model)
 {
     return(WayBillRepository.GetCashSheetSerial(model));
 }
Beispiel #19
0
 public static List <CashVivraniDetails> BALShowCashVivrani(int empid, int busid)
 {
     return(WayBillRepository.ShowCashVivrani(empid, busid).ToList());
 }
Beispiel #20
0
 public static int?GetPendingVivraniSerial(int empid, int department)
 {
     return(WayBillRepository.GetPendingVivraniSerial(empid, department));
 }
Beispiel #21
0
 public static bool SaveVivraniFuelDeatils(FuelVivrani model)
 {
     return(WayBillRepository.InsertVivraniFuleDetails(model));
 }
Beispiel #22
0
 public static GamanPatraViewModel BALSaveGamanPatra(GamanPatraModel model)
 {
     return(WayBillRepository.SaveGamanPatra(model));
 }
Beispiel #23
0
 public static GenerateCashSheetModel GetGeneratedCashSheet(int empId, int departmentid, DateTime date)
 {
     return(WayBillRepository.GetCashSheetDetails(empId, departmentid, date));
 }
Beispiel #24
0
 public static GamanPatraViewModel BALGetGamanPatra(int id)
 {
     return(WayBillRepository.GetGamanPatra(id));
 }
Beispiel #25
0
 public static vivraniDomainModel GetCashVivraiSerial(Vivirani model)
 {
     return(WayBillRepository.GetVivraniSerial(model));
 }
Beispiel #26
0
 public static List <RouteName> BALGetRouteName(string prefix)
 {
     return(WayBillRepository.GetRouteName(prefix));
 }
Beispiel #27
0
 public static List <CouponDetails> BALSaveWayBillCouponDetails(CouponDetails model)
 {
     return(WayBillRepository.SaveWayBillCouponDetails(model).ToList());
 }
Beispiel #28
0
 public static OwnerFuelSMSInfo BALGetOwnerFueliInfo(string pumpid)
 {
     return(WayBillRepository.DALGetOwnerFueliInfo(pumpid));
 }
Beispiel #29
0
 public static decimal BALGetDistanceFare(string from, string to)
 {
     return(WayBillRepository.DALGetDistanceFare(from, to));
 }
Beispiel #30
0
 public static List <CouponDetails> BALGetAllWayBillCouponDetails(int waybillbookno, int waybillserialno)
 {
     return(WayBillRepository.GetAllWayBillCouponDetails(waybillbookno, waybillserialno).ToList());
 }