public void BindGrid() { try { grdPackages.DataSource = TowelPackageController.GetTowelPackages(SortDir, SortField, txtSearch.Text, LoginUser.ClubId); grdPackages.DataBind(); } catch (Exception ex) { throw ex; } }
public void BindTowelPacakgesValues() { try { TowelHiringPackage objTowelPackage = TowelPackageController.GetTowelPackageById(TowelPackageId); txtDays.Text = Convert.ToString(objTowelPackage.numberOfDays); txtHiringTime.Text = Convert.ToString(objTowelPackage.hiringTime); txtFees.Text = Convert.ToString(objTowelPackage.amount); } catch (Exception ex) { throw ex; } }
public void BindValues() { try { TowelHiringPackage objTowel = TowelPackageController.GetTowelPackageById(PackageId); txtPackageName.Text = objTowel.packageName; txtFees.Text = Convert.ToString(objTowel.amount); txtDays.Text = Convert.ToString(objTowel.numberOfDays); txtHiringTime.Text = Convert.ToString(objTowel.hiringTime); txtDepositAmt.Text = Convert.ToString(objTowel.depositAmount); } catch (Exception ex) { throw ex; } }
public void UpdatePackages() { try { TowelHiringPackage objTowel = TowelPackageController.GetTowelPackageById(PackageId); objTowel.packageName = txtPackageName.Text; objTowel.amount = Convert.ToDecimal(txtFees.Text); objTowel.depositAmount = Convert.ToDecimal(txtDepositAmt.Text); objTowel.numberOfDays = Convert.ToInt32(txtDays.Text); objTowel.hiringTime = Convert.ToInt32(txtHiringTime.Text); new TowelPackageController().UpdatePackage(objTowel); //ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "succ_msg", "MessageBox('Success','Package Updated Successfully');", true); } catch (Exception ex) { throw ex; } }
public void UpdateDeposit() { try { List <TowelHiringPackage> lstTowel = new List <TowelHiringPackage>(); lstTowel = (List <TowelHiringPackage>)grdPackages.DataSource; if (lstTowel != null && lstTowel.Count > 0) { foreach (var obj in lstTowel) { TowelHiringPackage objTowel = TowelPackageController.GetTowelPackageById(obj.ID); objTowel.depositAmount = Convert.ToDecimal(txtDepositAmt.Text); new TowelPackageController().UpdatePackage(objTowel); } } } catch (Exception ex) { throw ex; } }
public string BindHiringTime() { try { int Trans = 0; long HiringTime = 0; TowelHiringPackage objTowelPackage = TowelPackageController.GetTowelPackageById(TowelPackageId); txtAmt.Text = Convert.ToString(objTowelPackage.amount); HiringTime = objTowelPackage.hiringTime; if (AssignTowelController.GetTransByMemberAndTowelMasterId(MemberId, TowelMasterId) != null) { Trans = AssignTowelController.GetTransByMemberAndTowelMasterId(MemberId, TowelMasterId).Count; HiringTime = HiringTime - Trans; } return(HiringTime.ToString()); } catch (Exception ex) { throw ex; } }
protected void btnSave_Click(object sender, EventArgs e) { try { if (Mode == "Insert") { if (!TowelPackageController.IsNameExists(txtPackageName.Text)) { InsertPackages(); BindGrid(); UpdateDeposit(); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "succ_msg", "MessageBox('Success','Package Added Successfully');", true); BindGrid(); ClearValues(); PanelVisibility(true, false); } else { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "err_msg", "MessageBox('Error','Package Name Already Exists');", true); } } else { UpdatePackages(); BindGrid(); UpdateDeposit(); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "succ_msg", "MessageBox('Success','Package Updated Successfully');", true); BindGrid(); ClearValues(); PanelVisibility(true, false); } } catch (Exception ex) { throw ex; } }