protected void lnkOk1_Click(object sender, EventArgs e) { AdministrationEDSC.CategoryDTRow dr = new AdministrationEDSC.CategoryDTDataTable().NewCategoryDTRow(); dr = GetData(); int parentID = Convert.ToInt32(dropDownParent.SelectedValue); string userName = SystemConstants.DevUser; //Membership.GetUser().UserName; AdministrationBFC bfc = new AdministrationBFC(); if (Mode == SystemConstants.FormMode.New) { bfc.CreateCategory(parentID, userName, dr); } else if (Mode == SystemConstants.FormMode.Edit) { bfc.UpdateCategory(dr.ID, dr.Name, parentID, userName); } lblAddEditName.Text = txtAddEditName.Text; lblParent.Text = dropDownParent.SelectedItem.ToString(); SetFormView(); }
protected void btnSave_Click(object sender, EventArgs e) { int mode = 0; AdministrationDAC dac = new AdministrationDAC(); AdministrationEDSC.KeyCollectionDTRow drKeyProperties = GetKeyProperties(); AdministrationEDSC.KeywordDTRow drKeywords = GetKeywords(); AdministrationBFC bfc = new AdministrationBFC(); if (UIMode == SystemConstants.FormMode.New.ToString()) { mode = (int)SystemConstants.FormMode.New; } else if (UIMode == SystemConstants.FormMode.Edit.ToString()) { mode = (int)SystemConstants.FormMode.Edit; } else if (UIMode == SystemConstants.FormMode.View.ToString()) { mode = (int)SystemConstants.FormMode.View; } bfc.SaveKeywords(drKeyProperties, drKeywords, mode); UIMode = SystemConstants.FormMode.New.ToString(); txtName.Text = ""; txtDescription.Text = ""; txtSynonims.Text = ""; hdnThesaurusID.Value = ""; hdnThesaurusKeyID.Value = ""; Refresh(); }
protected void ListViewAsset_ItemCommand(object sender, ListViewCommandEventArgs e) { if (e.CommandName == "DeleteAsset" || e.CommandName == "viewAssetDetail") { LinkButton lnkDelete = e.Item.FindControl("lnkDelete") as LinkButton; HiddenField hdnAssetID = e.Item.FindControl("hdnAssetID") as HiddenField; HiddenField hdnFilename = e.Item.FindControl("hdnFilename") as HiddenField; HiddenField hdnFileext = e.Item.FindControl("hdnFileext") as HiddenField; HiddenField hdnFilesize = e.Item.FindControl("hdnFilesize") as HiddenField; int AssetID = Convert.ToInt32(hdnAssetID.Value); AdministrationDAC dac = new AdministrationDAC(); AdministrationBFC bfc = new AdministrationBFC(); if (e.CommandName == "DeleteAsset") { dac.DeleteAsset(AssetID); Refresh(); } else if (e.CommandName == "viewAssetDetail") { lblFilesize.Text = hdnFilesize.Value + " KB"; lblTitle.Text = hdnFilename.Value; lblExtension.Text = hdnFileext.Value; lblUrl.Text = SystemConstants.CustomerUrl + "ImageHandler.ashx?" + SystemConstants.qs_AssetID + "=" + hdnAssetID.Value;; ModalPopupExtender1.Show(); } } }
protected void DataList1_ItemCommand(object source, DataListCommandEventArgs e) { if (e.CommandName == "SetAsMainImage" || e.CommandName == "DeleteImage" || e.CommandName == "ViewImage" || e.CommandName == "SaveImage" || e.CommandName == "CancelEditImage" || e.CommandName == "EditImage") { LinkButton lnkDelete = e.Item.FindControl("lnkDelete") as LinkButton; HiddenField hdnImageID = e.Item.FindControl("hdnImageID") as HiddenField; int imageID = Convert.ToInt32(hdnImageID.Value); AdministrationDAC dac = new AdministrationDAC(); AdministrationBFC bfc = new AdministrationBFC(); Label lblImageDescription = e.Item.FindControl("lblImageDescription") as Label; Label lblImageTitle = e.Item.FindControl("lblImageTitle") as Label; TextBox txtImageTitle = e.Item.FindControl("txtImageTitle") as TextBox; TextBox ckImageDescription = e.Item.FindControl("txtImageDescription") as TextBox; HiddenField hdnFilesize = e.Item.FindControl("hdnFilesize") as HiddenField; if (e.CommandName == "DeleteImage") { string imageVirtualPath = ""; string imageThumbVirtualPath = ""; bfc.DeleteActivityImage(ActivityID, imageID, Convert.ToInt32(hdnFilesize.Value), out imageThumbVirtualPath, out imageVirtualPath); Refresh(); } else if (e.CommandName == "SetAsMainImage") { dac.UpdateActivityPrimaryImage(ActivityID, imageID); Refresh(); foreach (DataListItem item in DataList1.Items) { SetDataListItemMode(item, true); } } } }
protected void lnkDeleteProvider_Click(object sender, EventArgs e) { AdministrationBFC bfc = new AdministrationBFC(); bfc.DeleteMenuItem(Convert.ToInt32(hdnPopUpMenuItemIDProvider.Value)); Refresh(); }
private void SetTimetableDataSource() { if (ScheduleDT != null) { timeTableDT = new AdministrationBFC().CalculateRecurrence(ScheduleDT); gridviewPreview.DataSource = timeTableDT; gridviewPreview.DataBind(); } }
private void Save() { bool isNotValid = !checkValid(); if (isNotValid) { //drActivity var drDetail = ActivityRegistrationDetailUC.getDetails(); drDetail.Status = (int)SystemConstants.ActivityStatus.Active; string shortDescription = ""; string fullDescription = ""; ActivityRegistrationDescriptionUC.getActivityDetails(out shortDescription, out fullDescription); drDetail = ActivityRegistrationDescriptionUC.getDetails(drDetail); drDetail.isApproved = RadYes.Checked; drDetail.ShortDescription = ""; drDetail.FullDescription = fullDescription; DateTime activityExpiryDate = DateTime.Today; bool usingTimetable; ActivityRegistrationTimetableUC.getExpiry(out activityExpiryDate, out usingTimetable); drDetail.ExpiryDate = activityExpiryDate; drDetail.ProviderID = ProviderID; if (usingTimetable) { drDetail.TimetableType = (int)SystemConstants.ScheduleViewFormat.Datagrid; } else { drDetail.TimetableType = (int)SystemConstants.ScheduleViewFormat.noTimetable; } //drActivityContact var contactDetails = ActivityRegistrationDetailUC.getContactDetail(); //dtSchedule var dtActSchedule = ActivityRegistrationTimetableUC.getTimetable(false); //drGrouping var drActGrouping = ActivityRegistrationGroup.getActSuitability(); drDetail.Keywords = ActivityRegistrationGroup.getKeywords(); int actID; foreach (var drActSchedule in dtActSchedule) { drActSchedule.ActivityID = ActivityID; } AdministrationBFC.UpdateActivity(ActivityID, drDetail, contactDetails, drActGrouping, dtActSchedule); Response.Redirect("~/Activities"); } else { lblError.Visible = divError.Visible = true; } }
public void btnMove_Click(object sender, EventArgs e) { AdministrationBFC bfc = new AdministrationBFC(); AdministrationEDSC.CategoryDTDataTable dt = GetSelected(); foreach (AdministrationEDSC.CategoryDTRow dr in dt) { int destinationID = Convert.ToInt32(DropDownList1.SelectedValue); bfc.MoveCategory(dr.ID, destinationID, SystemConstants.DevUser); } Refresh(); }
protected void imgDownProv_Click(object sender, ImageClickEventArgs e) { AdministrationBFC bfc = new AdministrationBFC(); AdministrationEDSC.MenuDTRow dr = new AdministrationEDSC.MenuDTDataTable().NewMenuDTRow(); dr.ID = Convert.ToInt16(hdnPopUpMenuItemIDProvider.Value); bool cannotChangePos; bfc.SortMenuItem(dr.ID, false, out cannotChangePos); if (cannotChangePos) { lblWarningProvider.Visible = true; lblWarningProvider.Text = "Cannot Change Pos"; } else { lblWarningProvider.Visible = false; lblWarningProvider.Text = ""; TreeViewProvider.Refresh((int)SystemConstants.MenuType.ProviderMenu); } }
protected void lnkDelete_Click(object sender, EventArgs e) { AdministrationBFC bfc = new AdministrationBFC(); AdministrationEDSC.CategoryDTDataTable dt = GetSelected(); foreach (AdministrationEDSC.CategoryDTRow dr in dt) { bool complete = bfc.DeleteCategories(dr.ID); if (complete) { divSuccess.Visible = complete; divError.Visible = !complete; lblSuccess.Text = "Selected category(es) has been successfully deleted"; } else { divSuccess.Visible = complete; divError.Visible = !complete; lblError.Text = "Cannot delete selected category(es), one or more activities are linked to this category(es). Consider to delete or modify the activities and retry again."; } } Refresh(); }
protected void lnkDelete_Click(object sender, EventArgs e) { AdministrationBFC bfc = new AdministrationBFC(); AdministrationEDSC.CouncilDTDataTable dt = GetSelected(); foreach (AdministrationEDSC.CouncilDTRow dr in dt) { bool complete = bfc.DeleteCouncil(dr.ID); if (complete) { divSuccess.Visible = complete; divError.Visible = !complete; lblSuccess.Text = "Selected Council has been successfully deleted"; } else { divSuccess.Visible = complete; divError.Visible = !complete; lblError.Text = "Cannot delete selected Council, one or more suburb(s) are linked to this Council. Consider to delete or modify the Suburb(s) and try again."; } } Refresh(); }