Esempio n. 1
0
 public string FindOrdersInfo(char type, int id)
 {
     if (type == 'C')
     {
         var rdg = new RDGs.RGDtblCompanyOrders(this.session.ConnectionString);
         return(rdg.Find(id).DescriptionTask);
     }
     else if (type == 'P')
     {
         var rdg = new RDGs.RDGtblPrivetOrders(this.session.ConnectionString);
         return(rdg.Find(id).DescriptionTask);
     }
     else
     {
         throw new ArgumentException("Type");
     }
 }
Esempio n. 2
0
        public bool PrivetOrdersUpdate(int orderId, int createById, int customerId, string descriptionTask, double hourUse,
                                       double paidHour, int toAcc, DateTime taskDate)
        {
            var rdg = new RDGs.RDGtblPrivetOrders(this.session.ConnectionString);

            var newOrder = new InterfaceAdaptor.PrivetOrder()
            {
                InvoiceNo = orderId,
                CreateBy  = new InterfaceAdaptor.Worker()
                {
                    WorkNo = createById
                },
                CreateDate = DateTime.Now,
                Customer   = new InterfaceAdaptor.PrivetCustomer()
                {
                    PrivateCustomersNo = customerId
                },
                DescriptionTask = descriptionTask,
                HourUse         = hourUse,
                Paid            = false,
                PaidHour        = paidHour,
                PaidToAcc       = toAcc,
                TaskDate        = taskDate
            };

            try
            {
                rdg.Update(newOrder);
            }
            catch (Exception)
            {
                return(false);
            }

            for (int i = 0; i < this.privetOrders.Count; i++)
            {
                if (this.privetOrders.GetAt(i).InvoiceNo == orderId)
                {
                    this.privetOrders.Update(rdg.Find(newOrder.InvoiceNo), i);
                    break;
                }
            }

            return(true);
        }
Esempio n. 3
0
        public bool PrivetOrdersAdd(int createById, int customerId, string descriptionTask, double hourUse,
                                    double paidHour, int toAcc, DateTime taskDate)
        {
            var rdg = new RDGs.RDGtblPrivetOrders(this.session.ConnectionString);

            var newOrder = new InterfaceAdaptor.PrivetOrder()
            {
                CreateBy = new InterfaceAdaptor.Worker()
                {
                    WorkNo = createById
                },
                CreateDate = DateTime.Now,
                Customer   = new InterfaceAdaptor.PrivetCustomer()
                {
                    PrivateCustomersNo = customerId
                },
                DescriptionTask = descriptionTask,
                HourUse         = hourUse,
                Paid            = false,
                PaidHour        = paidHour,
                PaidToAcc       = toAcc,
                TaskDate        = taskDate
            };

            try
            {
                rdg.Add(newOrder);
            }
            catch (Exception)
            {
                return(false);
            }

            this.privetOrders.Add(rdg.Find(rdg.NextId - 1));

            return(true);
        }
Esempio n. 4
0
        public Interface.IprivetCustomer FindPrivateCustomerBaseOrder(int orderId)
        {
            var rdg = new RDGs.RDGtblPrivetOrders(this.session.ConnectionString);

            return(rdg.Find(orderId).Customer);
        }