protected void btnadd_Click(object sender, EventArgs e) { tblAllottee _allotte = Allottee.GetAllottee(txtQuarterNumber.Text); if (_allotte != null) { decimal charge = 0; decimal.TryParse(txtDamageCharge.Text, out charge); tbquarterDamage quarterDamage = new tbquarterDamage(); quarterDamage.AAN = _allotte.AAN; quarterDamage.DamageCharges = charge; quarterDamage.Assementdate = Convert.ToDateTime(txtMonth.Text); quarterDamage.Quarternumber = _allotte.tblQuarter.QuarterNumber; quarterDamage.Remarks = txtRemarks.Text; Quarters.AddQuarterDamage(quarterDamage); lblmessage.Text = "Information saved sucessfully!"; lblmessage.Visible = true; empty(); tbluserhistory _userhistory = new tbluserhistory(); _userhistory.Action = "Licence fee"; _userhistory.description = _user.Username + " has added quarter damage charges for quarter " + _allotte.tblQuarter.QuarterNumber; _userhistory.time = DateTime.Now; _userhistory.useraan = _user.AAN; userHistory.Save(_userhistory); } else { lblmessage.Text = "This quarter is not allotted to anyone yet"; lblmessage.Visible = true; } }
public void btnSaveRetension_click(object sender, EventArgs e) { long id = Convert.ToInt64(hdnselected.Value); tblAllottee _allotte = Allottee.GetAllottee(id); if (_allotte != null) { DateTime dateofRetension; DateTime.TryParse(txtDateOfRetension.Text, out dateofRetension); DateTime dateofRetensionupto; DateTime.TryParse(txtdateofretensionupto.Text, out dateofRetensionupto); _allotte.DateOfRetensionUpto = dateofRetensionupto; _allotte.Status = (int)AllotementStatus.Retension; _allotte.DateOfRetension = dateofRetension; _allotte.RetentionReason = ddlRetentionRule.SelectedValue; Allottee.Update(_allotte); BindData(); Quarters.UpdateQuarterStatus(_allotte.tblQuarter.Id, QuarterStatus.Vacant); tbluserhistory _userhistory = new tbluserhistory(); _userhistory.Action = "Allotement"; _userhistory.description = _user.Username + " has marked vacant with id " + id; _userhistory.time = DateTime.Now; _userhistory.useraan = _user.AAN; userHistory.Save(_userhistory); } }
private void BindData() { tblAllottee quarter = Allottee.GetAllottee(id); if (quarter != null) { // //drpDesignation.SelectedValue = quarter.Designation.ToString(); tblUser user = Users.getUserByAAN(quarter.AAN); drpQuarterCatergory.SelectedValue = quarter.tblQuarter.Category.ToString(); drpOffice.SelectedValue = user.BaseOfficeId.ToString(); txtAllotteeName.Text = user.AAN; if (user.DateOfRetirement.HasValue) { txtDor.Text = user.DateOfRetirement.Value.ToShortDateString(); } if (user.DateOfJoining.HasValue) { txtDoj.Text = user.DateOfJoining.Value.ToShortDateString(); } bindQuarter(); drpQuarter.SelectedValue = quarter.QuarterNumber; drpQuarterCatergory.Enabled = false; drpOffice.Enabled = false; drpDesignation.Enabled = false; } }
protected void btnadd_Click(object sender, EventArgs e) { tblAllottee _allotte = Allottee.GetAllottee(txtQuarterNumber.Text); if (_allotte != null) { tbQuarterLicenceFee fee = new tbQuarterLicenceFee(); fee.AAN = _allotte.AAN; fee.ActualFee = 0; fee.Fee = Convert.ToDecimal(txtLicenceFee.Text); fee.Month = Convert.ToDateTime(txtMonth.Text); fee.QuarterId = _allotte.tblQuarter.Id; fee.ActualFee = LicenceFee.GetLicenceFeebyCategory(_allotte.tblQuarter.Category); fee.Remarks = txtRemarks.Text; LicenceFee.SaveMonthLicencefee(fee); lblmessage.Text = "Information saved sucessfully!"; lblmessage.Visible = true; empty(); tbluserhistory _userhistory = new tbluserhistory(); _userhistory.Action = "Licence fee"; _userhistory.description = _user.Username + " has added Licence fee for quarter " + _allotte.tblQuarter.QuarterNumber; _userhistory.time = DateTime.Now; _userhistory.useraan = _user.AAN; userHistory.Save(_userhistory); } else { lblmessage.Text = "This quarter is not allotted to anyone yet"; lblmessage.Visible = true; } }
protected void QuarterNumber_change(object sender, EventArgs e) { tblAllottee _allotte = Allottee.GetAllottee(txtQuarterNumber.Text); if (_allotte != null) { tblUser _user = Users.getUserByAAN(_allotte.AAN); if (_user.designation.HasValue) { drpDesignation.SelectedValue = _user.designation.Value.ToString(); } if (_user.BaseOfficeId.HasValue) { drpOffice.SelectedValue = _user.BaseOfficeId.Value.ToString(); } txtAllotteeAAN.Text = _allotte.AAN; txtUserName.Text = _user.fullName; drpQuarterCatergory.SelectedValue = _allotte.tblQuarter.tblQuarterCategory.Id.ToString(); tblQuarterCategoryFee fee = LicenceFee.GetQuarterCategeryFee(_allotte.tblQuarter.tblQuarterCategory.Id); if (fee != null && fee.LicenceFee.HasValue) { txtLicenceFee.Text = fee.LicenceFee.Value.ToString(); } } else { lblmessage.Text = "This quarter is not allotted to anyone yet"; lblmessage.Visible = true; btnAddUpdate.Enabled = false; } }
public void grdAllotte_command(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "vacant") { long id = Convert.ToInt64(e.CommandArgument); hdnselected.Value = id.ToString(); //Allottee.VacantAllottement(id); //BindData(); //tbluserhistory _userhistory = new tbluserhistory(); //_userhistory.Action = "Allotement"; //_userhistory.description = _user.Username + " has marked vacant with id " + id; //_userhistory.time = DateTime.Now; //_userhistory.useraan = _user.AAN; //userHistory.Save(_userhistory); tblAllottee _allotte = Allottee.GetAllottee(Convert.ToInt64(e.CommandArgument)); txtName.Text = AllotementApplications.GetApplication(_allotte.ApplicationId.Value).tblUser.fullName; txtQuarternumber.Text = _allotte.QuarterNumber; popVacant.Show(); } else if (e.CommandName == "Retention") { long id = Convert.ToInt64(e.CommandArgument); tblAllottee _allotte = Allottee.GetAllottee(Convert.ToInt64(e.CommandArgument)); txtRetName.Text = AllotementApplications.GetApplication(_allotte.ApplicationId.Value).tblUser.fullName; txtRetQuarerNumber.Text = _allotte.QuarterNumber; txtDateOfRetension.Text = string.Empty; txtdateofretensionupto.Text = string.Empty; txtRemarks.Text = string.Empty; ddlRetentionPeriod.SelectedIndex = -1; ddlRetentionRule.SelectedIndex = -1; hdnselected.Value = id.ToString(); ModalPopupExtender1.Show(); } }
protected void btnadd_Click(object sender, EventArgs e) { tblQuarter _quarter = Quarters.GetQuarter(txtQuarterNumber.Text); if (_quarter != null) { pnl.Visible = true; drpQuarterCatergory.SelectedValue = _quarter.tblQuarterCategory.Id.ToString(); grdLicenceFee.DataSource = LicenceFee.GetLicencefee(txtQuarterNumber.Text); grdLicenceFee.DataBind(); } else { lblmessage.Text = "Invalid quarter"; lblmessage.Visible = true; return; } tblAllottee _allotte = Allottee.GetAllottee(txtQuarterNumber.Text); if (_allotte != null) { tblUser _user = Users.getUserByAAN(_allotte.AAN); if (_user.designation.HasValue) { drpDesignation.SelectedValue = _user.designation.Value.ToString(); } if (_user.BaseOfficeId.HasValue) { drpOffice.SelectedValue = _user.BaseOfficeId.Value.ToString(); } txtAllotteName.Text = _user.fullName; txtAllotteeAAN.Text = _allotte.AAN; if (_allotte.DateOfPossession.HasValue) { txtDateOfPossession.Text = _allotte.DateOfPossession.Value.ToShortDateString(); } if (_allotte.DateOfVacation.HasValue) { txtActualDateOfVacation.Text = _allotte.DateOfVacation.Value.ToShortDateString(); } if (_allotte.DateOfRetension.HasValue) { txtDueDateOfVacation.Text = _allotte.DateOfRetension.Value.AddMonths(8).ToShortDateString(); } txtRetentionPeriod.Text = "8"; tbluserhistory _userhistory = new tbluserhistory(); _userhistory.Action = "Licence fee"; _userhistory.description = _user.Username + " has added Licence fee for quarter " + _allotte.tblQuarter.QuarterNumber; _userhistory.time = DateTime.Now; _userhistory.useraan = _user.AAN; userHistory.Save(_userhistory); } }
protected void QuarterNumber_change(object sender, EventArgs e) { tblAllottee _allotte = Allottee.GetAllottee(txtQuarterNumber.Text); if (_allotte != null) { tblUser _user = Users.getUserByAAN(_allotte.AAN); txtAllotteeAAN.Text = _allotte.AAN; } else { lblmessage.Text = "This quarter is not allotted to anyone yet"; lblmessage.Visible = true; btnAddUpdate.Enabled = false; } }
protected void btnVacant_click(object sender, EventArgs e) { int id = Convert.ToInt32(hdnselected.Value); tblAllottee _allotte = Allottee.GetAllottee(id); if (_allotte != null) { DateTime dateofVacation; DateTime.TryParse(txtDateOfVacation.Text, out dateofVacation); _allotte.Status = (int)AllotementStatus.vacant; _allotte.DateOfVacation = dateofVacation; Allottee.Update(_allotte); BindData(); Quarters.UpdateQuarterStatus(_allotte.tblQuarter.Id, (int)QuarterStatus.Vacant, "Quarter marked as vacant.", txtDateOfVacation.Text); tbluserhistory _userhistory = new tbluserhistory(); _userhistory.Action = "Allotement"; _userhistory.description = _user.Username + " has marked vacant with id " + id; _userhistory.time = DateTime.Now; _userhistory.useraan = _user.AAN; userHistory.Save(_userhistory); } }
protected void btnadd_Click(object sender, EventArgs e) { tblAllottee _Allottee = null; if (id > 0) { _Allottee = Allottee.GetAllottee(id); } else { tblAllottee a = Allottee.GetAllotteeByAAN(txtAllotteeName.Text); if (a != null) { _Allottee = a; //lblmessage.Text = "User has already allotted quarter!"; //lblmessage.Visible = true; //return; } if (a == null) { _Allottee = new tblAllottee(); } tblQuarter quarter = Quarters.GetQuarter(drpQuarter.SelectedValue); if (quarter == null) { lblmessage.Text = "Please enter valid number"; lblmessage.Visible = true; return; } else if (quarter.Status.HasValue && quarter.Status != (int)QuarterStatus.Vacant) { lblmessage.Text = "Quarter is not vacant!"; lblmessage.Visible = true; return; } quarter.DateOfAllottement = DateTime.Now; quarter.Status = (int)QuarterStatus.Alloted; Quarters.Save(quarter); //_Allottee = new tblAllottee(); } _Allottee.QuarterNumber = drpQuarter.SelectedValue; _Allottee.AAN = txtAllotteeName.Text; _Allottee.ApplicationId = applicationid; _Allottee.Status = btnAddUpdate.Text == "Add Change Request" ? (int)AllotementStatus.ChangeRequested : (int)AllotementStatus.Possessed; _Allottee.DateOfAllotement = DateTime.Now; //_Allottee.OfficeId = Convert.ToInt32(drpOffice.SelectedValue); //_Allottee.Designation =Convert.ToInt32( drpDesignation.SelectedValue); //_Allottee.DateOfJoining = Convert.ToDateTime(txtDoj.Text); //_Allottee.DateOfRetirement = Convert.ToDateTime(txtDor.Text); //_Allottee.Name = txtAllotteeName.Text; tbluserhistory _userhistory = new tbluserhistory(); _userhistory.Action = "Allotement"; _userhistory.description = _user.Username + " has allotted quarter " + _Allottee.QuarterNumber + " to user " + _Allottee.AAN; _userhistory.time = DateTime.Now; _userhistory.useraan = _user.AAN; userHistory.Save(_userhistory); Allottee.Save(_Allottee); if (applicationid > 0) { AllotementApplications.UpdateApplicationStaus(applicationid, btnAddUpdate.Text == "Add Change Request" ? ApplicationStatus.ChangeRequested : ApplicationStatus.Allotted); } if (!string.IsNullOrEmpty(Request["returnurl"])) { Response.Redirect("~/" + Request["returnurl"]); } else { Response.Redirect("~/admin/Allottees.aspx"); } }