Exemple #1
0
        public void BindValues()
        {
            try
            {
                PTPMemberMaster objPTPMember = AssignPTPController.GetAssignedPTPByID(PTPMemberMasterId);
                BindMembers();
                BindPTPPackages();

                drpMembers.SelectedValue     = Convert.ToString(objPTPMember.memberId);
                drpPTPPackages.SelectedValue = Convert.ToString(objPTPMember.PTPPackageID);
                drpPTPPackages.Enabled       = drpMembers.Enabled = false;
                //txtStDate.Text = ((DateTime)objPTPMember.startDate).ToString("dd/MM/yyyy");
                txtStDate.Text     = ((DateTime)objPTPMember.startDate).ToString("dd/MM/yyyy");
                txtStDate.ReadOnly = true;
                //txtEndDate.Text = ((DateTime)objPTPMember.endDate).ToString("dd/MM/yyyy");
                txtEndDate.Text = ((DateTime)objPTPMember.endDate).ToString("dd/MM/yyyy");

                pnlAssignValues.Visible = true;
                PTPPackageId            = Convert.ToInt64(drpPTPPackages.SelectedValue);
                txtSesRem.Text          = BindSession();
                BindPTPPackagesValues();

                MemberId = Convert.ToInt64(drpMembers.SelectedValue);
                BindMemberValues();

                chkPaidRet.Checked = objPTPMember.isPaid;
                if (chkPaidRet.Checked)
                {
                    pnlPayment.Visible = true;
                    BindPayMode();
                    rblPayMode.SelectedValue = Convert.ToString(objPTPMember.payMode);
                    rblPayMode.Enabled       = chkPaidRet.Enabled = false;
                    if (rblPayMode.SelectedValue == "2")
                    {
                        pnlChqDetails.Visible = true;
                        txtChqDate.Text       = Convert.ToString(objPTPMember.chequeDate);
                        txtChqNo.Text         = objPTPMember.chequeNo;
                        txtBankName.Text      = objPTPMember.bankName;
                        txtBranchDetails.Text = objPTPMember.branchDetails;
                        foreach (Control ctrl in pnlChqDetails.Controls)
                        {
                            if (ctrl is TextBox)
                            {
                                ((TextBox)ctrl).ReadOnly = true;
                            }
                        }
                    }
                    else
                    {
                        pnlChqDetails.Visible = false;
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #2
0
 public void InsertTransaction()
 {
     try
     {
         PTPMemberMaster      objPTPMember = AssignPTPController.GetAssignedPTPByID(PTPMemberMasterId);
         PTPMemberTransaction objPTPTrans  = new PTPMemberTransaction();
         long session = 0;
         objPTPTrans.PTPMemberMasterId = PTPMemberMasterId;
         objPTPTrans.memberId          = MemberId;
         objPTPTrans = new AssignPTPController().InsertTransaction(objPTPTrans);
         session     = objPTPMember.sessionCount - 1;
         objPTPMember.sessionCount = session;
         objPTPMember = new AssignPTPController().UpdatePTPMember(objPTPMember);
         ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "succ_msg", "MessageBox('Success','Session Added Successfully');", true);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemple #3
0
 public void UpdatePTPMembers()
 {
     try
     {
         PTPMemberMaster objPTPMember = AssignPTPController.GetAssignedPTPByID(PTPMemberMasterId);
         objPTPMember.PTPPackageID = Convert.ToInt64(drpPTPPackages.SelectedValue);
         objPTPMember.memberId     = Convert.ToInt64(drpMembers.SelectedValue);
         //objPTPMember.startDate =UtillController.ConvertDateTime(txtStDate.Text);
         //objPTPMember.endDate =UtillController.ConvertDateTime(txtEndDate.Text);
         objPTPMember.startDate    = UtillController.ConvertDateTime(txtStDate.Text);
         objPTPMember.endDate      = UtillController.ConvertDateTime(txtEndDate.Text);
         objPTPMember.sessionCount = Convert.ToInt64(txtSesRem.Text);
         objPTPMember.amount       = Convert.ToDecimal(txtAmt.Text);
         if (rblPayMode.SelectedValue == "")
         {
             objPTPMember.payMode = 0;
         }
         else
         {
             objPTPMember.payMode = Convert.ToInt64(rblPayMode.SelectedValue);
         }
         objPTPMember.chequeDate = null;
         objPTPMember.chequeNo   = objPTPMember.bankName = objPTPMember.branchDetails = null;
         if (rblPayMode.SelectedValue == "2")
         {
             objPTPMember.chequeDate    = UtillController.ConvertDateTime(txtChqDate.Text);
             objPTPMember.chequeNo      = txtChqNo.Text;
             objPTPMember.bankName      = txtBankName.Text;
             objPTPMember.branchDetails = txtBranchDetails.Text;
         }
         objPTPMember.isPaid = chkPaidRet.Checked;
         objPTPMember        = new AssignPTPController().UpdatePTPMember(objPTPMember);
         ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "succ_msg", "MessageBox('Success','Package Assigned Successfully');", true);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemple #4
0
 protected void grdAssignedPackages_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     try
     {
         if (e.CommandName == "DetailPTPMember")
         {
             PTPMemberMasterId = Convert.ToInt32(e.CommandArgument);
             PTPMemberMaster objPTPMember = AssignPTPController.GetAssignedPTPByID(PTPMemberMasterId);
             MemberId = objPTPMember.memberId;
             PanelVisibility(false, false, true);
             BindTransaction();
         }
         else if (e.CommandName == "EditPTPMember")
         {
             Mode = "Update";
             PTPMemberMasterId = Convert.ToInt32(e.CommandArgument);
             PTPMemberMaster objPTPMember = AssignPTPController.GetAssignedPTPByID(PTPMemberMasterId);
             MemberId = objPTPMember.memberId;
             PanelVisibility(false, true, false);
             BindValues();
         }
         else if (e.CommandName == "DeletePTPMember")
         {
             PTPMemberMasterId = Convert.ToInt32(e.CommandArgument);
             PTPMemberMaster objPTPMember = AssignPTPController.GetAssignedPTPByID(PTPMemberMasterId);
             MemberId = objPTPMember.memberId;
             new AssignPTPController().DeletePTPMember(PTPMemberMasterId);
             BindGrid();
             ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "succ_msg", "MessageBox('Success','Data Deleted Successfully');", true);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }