public int InsertPaymentRanges(PaymentRanges objPaymentRanges)
        {
            objPaymentRanges.PaymentRangeID = 1;
            BeginTransaction();

            try
            {
                objPaymentRanges.PaymentRangeID = Insert(objPaymentRanges);
                CommitTransaction();
            }
            catch (Exception ex)
            {
                RollBackTransaction();
                objPaymentRanges.PaymentRangeID = -1;
            }

            return objPaymentRanges.PaymentRangeID;
        }
Example #2
0
        protected void gvPaymentRange_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            hfPaymentRangeID.Value = e.CommandArgument.ToString();
            PaymentRanges objPaymentRanges = new PaymentRanges();

            if (e.CommandName.Equals("cmdEdit"))
            {
                objPaymentRanges = PaymentRangesBO.GetPaymentRanges(Convert.ToInt32(e.CommandArgument));
                txtPaymentRangeDesc.Text = objPaymentRanges.PaymentRangeDesc;
            }
            else if (e.CommandName.Equals("cmdDelete"))
            {
                int PaymentRangeID = Convert.ToInt32(e.CommandArgument);
                objPaymentRanges.PaymentRangeID = PaymentRangeID;
                objPaymentRanges.Status = 0;
                PaymentRangesBO.DeletePaymentRanges(objPaymentRanges);
                loadPaymentRanges();
            }
        }
        public int DeletePaymentRanges(PaymentRanges objPaymentRanges)
        {
            int rowsaffected = -1;
            BeginTransaction();
            try
            {
                String[] UpdateProperties = new String[] { "Status" };
                rowsaffected = Update(objPaymentRanges, UpdateProperties);

                CommitTransaction();
            }
            catch (Exception e)
            {
                RollBackTransaction();
                rowsaffected = -1;
            }
            return rowsaffected;

        }
Example #4
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            PaymentRanges objPaymentRanges = new PaymentRanges();
            objPaymentRanges.PaymentRangeDesc = txtPaymentRangeDesc.Text;
            objPaymentRanges.Status = 1;

            if (!string.IsNullOrEmpty(hfPaymentRangeID.Value.ToString()))
            {
                objPaymentRanges.UpdatedBy = UserAuthentication.GetUserId(this.Page);
                objPaymentRanges.UpdatedDate = DateTime.Now;
                objPaymentRanges.PaymentRangeID = Convert.ToInt32(hfPaymentRangeID.Value);
                objPaymentRanges.PaymentRangeDesc = txtPaymentRangeDesc.Text;
                PaymentRangesBO.UpdatePaymentRanges(objPaymentRanges);
            }
            else
            {
                objPaymentRanges.CreatedBy = UserAuthentication.GetUserId(this.Page);
                objPaymentRanges.CreatedDate = DateTime.Now;
                PaymentRangesBO.InsertPaymentRanges(objPaymentRanges);
            }

            txtPaymentRangeDesc.Text = string.Empty;
            loadPaymentRanges();
        }
 public static int DeletePaymentRanges(PaymentRanges objPaymentRanges)
 {
     return new PaymentRangesDAO().DeletePaymentRanges(objPaymentRanges);
 }
 public static int UpdatePaymentRanges(PaymentRanges objPaymentRanges)
 {
     return new PaymentRangesDAO().UpdatePaymentRanges(objPaymentRanges);
 }
 public static PaymentRanges GetPaymentRanges(int PaymentRangeID)
 {
     PaymentRanges objPaymentRanges = new PaymentRanges();
     return (PaymentRanges)(new PaymentRangesDAO().FillDTO(objPaymentRanges, "PaymentRangeID=" + PaymentRangeID));
 }
 public static int InsertPaymentRanges(PaymentRanges objPaymentRanges)
 {
     return new PaymentRangesDAO().InsertPaymentRanges(objPaymentRanges);
 }