public TabBugViewModel(Messenger messenger, DialogCoordinator dialogCoordinator, IDataAccess dataAccess, Bug bug, Issue issue) : base(issue) { this.messenger = messenger; this.dialogCoordinator = dialogCoordinator; this.dataAccess = dataAccess; this.Bug = bug; this.ID = bug.ID; ShowCloseButton = true; TabHeader = "Bug #" + IssueID.ToString(); }
public TabChangeRequestViewModel(Messenger messenger, DialogCoordinator dialogCoordinator, IDataAccess dataAccess, ChangeRequest changeRequest, Issue issue) : base(issue) { this.messenger = messenger; this.dialogCoordinator = dialogCoordinator; this.dataAccess = dataAccess; this.ChangeRequest = changeRequest; this.ID = changeRequest.ID; ShowCloseButton = true; TabHeader = "Change #" + IssueID.ToString(); }
public void ReloadData(bool forceReload) { if (!loaded || forceReload) { frameSrc = URLHelper.ResolveUrl(String.Format("Newsletter_Iframe_Edit.aspx?newsletterid={0}{1}{2}{3}", NewsletterID, (IssueID > 0 ? "&issueid=" + IssueID.ToString() : string.Empty), (TemplateID > 0 ? "&templateid=" + TemplateID.ToString() : string.Empty), (!Enabled? "&readonly=1" : string.Empty))); loaded = true; } }
protected void lvOTIssue_ItemCommand(object sender, ListViewCommandEventArgs e) { Int64 IssueID; Int64.TryParse(e.CommandArgument.ToString(), out IssueID); if (IssueID > 0) { if (string.Equals(e.CommandName, "EditItem")) { _IssueID = IssueID; PrepareEditView(); } else if (string.Equals(e.CommandName, "DeleteItem")) { try { Int64 result = -1; String fe = SqlExpressionBuilder.PrepareFilterExpression(OTIssueEntity.FLD_NAME_IssueID, IssueID.ToString(), SQLMatchType.Equal); OTIssueEntity oTIssueEntity = new OTIssueEntity(); result = FCCOTIssue.GetFacadeCreate().Delete(oTIssueEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No); if (result == 0) { _IssueID = 0; _OTIssueEntity = new OTIssueEntity(); PrepareInitialView(); BindOTIssueList(); MiscUtil.ShowMessage(lblMessage, "O TIssue has been successfully deleted.", true); } else { MiscUtil.ShowMessage(lblMessage, "Failed to delete O TIssue.", true); } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } } }
protected void lvOTIssue_Detailed_ItemCommand(object sender, ListViewCommandEventArgs e) { Int64 IssueID; Int64.TryParse(e.CommandArgument.ToString(), out IssueID); if (IssueID > 0) { if (string.Equals(e.CommandName, "DeleteItem")) { try { Int64 result = -1; String fe = SqlExpressionBuilder.PrepareFilterExpression(OTIssueEntity.FLD_NAME_IssueID, IssueID.ToString(), SQLMatchType.Equal); OTIssueEntity oTIssueEntity = new OTIssueEntity(); result = FCCOTIssue.GetFacadeCreate().Delete(oTIssueEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No); if (result == 0) { _IssueID = 0; _OTIssueEntity = new OTIssueEntity(); PrepareInitialView(); BindOTIssueList(); MiscUtil.ShowMessage(lblMessage, "Issue has been successfully deleted.", true); } else { MiscUtil.ShowMessage(lblMessage, "Failed to delete Issue.", true); } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } else if (string.Equals(e.CommandName, "UpdateItem")) { try { _IssueID = IssueID; OTIssueEntity oTIssueEntity = CurrentOTIssueEntity; if (CurrentOTIssueEntity.IssueStatusID == MasterDataConstants.MDIssueStatus.COMPLETED) { MiscUtil.ShowMessage(lblMessage, "Issue Already Completed.", false); return; } Int64 result = -1; String fe = SqlExpressionBuilder.PrepareFilterExpression(OTIssueEntity.FLD_NAME_IssueID, IssueID.ToString(), SQLMatchType.Equal); oTIssueEntity.IssueStatusID = MasterDataConstants.MDIssueStatus.COMPLETED; oTIssueEntity.CompletionPercentage = 100; result = FCCOTIssue.GetFacadeCreate().Update(oTIssueEntity, fe, DatabaseOperationType.Update, TransactionRequired.No); if (result > 0) { _IssueID = 0; _OTIssueEntity = new OTIssueEntity(); PrepareInitialView(); BindOTIssueList(); MiscUtil.ShowMessage(lblMessage, "Issue has been successfully Updated.", false); } else { MiscUtil.ShowMessage(lblMessage, "Failed to Update Issue.", true); } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } else if (string.Equals(e.CommandName, "AddToSchedule")) { try { OTIssueEntity oTIssueEntity = FCCOTIssue.GetFacadeCreate().GetByID(IssueID); OTScheduleEntity oTScheduleEntity = new OTScheduleEntity(); } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } } }
protected void lvOTIssue_Detailed_ItemCommand(object sender, ListViewCommandEventArgs e) { Int64 IssueID; Int64.TryParse(e.CommandArgument.ToString(), out IssueID); if (IssueID > 0) { if (string.Equals(e.CommandName, "DeleteItem")) { try { Int64 result = -1; String fe = SqlExpressionBuilder.PrepareFilterExpression(OTIssueEntity.FLD_NAME_IssueID, IssueID.ToString(), SQLMatchType.Equal); OTIssueEntity oTIssueEntity = new OTIssueEntity(); result = FCCOTIssue.GetFacadeCreate().Delete(oTIssueEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No); if (result == 0) { _IssueID = 0; _OTIssueEntity = new OTIssueEntity(); PrepareInitialView(); BindOTIssueList(); MiscUtil.ShowMessage(lblMessage, "Issue has been successfully deleted.", true); } else { MiscUtil.ShowMessage(lblMessage, "Failed to delete Issue.", true); } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } else if (string.Equals(e.CommandName, "UpdateItem")) { try { _IssueID = IssueID; OTIssueEntity oTIssueEntity = CurrentOTIssueEntity; if (CurrentOTIssueEntity.IssueStatusID == MasterDataConstants.MDIssueStatus.COMPLETED) { MiscUtil.ShowMessage(lblMessage, "Issue Already Completed.", false); return; } Int64 result = -1; String fe = SqlExpressionBuilder.PrepareFilterExpression(OTIssueEntity.FLD_NAME_IssueID, IssueID.ToString(), SQLMatchType.Equal); oTIssueEntity.IssueStatusID = MasterDataConstants.MDIssueStatus.COMPLETED; oTIssueEntity.CompletionPercentage = 100; result = FCCOTIssue.GetFacadeCreate().Update(oTIssueEntity, fe, DatabaseOperationType.Update, TransactionRequired.No); if (result > 0) { _IssueID = 0; _OTIssueEntity = new OTIssueEntity(); PrepareInitialView(); BindOTIssueList(); MiscUtil.ShowMessage(lblMessage, "Issue has been successfully Updated.", false); } else { MiscUtil.ShowMessage(lblMessage, "Failed to Update Issue.", true); } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } else if (string.Equals(e.CommandName, "EditGrid")) { try { _IssueID = IssueID; OTIssueEntity oTIssueEntity = CurrentOTIssueEntity; Label lblTitleLV = (Label)e.Item.FindControl("lblTitleLV"); Label lblDurationLV = (Label)e.Item.FindControl("lblDurationLV"); Label lblIssueCategoryLV = (Label)e.Item.FindControl("lblIssueCategoryLV"); Label lblIssueStatusLV = (Label)e.Item.FindControl("lblIssueStatusLV"); Label lblIssueCategoryIDLV = (Label)e.Item.FindControl("lblIssueCategoryIDLV"); Label lblIssueStatusIDLV = (Label)e.Item.FindControl("lblIssueStatusIDLV"); Label lblProjectLV = (Label)e.Item.FindControl("lblProjectLV"); Label lblProjectIDLV = (Label)e.Item.FindControl("lblProjectIDLV"); DropDownList ddlIssueCategoryLV = (DropDownList)e.Item.FindControl("ddlIssueCategoryLV"); DropDownList ddlIssueStatusLV = (DropDownList)e.Item.FindControl("ddlIssueStatusLV"); DropDownList ddlProjectIDLV = (DropDownList)e.Item.FindControl("ddlProjectIDLV"); TextBox txtTitleLV = (TextBox)e.Item.FindControl("txtTitleLV"); TextBox txtDurationLV = (TextBox)e.Item.FindControl("txtDurationLV"); LinkButton lnkBtnUpdateGrid = (LinkButton)e.Item.FindControl("lnkBtnUpdateGrid"); LinkButton lnBtnCancelGrid = (LinkButton)e.Item.FindControl("lnBtnCancelGrid"); LinkButton lnkBtnEditGrid = (LinkButton)e.Item.FindControl("lnkBtnEditGrid"); txtTitleLV.Visible = true; txtDurationLV.Visible = true; ddlIssueCategoryLV.Visible = true; ddlIssueStatusLV.Visible = true; ddlProjectIDLV.Visible = true; lblIssueCategoryLV.Visible = false; lblIssueStatusLV.Visible = false; lblTitleLV.Visible = false; lblProjectLV.Visible = false; lblDurationLV.Visible = false; lnBtnCancelGrid.Visible = true; lnkBtnUpdateGrid.Visible = true; lnkBtnEditGrid.Visible = false; MiscUtil.PopulateMDIssueCategoryForDTL(ddlIssueCategoryLV, false); MiscUtil.PopulateMDIssueStatusForDTL(ddlIssueStatusLV, false); MiscUtil.PopulateBDProjectForDTL(ddlProjectIDLV, true); if (ddlIssueCategoryLV != null && ddlIssueCategoryLV.Items.Count > 0) { ddlIssueCategoryLV.SelectedValue = lblIssueCategoryIDLV.Text; } if (ddlIssueStatusLV != null && ddlIssueStatusLV.Items.Count > 0) { ddlIssueStatusLV.SelectedValue = lblIssueStatusIDLV.Text; } if (ddlProjectIDLV != null && ddlProjectIDLV.Items.Count > 0) { ddlProjectIDLV.SelectedValue = lblProjectIDLV.Text; } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } else if (string.Equals(e.CommandName, "AddToSchedule")) { try { OTIssueEntity oTIssueEntity = FCCOTIssue.GetFacadeCreate().GetByID(IssueID); OTScheduleEntity oTScheduleEntity = new OTScheduleEntity(); } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } else if (string.Equals(e.CommandName, "UpdateGrid")) { try { Label lblTitleLV = (Label)e.Item.FindControl("lblTitleLV"); Label lblDurationLV = (Label)e.Item.FindControl("lblDurationLV"); Label lblIssueCategoryLV = (Label)e.Item.FindControl("lblIssueCategoryLV"); Label lblIssueStatusLV = (Label)e.Item.FindControl("lblIssueStatusLV"); Label lblIssueCategoryIDLV = (Label)e.Item.FindControl("lblIssueCategoryIDLV"); Label lblIssueStatusIDLV = (Label)e.Item.FindControl("lblIssueStatusIDLV"); Label lblProjectLV = (Label)e.Item.FindControl("lblProjectLV"); Label lblProjectIDLV = (Label)e.Item.FindControl("lblProjectIDLV"); DropDownList ddlIssueCategoryLV = (DropDownList)e.Item.FindControl("ddlIssueCategoryLV"); DropDownList ddlIssueStatusLV = (DropDownList)e.Item.FindControl("ddlIssueStatusLV"); DropDownList ddlProjectIDLV = (DropDownList)e.Item.FindControl("ddlProjectIDLV"); TextBox txtTitleLV = (TextBox)e.Item.FindControl("txtTitleLV"); TextBox txtDurationLV = (TextBox)e.Item.FindControl("txtDurationLV"); LinkButton lnkBtnUpdateGrid = (LinkButton)e.Item.FindControl("lnkBtnUpdateGrid"); LinkButton lnBtnCancelGrid = (LinkButton)e.Item.FindControl("lnBtnCancelGrid"); LinkButton lnkBtnEditGrid = (LinkButton)e.Item.FindControl("lnkBtnEditGrid"); TimeSpan durationLV; TimeSpan.TryParse(txtDurationLV.Text.Trim(), out durationLV); OTIssueEntity oTIssueEntity = FCCOTIssue.GetFacadeCreate().GetByID(IssueID); oTIssueEntity.IssueStatusID = Int64.Parse(ddlIssueStatusLV.SelectedValue); oTIssueEntity.IssueCategoryID = Int64.Parse(ddlIssueCategoryLV.SelectedValue); oTIssueEntity.ReferenceID = Int64.Parse(ddlProjectIDLV.SelectedValue); oTIssueEntity.Title = txtTitleLV.Text.Trim().ToString(); oTIssueEntity.Duration = 0; oTIssueEntity.DTLDuration = durationLV.ToString(); String fe = SqlExpressionBuilder.PrepareFilterExpression(OTIssueEntity.FLD_NAME_IssueID, IssueID.ToString(), SQLMatchType.Equal); Int64 result = -1; String fe_update = SqlExpressionBuilder.PrepareFilterExpression(OTIssueEntity.FLD_NAME_IssueID, IssueID.ToString(), SQLMatchType.Equal); result = FCCOTIssue.GetFacadeCreate().Update(oTIssueEntity, fe, DatabaseOperationType.Update, TransactionRequired.No); if (result > 0) { _IssueID = 0; _OTIssueEntity = new OTIssueEntity(); PrepareInitialView(); BindOTIssueList(); txtTitleLV.Visible = false; txtDurationLV.Visible = false; ddlIssueCategoryLV.Visible = false; ddlIssueStatusLV.Visible = false; ddlProjectIDLV.Visible = false; lblIssueCategoryLV.Visible = true; lblIssueStatusLV.Visible = true; lblTitleLV.Visible = true; lblDurationLV.Visible = true; lblProjectLV.Visible = true; lnBtnCancelGrid.Visible = false; lnkBtnUpdateGrid.Visible = false; lnkBtnEditGrid.Visible = true; MiscUtil.ShowMessage(lblMessage, "Issue has been successfully updated.", false); } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } else if (string.Equals(e.CommandName, "CancelGridEdit")) { try { Label lblTitleLV = (Label)e.Item.FindControl("lblTitleLV"); Label lblDurationLV = (Label)e.Item.FindControl("lblDurationLV"); Label lblIssueCategoryLV = (Label)e.Item.FindControl("lblIssueCategoryLV"); Label lblIssueStatusLV = (Label)e.Item.FindControl("lblIssueStatusLV"); Label lblIssueCategoryIDLV = (Label)e.Item.FindControl("lblIssueCategoryIDLV"); Label lblIssueStatusIDLV = (Label)e.Item.FindControl("lblIssueStatusIDLV"); Label lblProjectLV = (Label)e.Item.FindControl("lblProjectLV"); DropDownList ddlIssueCategoryLV = (DropDownList)e.Item.FindControl("ddlIssueCategoryLV"); DropDownList ddlIssueStatusLV = (DropDownList)e.Item.FindControl("ddlIssueStatusLV"); DropDownList ddlProjectIDLV = (DropDownList)e.Item.FindControl("ddlProjectIDLV"); TextBox txtTitleLV = (TextBox)e.Item.FindControl("txtTitleLV"); TextBox txtDurationLV = (TextBox)e.Item.FindControl("txtDurationLV"); LinkButton lnkBtnUpdateGrid = (LinkButton)e.Item.FindControl("lnkBtnUpdateGrid"); LinkButton lnBtnCancelGrid = (LinkButton)e.Item.FindControl("lnBtnCancelGrid"); LinkButton lnkBtnEditGrid = (LinkButton)e.Item.FindControl("lnkBtnEditGrid"); txtTitleLV.Visible = false; txtDurationLV.Visible = false; ddlIssueCategoryLV.Visible = false; ddlIssueStatusLV.Visible = false; ddlProjectIDLV.Visible = false; lblIssueCategoryLV.Visible = true; lblIssueStatusLV.Visible = true; lblTitleLV.Visible = true; lblDurationLV.Visible = true; lblProjectLV.Visible = true; lnBtnCancelGrid.Visible = false; lnkBtnUpdateGrid.Visible = false; lnkBtnEditGrid.Visible = true; } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } } if (string.Equals(e.CommandName, "InsertItem")) { try { ListViewItem list = lvOTIssue_Detailed.InsertItem; TextBox txtTitleLV = (TextBox)list.FindControl("txtTitleLV"); TextBox txtDurationLV = (TextBox)list.FindControl("txtDurationLV"); DropDownList ddlIssueCategoryIDLV = (DropDownList)list.FindControl("ddlIssueCategoryIDLV"); DropDownList ddlIssueStatusIDLV = (DropDownList)list.FindControl("ddlIssueStatusIDLV"); DropDownList ddlProjectIDLV = (DropDownList)list.FindControl("ddlProjectIDLV"); if (ddlIssueCategoryIDLV.SelectedValue == "0") { MiscUtil.ShowMessage(lblMessage, "You have selected Category Head. Please Select Issue Category", true); return; } TimeSpan durationLV; TimeSpan.TryParse(txtDurationLV.Text.Trim(), out durationLV); OTIssueEntity oTIssueEntity = new OTIssueEntity(); oTIssueEntity.IssueCategoryID = Int64.Parse(ddlIssueCategoryIDLV.SelectedValue); oTIssueEntity.Title = txtTitleLV.Text.Trim(); oTIssueEntity.Description = "Daily Log Time"; oTIssueEntity.IssuePriorityID = MasterDataConstants.MDIssuePriority.HIGH; oTIssueEntity.CompletionPercentage = 0; oTIssueEntity.IssueStatusID = Int64.Parse(ddlIssueStatusIDLV.SelectedValue); oTIssueEntity.Duration = 0; //String startDate=DateTime.ParseExact(txtStartDate.Text, "ddd MMM dd yyyy HH:mm:ss 'GMT'zzz", System.Globalization.CultureInfo.InvariantCulture).ToString(); //String startDate = txtStartDate.Text; DateTime startDate = System.DateTime.Now; DateTime endDate = System.DateTime.Now; if (txtDate.Text.Trim().IsNotNullOrEmpty()) { startDate = MiscUtil.ParseToDateTime(txtDate.Text.Trim().ToString()); endDate = startDate; } oTIssueEntity.ExpectedStartDate = startDate; oTIssueEntity.ExpectedEndDate = endDate; oTIssueEntity.SupervisorEmployeeID = MiscUtil.GetCurrentEmployeeByMemberID(CurrentMember); oTIssueEntity.AssignedToEmployeeID = MiscUtil.GetCurrentEmployeeByMemberID(CurrentMember); oTIssueEntity.ActualStartDate = null; oTIssueEntity.ActualEndDate = null; oTIssueEntity.NotifyBeforeMin = null; oTIssueEntity.SupervisorAgreed = true; oTIssueEntity.ModifiedBySupervisorDateTime = System.DateTime.Now; oTIssueEntity.IP = MiscUtil.GetLocalIP(); oTIssueEntity.Remarks = String.Empty; oTIssueEntity.IssueIdentityCategoryID = MasterDataConstants.IssueIdentityCategory.ADHOC_ISSUE; oTIssueEntity.CreatedByMemberID = this.CurrentMember.MemberID; oTIssueEntity.CompletionPercentage = 0; oTIssueEntity.CreateDate = DateTime.Now; oTIssueEntity.IsNotifyCompleted = false; oTIssueEntity.IsRemoved = false; oTIssueEntity.ParentIssueID = null; oTIssueEntity.ReferenceID = Int64.Parse(ddlProjectIDLV.SelectedValue); oTIssueEntity.ReferenceIssueID = null; oTIssueEntity.DTLDuration = durationLV.ToString(); Int64 result = -1; result = FCCOTIssue.GetFacadeCreate().Add(oTIssueEntity, DatabaseOperationType.Add, TransactionRequired.No); if (result > 0) { BindList(); MiscUtil.ShowMessage(lblMessage, "Event Created Successfully", false); } else { MiscUtil.ShowMessage(lblMessage, "Can't Create Event.", true); } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, "Failed to save Daily Log Information.", true); } } }