public void GetManualVersions(int ID) { ManualVersion versions = new ManualVersion(); versions.GetVersionsByManualID(ID); List<Version> AllVersions = versions.DefaultView.Table.AsEnumerable().Select(row => { return new Version { Title = row["Title"].ToString(), IssueNumber = row["IssueNumber"].ToString(), IssueDate = DateTime.Parse(row["IssueDate"].ToString()), RevisionNumber = row["RevisionNumber"].ToString(), RevisionDate = DateTime.Parse(row["RevisionDate"].ToString()), UpdatedByName = row["UpdatedByName"].ToString(), LastUpdatedDate = DateTime.Parse(row["LastUpdatedDate"].ToString()), Path = row["Path"].ToString() }; }).ToList(); UsersNofications usNot = new UsersNofications(); usNot.MarkNotificationsReadByManualVersionID(new Guid(Membership.GetUser(Context.User.Identity.Name).ProviderUserKey.ToString()),ID); SetContentResult(AllVersions); }
private void BindData_Versions() { ManualVersion objdata = new ManualVersion(); objdata.GetVersionsByManualID(CurrentManual.ManualID); uiRadGridVersions.DataSource = objdata.DefaultView; uiRadGridVersions.DataBind(); }
protected void uiRadGridmanuals_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e) { if (e.CommandName == "EditManual") { Manual objData = new Manual(); objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())); uiTextBoxTitle.Text = objData.Title; CurrentManual = objData; uiPanelEdit.Visible = true; uiPanelViewAll.Visible = false; uiPanelEditVersions.Visible = false; uiPanelVersions.Visible = true; uiLinkButtonEditForms.Visible = true; BindData_Versions(); } else if (e.CommandName == "DeleteManual") { Manual objData = new Manual(); objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())); ManualVersion versions = new ManualVersion(); versions.GetVersionsByManualID(objData.ManualID); versions.DeleteAll(); versions.Save(); ManualForm forms = new ManualForm(); forms.GetFormsByManualID(objData.ManualID); for (int i = 0; i < forms.RowCount; i++) { FromVersion formversions = new FromVersion(); formversions.GetVersionsByFormID(forms.ManualFormID); formversions.MarkAsDeleted(); formversions.Save(); } forms.DeleteAll(); forms.Save(); objData.MarkAsDeleted(); objData.Save(); BindData(); } }