Пример #1
0
 protected void txtStDate_TextChanged(object sender, EventArgs e)
 {
     try
     {
         if (txtStDate.Text == "")
         {
             ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "succ_msg", "MessageBox('Error','Please Select Start Date');", true);
         }
         else if (txtDays.Text == "")
         {
             ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "succ_msg", "MessageBox('Error','Please Enter Days');", true);
             txtStDate.Text = "";
         }
         else
         {
             DateTime stDate, endDate;
             stDate          = UtillController.ConvertDateTime(txtStDate.Text);
             endDate         = stDate.AddDays(Convert.ToInt32(txtDays.Text));
             txtEndDate.Text = endDate.ToString("dd/MM/yyyy");
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #2
0
        private void BindDiscalimerValues()
        {
            Membership objMember = DesclaimerController.GetDisclaimerByRFIDNo(RFIDNumber);
            Disclaimer objDis    = DesclaimerController.GetDisclaimerByMemberId(MemberId);

            txtRFIDCardNumber.Text = objDis.RFIDNo;
            objDis.date            = UtillController.ConvertDateTime(Convert.ToDateTime(txtDate.Text).ToString().Substring(0, 10));
            txtHeight.Text         = objDis.height;
            txtWeight.Text         = objDis.weight;
            txtFrameSize.Text      = objDis.frameSize;
            txtName1.Text          = objDis.emergencyRefName1;
            txtRelation1.Text      = objDis.emergencyRefRelationship1;
            txtMobileno1.Text      = objDis.emergencyRefMobNo1;
            txtLandline1.Text      = objDis.emergencyRefLandLineNo1;
            txtArea1.Text          = objDis.emeregencyArea1;
            txtName2.Text          = objDis.emergencyRefName2;
            txtRelation2.Text      = objDis.emergencyRefRelationship2;
            txtMobileno2.Text      = objDis.emergencyRefMobNo2;
            txtLandline2.Text      = objDis.emergencyRefLandLineNo2;
            txtArea2.Text          = objDis.emeregencyArea2;
            txtName3.Text          = objDis.emergencyRefName3;
            txtRelation3.Text      = objDis.emergencyRefRelationship3;
            txtMobileno3.Text      = objDis.emergencyRefMobNo3;
            txtLandline3.Text      = objDis.emergencyRefLandLineNo3;
            txtArea3.Text          = objDis.emeregencyArea3;
            txtFamDocName.Text     = objDis.familyDoctorName;
            txtFamDocNo.Text       = objDis.familyDoctorMobileNumber;
            new DesclaimerController().UpdateDisclaimer(objDis);
        }
Пример #3
0
 protected void txtStDate_TextChanged(object sender, EventArgs e)
 {
     try
     {
         if (txtStDate.Text == "")
         {
             ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "err_msg", "MessageBox('Error','Please select Start Date');", true);
         }
         else
         {
             DateTime StDate  = UtillController.ConvertDateTime(txtStDate.Text);
             DateTime ExpDate = UtillController.ConvertDateTime(txtExpDate.Text);
             DateTime endDate;
             endDate = StDate.AddDays(Convert.ToInt32(txtDays.Text));
             int result = endDate.CompareTo(ExpDate);
             if (result == 1)
             {
                 txtEndDate.Text = ExpDate.ToString("dd/MM/yyyy");
             }
             else
             {
                 txtEndDate.Text = endDate.ToString("dd/MM/yyyy");
             }
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 private void UpdateUserTarget()
 {
     try
     {
         UserTarget objUserTarget = UsersController.GetUserTargetById(UserId);
         objUserTarget.fromDate   = UtillController.ConvertDateTime(txtFromDate.Text);
         objUserTarget.toDate     = UtillController.ConvertDateTime(txtToDate.Text);
         objUserTarget.leadTypeId = Convert.ToInt64(ddlLead.SelectedValue);
         objUserTarget.target     = Convert.ToInt32(txtTarget.Text);
         new UsersController().UpdateUserTarget(objUserTarget);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 private void InsertUserTarget()
 {
     try
     {
         UserTarget objUserTarget = new UserTarget();
         objUserTarget.clubId     = LoginUser.ClubId;
         objUserTarget.userId     = Convert.ToInt64(ddlUser.SelectedValue);
         objUserTarget.fromDate   = UtillController.ConvertDateTime(txtFromDate.Text);
         objUserTarget.toDate     = UtillController.ConvertDateTime(txtToDate.Text);
         objUserTarget.leadTypeId = Convert.ToInt64(ddlLead.SelectedValue);
         objUserTarget.target     = Convert.ToInt32(txtTarget.Text);
         objUserTarget            = new UsersController().InsertUserTarget(objUserTarget);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #6
0
        protected void grdLeadAppointment_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            GridViewRow row         = grdLeadAppointment.Rows[e.RowIndex];
            int         AppointId   = Convert.ToInt32(grdLeadAppointment.DataKeys[e.RowIndex].Values[0]);
            string      remarks     = (row.FindControl("txtAppointRemarks") as TextBox).Text;
            string      AppointDate = (row.FindControl("appointDate") as TextBox).Text;

            using (FitnessCenterEntities entities = new FitnessCenterEntities())
            {
                LeadAppointment leadAppoint = (from c in entities.LeadAppointments
                                               where c.ID == AppointId
                                               select c).FirstOrDefault();
                leadAppoint.reasonForNotAttend = remarks;
                leadAppoint.appointmentDate    = UtillController.ConvertDateTime(AppointDate);
                leadAppoint.updateDate         = DateTime.Now;
                entities.SaveChanges();
            }
            grdLeadAppointment.EditIndex = -1;
            this.BindAppoinments();
            grdLeadAppointment.Focus();
        }
Пример #7
0
        protected void grdLeadFollowup_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            GridViewRow row          = grdLeadFollowup.Rows[e.RowIndex];
            int         FollowupId   = Convert.ToInt32(grdLeadFollowup.DataKeys[e.RowIndex].Values[0]);
            string      remarks      = (row.FindControl("txtFolowupRemarks") as TextBox).Text;
            string      followupDate = (row.FindControl("followupDate") as TextBox).Text;

            using (FitnessCenterEntities entities = new FitnessCenterEntities())
            {
                LeadFollowup leadfollowup = (from c in entities.LeadFollowups
                                             where c.ID == FollowupId
                                             select c).FirstOrDefault();
                leadfollowup.Remarks          = remarks;
                leadfollowup.followupDateTime = UtillController.ConvertDateTime(followupDate);
                leadfollowup.updateDate       = DateTime.Now;
                entities.SaveChanges();
            }
            grdLeadFollowup.EditIndex = -1;
            this.BindFollowup();
            grdLeadFollowup.Focus();
        }
        protected void btnContinue_Click(object sender, EventArgs e)
        {
            try
            {
                var        lst           = UsersController.GetUserTargetByDateAndLeadType(Convert.ToInt64(ddlUser.SelectedValue), Convert.ToInt64(ddlLead.SelectedValue), UtillController.ConvertDateTime(txtFromDate.Text).ToString("MM/dd/yyyy"), UtillController.ConvertDateTime(txtToDate.Text).ToString("MM/dd/yyyy"));
                UserTarget objUserTarget = lst[0];

                objUserTarget.fromDate   = UtillController.ConvertDateTime(txtFromDate.Text);
                objUserTarget.toDate     = UtillController.ConvertDateTime(txtToDate.Text);
                objUserTarget.leadTypeId = Convert.ToInt64(ddlLead.SelectedValue);
                objUserTarget.target     = Convert.ToInt32(txtTarget.Text);
                new UsersController().UpdateUserTarget(objUserTarget);
                ScriptManager.RegisterStartupScript(this, this.GetType(), new Guid().ToString(), "MessageBox('Message','Target Save Successfully.'", true);
                txtTarget.Text        = "";
                ddlLead.SelectedIndex = 0;
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #9
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;
     }
 }
Пример #10
0
 protected void txtToDate_TextChanged(object sender, EventArgs e)
 {
     if (txtFromDate.Text == "")
     {
         ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "err_msg", "MessageBox('Error','Please Enter FromDate First..');", true);
         txtToDate.Text = "";
     }
     else
     {
         DateTime frmdate, todate;
         frmdate = UtillController.ConvertDateTime(txtFromDate.Text);
         todate  = UtillController.ConvertDateTime(txtToDate.Text);
         int cmp = DateTime.Compare(frmdate, todate);
         if (cmp == 1)
         {
             ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "err_msg", "MessageBox('Error','Enter ToDate Greater Than FromDate');", true);
             txtToDate.Text = "";
             //todate = frmdate.AddDays(30);
             //txtToDate.Text = todate.ToString("dd/MM/yyyy");
         }
     }
 }
Пример #11
0
 public void UpdateTowelMaster()
 {
     try
     {
         TowelHiringMaster objTowelMember = AssignTowelController.GetAssignedTowelById(TowelMasterId);
         objTowelMember.towelPackageId   = Convert.ToInt64(drpTowelPackages.SelectedValue);
         objTowelMember.memberId         = Convert.ToInt64(drpMembers.SelectedValue);
         objTowelMember.startDate        = UtillController.ConvertDateTime(txtStDate.Text);
         objTowelMember.endDate          = UtillController.ConvertDateTime(txtEndDate.Text);
         objTowelMember.hiringTimeUpdate = Convert.ToInt32(txtHiringTime.Text);
         objTowelMember.amount           = Convert.ToDecimal(txtAmt.Text);
         objTowelMember.paymentMode      = null;
         objTowelMember.chequeDate       = null;
         objTowelMember.chequeNo         = objTowelMember.bankName = objTowelMember.branchDetails = null;
         objTowelMember.isPaid           = false;
         objTowelMember = new AssignTowelController().UpdateTowelMember(objTowelMember);
         ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "succ_msg", "MessageBox('Success','Package Updated Successfully');", true);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #12
0
 public void InsertRecharge()
 {
     try
     {
         MemberJuiceMaster objMemberJuice = new MemberJuiceMaster();
         objMemberJuice.memberId        = MemberId;
         objMemberJuice.rechargeAmount  = Convert.ToDecimal(txtAmount.Text);
         objMemberJuice.validDays       = Convert.ToInt32(txtDays.Text);
         objMemberJuice.startDate       = UtillController.ConvertDateTime(txtStDate.Text);
         objMemberJuice.endDate         = UtillController.ConvertDateTime(txtEndDate.Text);
         objMemberJuice.discount        = Convert.ToDecimal(txtDiscount.Text);
         objMemberJuice.finalAmount     = Convert.ToDecimal(txtFinalAmt.Text);
         objMemberJuice.availableAmount = Convert.ToDecimal(txtTotalAmt.Text);
         objMemberJuice.payMode         = null;
         objMemberJuice.isPaid          = false;
         objMemberJuice = new JuiceRechargeController().InsertJuiceRecharge(objMemberJuice);
         ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "succ_msg", "MessageBox('Success','Recharge Successfully');", true);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #13
0
        private void UpdateUserScheme()
        {
            try
            {
                SchemeMaster objUserScheme = UserSchemeMasterController.GetUserSchemeMasterByID(UserSchemeID);
                objUserScheme.PackageId         = Convert.ToInt64(ddlPackageS.SelectedValue);
                objUserScheme.SchemeName        = txtUserschemeName.Text;
                objUserScheme.JoiningFee        = Convert.ToDecimal(txtJoinFee.Text);
                objUserScheme.AdminFee          = Convert.ToDecimal(txtAdminFee.Text);
                objUserScheme.MemberFee         = Convert.ToDecimal(txtMemFee.Text);
                objUserScheme.PTFee             = Convert.ToDecimal(txtPersTraining.Text);
                objUserScheme.SGST              = Convert.ToDecimal(txtService.Text);
                objUserScheme.CGST              = Convert.ToDecimal(txtService.Text);
                objUserScheme.TotalAmount       = Convert.ToDecimal(txtTotAmt.Text);
                objUserScheme.AdditionalExpense = Convert.ToDecimal(0);
                objUserScheme.StartDate         = UtillController.ConvertDateTime(txtStrDate.Text);
                objUserScheme.EndDate           = UtillController.ConvertDateTime(txtEndDate.Text);
                objUserScheme.StartTime         = ddlStartTime.SelectedValue;
                objUserScheme.EndTime           = ddlEndTime.SelectedValue;
                if (txtCanclDays.Text.Equals(""))
                {
                    objUserScheme.CancelDays = null;
                }
                else
                {
                    objUserScheme.CancelDays = Convert.ToInt32(txtCanclDays.Text);
                }
                objUserScheme.DowngradeDays = Convert.ToInt32(txtDwnGrdDays.Text);
                objUserScheme.UpgradeDays   = Convert.ToInt32(txtUpgrdDays.Text);
                new UserSchemeMasterController().UpdateUserScheme(objUserScheme);

                if (chkAllowCancelation.Checked)
                {
                    CancellationMaster objCancel = UserSchemeMasterController.GetCancellationBySchemeId(UserSchemeID);
                    if (objCancel != null)
                    {
                        objCancel.schemeId             = UserSchemeID;
                        objCancel.joiningFee           = chkJoining.Checked;
                        objCancel.adminFee             = chkAdmin.Checked;
                        objCancel.membershipFee        = chkMembership.Checked;
                        objCancel.personalTrainingPack = chkPTP.Checked;
                        new UserSchemeMasterController().UpdateCancelMaster(objCancel);
                    }
                    else
                    {
                        objCancel                      = new CancellationMaster();
                        objCancel.schemeId             = UserSchemeID;
                        objCancel.joiningFee           = chkJoining.Checked;
                        objCancel.adminFee             = chkAdmin.Checked;
                        objCancel.membershipFee        = chkMembership.Checked;
                        objCancel.personalTrainingPack = chkPTP.Checked;
                        new UserSchemeMasterController().InsertCancelMaster(objCancel);
                    }
                }
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "succ_msg", "MessageBox('Success','Data Updated');", true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #14
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         if (ddlLead.SelectedValue == "0")
         {
             lblErrorMsg.Text = "PLease Select Any LeadType";
         }
         else
         {
             lblErrorMsg.Text = "";
             if (Mode == "Insert")
             {
                 var lst = UsersController.GetUserTargetByDateAndLeadType(Convert.ToInt64(ddlUser.SelectedValue), Convert.ToInt64(ddlLead.SelectedValue), UtillController.ConvertDateTime(txtFromDate.Text).ToString("MM/dd/yyyy"), UtillController.ConvertDateTime(txtToDate.Text).ToString("MM/dd/yyyy"));
                 if (lst.Count > 0)
                 {
                     ScriptManager.RegisterStartupScript(this, this.GetType(), new Guid().ToString(), "MessageBoxForAnotherPopup('Message','You have already given target for the same date and same leadtype.','" + btnContinue.ClientID + "');", true);
                 }
                 else
                 {
                     InsertUserTarget();
                     ScriptManager.RegisterStartupScript(this, this.GetType(), new Guid().ToString(), "MessageBox('Message','Target Save Successfully.');", true);
                     txtTarget.Text        = "";
                     ddlLead.SelectedIndex = 0;
                 }
             }
             else
             {
                 UpdateUserTarget();
                 //ClearValues();
                 //PanelVisibility(true, false);
                 //BindGrid(Convert.ToInt64(ddlUser.SelectedValue));
                 txtTarget.Text        = "";
                 ddlLead.SelectedIndex = 0;
             }
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }