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; } }
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 QuarterCategory_selectedindex(object sender, EventArgs e) { tblQuarterCategoryFee o = LicenceFee.GetQuarterCategeryFee(Convert.ToInt64(drpQuarterCat.SelectedValue)); if (o != null) { if (o.LicenceFee.HasValue) { txtLicenceFee.Text = o.LicenceFee.Value.ToString(); } } }
protected void btnadd_Click(object sender, EventArgs e) { tblQuarterCategoryFee categoryfee = new tblQuarterCategoryFee(); //categoryfee.LastUpdatedBy = 1; //categoryfee.Month = Convert.ToDateTime(txtmonth.Text); categoryfee.QuarterCategoryId = Convert.ToInt32(drpQuarterCat.SelectedValue); categoryfee.LicenceFee = Convert.ToDouble(txtLicenceFee.Text); categoryfee.EffectiveDate = Convert.ToDateTime(txtEffectiveDate.Text); LicenceFee.Save(categoryfee); tbluserhistory _userhistory = new tbluserhistory(); _userhistory.Action = "Licence fee"; //_userhistory.description = _user.Username + " has added Licence fee for quarter category " + categoryfee.tblQuarterCategory.Name; // Quartercategory name is selected from the drop down, not from database table.. _userhistory.description = _user.Username + " has added Licence fee for quarter category " + drpQuarterCat.SelectedItem.Text; _userhistory.time = DateTime.Now; _userhistory.useraan = _user.AAN; userHistory.Save(_userhistory); lblmessage.Visible = true; lblmessage.Text = "Information saved successfully!"; }