Ejemplo n.º 1
0
 public bool Delete(DepositPayment obj)
 {
     try
     {
         _db.DepositPayments.DeleteOnSubmit(obj);
         _db.SubmitChanges();
     }
     catch (Exception ex)
     {
         Debug.Print(ex.Message);
         return(false);
     }
     return(true);
 }
Ejemplo n.º 2
0
 public bool Update(DepositPayment obj)
 {
     try
     {
         obj.UpdatedDate = DateTime.Now;
         _db.SubmitChanges();
     }
     catch (Exception ex)
     {
         Debug.Print(ex.Message);
         return(false);
     }
     return(true);
 }
Ejemplo n.º 3
0
        public int Add(DepositPayment obj)
        {
            try
            {
                obj.CreatedDate = DateTime.Now;

                _db.DepositPayments.InsertOnSubmit(obj);
                _db.SubmitChanges();
            }
            catch (Exception ex)
            {
                Debug.Print(ex.Message);
                return(-1);
            }
            return(_db.DepositPayments.Max(x => x.DepositPaymentId));
        }
Ejemplo n.º 4
0
        protected void RadGridUnDepositPayment_OnRowDrop(object sender, GridDragDropEventArgs e)
        {
            //if (e.DraggedItems.Count != 0 && RadGridDepositList.SelectedValue != null && e.DestinationGrid == _radGridDepositPayment)
            if (e.DraggedItems.Count != 0 && RadGridDepositList.SelectedValue != null)
            {
                foreach (var dataItem in e.DraggedItems)
                {
                    var cPayDeposit = new CDepositPayment();
                    var payDeposit  = new Erp2016.Lib.DepositPayment();

                    payDeposit.DepositId = Convert.ToInt32(RadGridDepositList.SelectedValue.ToString());
                    payDeposit.PaymentId = Convert.ToInt32(dataItem.GetDataKeyValue("PaymentId").ToString());
                    payDeposit.CreatedId = CurrentUserId;

                    if (cPayDeposit.Add(payDeposit) > 0)
                    {
                        var cPayment = new CPayment();
                        var payment  = cPayment.Get(Convert.ToInt32(dataItem.GetDataKeyValue("PaymentId").ToString()));

                        var cHomestayChkInvoice = new CInvoice();
                        var homestayChkInvoice  = cHomestayChkInvoice.Get(payment.InvoiceId);

                        //if (!string.IsNullOrEmpty(homestayChkInvoice.HomestayRegistrationId.ToString()))
                        //{
                        //    var homestayId = Convert.ToInt32(homestayChkInvoice.HomestayRegistrationId);

                        //    var payOut = new CHomestayPayoutRequest();
                        //    var payId = payOut.GetHomestayId(homestayId);

                        //    var cPout = new CHomestayPayoutRequest();
                        //    var pout = cPout.Get(payId);

                        //    var cPmethod = new CPaymentMethod();
                        //    var pmethod = cPmethod.Get(payId);

                        //    pout.PayoutStatus = 1;

                        //    if (cPout.Update(pout))
                        //    {
                        //        if (true)
                        //        {
                        //            pmethod.PayoutId = payId;
                        //            pmethod.PayoutMethod1 = 0;

                        //            pmethod.SiteLocationId = CurrentSiteLocationId;
                        //            pmethod.CreatedId = CurrentUserId;
                        //            pmethod.CreatedDate = DateTime.Now;

                        //            cPmethod.Add(pmethod);

                        //        }
                        //    }
                        //}
                    }
                }

                ShowMessage("Completed adding payment(s).");
            }
            else
            {
                ShowMessage("Failed adding payment(s).");
            }
        }