protected void ResetForm() { LoadSite(CurrentSiteId); LoadSiteLocation(CurrentSiteId); LoadUserGroup(CurrentSiteId); LoadUserPosition(0); LoadSupervisor(); tbUserID.Text = ""; tbPassWord.Text = ""; tbFName.Text = ""; tbMName.Text = ""; tbLName.Text = ""; tbSIN.Text = ""; tbDOB.SelectedDate = null; tbAge.Text = ""; ddlMarital.SelectedValue = ""; ddlGender.SelectedValue = ""; tbWEmail.Text = ""; tbWPhone.Text = ""; RadComboBoxSite.SelectedValue = CurrentSiteId.ToString(); RadComboBoxSiteLocation.SelectedValue = CurrentSiteLocationId.ToString(); RadComboBoxUserGroup.SelectedValue = ""; RadComboBoxUserPosition.SelectedValue = ""; RadComboBoxSuper.SelectedValue = ""; tbEmpNo.Text = ""; cbActive.Checked = true; tbPAddess1.Text = ""; tbPAddess2.Text = ""; tbPCity.Text = ""; tbPProvince.Text = ""; tbPPostal.Text = ""; tbPHomePhone.Text = ""; tbPCell.Text = ""; tbPEmail.Text = ""; tbEName.Text = ""; tbERelation.Text = ""; tbEPhone.Text = ""; tbEAddress.Text = ""; tbUserID.Enabled = true; RadComboBoxSite.Enabled = true; RadComboBoxSiteLocation.Enabled = true; tbEmpNo.Enabled = true; RadBinaryImagePicture.DataValue = null; RadBinaryImagePicture.Visible = false; if (RadToolBarUser.FindItemByText("New") != null) { RadToolBarUser.FindItemByText("New").Enabled = false; } if (RadToolBarUser.FindItemByText("Update") != null) { RadToolBarUser.FindItemByText("Update").Text = @"Save"; } }
protected void Dropdown_ShcoolList() { ddlSchoolName.Items.Clear(); var cglobal = new CGlobal(); ddlSchoolName.DataSource = cglobal.LoadSchoolList(CurrentUserId); ddlSchoolName.DataTextField = "Name"; ddlSchoolName.DataValueField = "Value"; ddlSchoolName.SelectedValue = CurrentSiteLocationId.ToString(); ddlSchoolName.DataBind(); }
protected void LoadSiteLocation(int siteId) { var global = new CGlobal(); RadComboBoxSiteLocation.Items.Clear(); RadComboBoxSiteLocation.Text = string.Empty; RadComboBoxSiteLocation.DataSource = global.GetSiteLocationBySiteId(siteId); RadComboBoxSiteLocation.DataTextField = "Name"; RadComboBoxSiteLocation.DataValueField = "Value"; RadComboBoxSiteLocation.DataBind(); foreach (RadComboBoxItem item in RadComboBoxSiteLocation.Items) { if (item.Value == CurrentSiteLocationId.ToString()) { item.Selected = true; break; } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { } LinqDataSourceGradeName.WhereParameters.Clear(); LinqDataSourceGradeName.WhereParameters.Add("SiteLocationId", DbType.Int32, CurrentSiteLocationId.ToString()); LinqDataSourceGradeName.Where = "SiteLocationId == @SiteLocationId"; RefreshGrade(); RefreshGradeLetter(); }
protected void GetDepositDetail() { var buttonList = new List <string>(); buttonList.Add("Add Deposit"); buttonList.Add("Excel"); if (RadGridDepositList.SelectedValue != null) { var cDeposit = new CDeposit(); var deposit = cDeposit.Get(Convert.ToInt32(RadGridDepositList.SelectedValue.ToString())); DepositInfomation1.SetData(deposit); FileDownloadList1.GetFileDownload(Convert.ToInt32(RadGridDepositList.SelectedValue)); bool isChecked = false; switch (deposit.Status) { // Pending case 1: if (CurrentUserId == deposit.CreatedId) { buttonList.Add("Modify Deposit"); buttonList.Add("Confirm"); buttonList.Add("Cancel"); isChecked = true; } break; // Created case 2: if (CurrentGroupId == (int)CConstValue.UserGroupForDepositConfirm.Accounting) //HQ { buttonList.Add("Confirm"); } else { buttonList.Add("Cancel"); } break; // Confirmed case 3: if (CurrentGroupId == (int)CConstValue.UserGroupForDepositConfirm.Accounting) //HQ { buttonList.Add("Cancel"); } break; // cancel default: if (CurrentGroupId == (int)CConstValue.UserGroupForDepositConfirm.Accounting) //HQ { // nothing } else { buttonList.Add("Confirm"); isChecked = true; } break; } _radGridDepositPayment.ClientSettings.AllowRowsDragDrop = isChecked; RadGridUnDepositPayment.ClientSettings.AllowRowsDragDrop = isChecked; } foreach (RadToolBarItem item in DepositInfoToolbar.Items) { if (buttonList.Contains(item.Text)) { item.Enabled = true; } else { item.Enabled = false; } } _linqDataSourceDepositPayment.WhereParameters.Clear(); LinqDataSourceUnDepositPayment.WhereParameters.Clear(); if (RadGridDepositList.SelectedValue != null) { _linqDataSourceDepositPayment.WhereParameters.Add("DepositId", DbType.Int32, RadGridDepositList.SelectedValue.ToString()); LinqDataSourceUnDepositPayment.WhereParameters.Add("SiteLocationId", DbType.Int32, CurrentSiteLocationId.ToString()); } else { _linqDataSourceDepositPayment.WhereParameters.Add("DepositId", DbType.Int32, 0.ToString()); LinqDataSourceUnDepositPayment.WhereParameters.Add("SiteLocationId", DbType.Int32, 0.ToString()); } _linqDataSourceDepositPayment.Where = "DepositId == @DepositId"; LinqDataSourceUnDepositPayment.Where = "SiteLocationId == @SiteLocationId"; }