protected void Page_Load(object sender, EventArgs e) { clsSpeedo.Authenticate(); ValidateUser(); //ckeContents.config.toolbar = new object[] // { // new object[] { "Cut", "Copy", "Paste", "PasteText", "PasteFromWord", "-", "SpellChecker", "Scayt" }, // new object[] { "Undo", "Redo", "-", "Find", "Replace", "-", "SelectAll", "RemoveFormat" }, // "/", // new object[] { "Bold", "Italic", "Underline", "Strike", "-", "Subscript", "Superscript" }, // new object[] { "NumberedList", "BulletedList", "-", "Outdent", "Indent", "Blockquote", "CreateDiv" }, // new object[] { "JustifyLeft", "JustifyCenter", "JustifyRight", "JustifyBlock" }, // "/", // new object[] { "Styles", "Format", "Font", "FontSize" }, // new object[] { "TextColor", "BGColor" }, // }; ckeContents.config.toolbar = new object[] { new object[] { "Cut", "Copy", "Paste", "PasteText", "PasteFromWord", "-", "SpellChecker", "Scayt" }, new object[] { "Undo", "Redo", "-", "Find", "Replace", "-", "SelectAll", "RemoveFormat" }, new object[] { "Image", "Table", "HorizontalRule", "Smiley", "SpecialChar" }, "/", new object[] { "Bold", "Italic", "Underline", "Strike", "-", "Subscript", "Superscript" }, new object[] { "NumberedList", "BulletedList", "-", "Outdent", "Indent", "Blockquote", "CreateDiv" }, new object[] { "JustifyLeft", "JustifyCenter", "JustifyRight", "JustifyBlock" }, "/", new object[] { "Styles", "Format", "Font", "FontSize" }, new object[] { "TextColor", "BGColor" }, }; if (!Page.IsPostBack) { string strUsername = Request.Cookies["Speedo"]["UserName"]; int intGroupUpdateCode = Request.QueryString["GroupUpdateCode"].ToString().ToInt(); using (clsGroupUpdate objView = new clsGroupUpdate()) { objView.GroupUpdateCode = intGroupUpdateCode; objView.Fill(); txtTitle.Text = objView.Title; txtDescription.Text = objView.Description; lblGroupHead.Text = clsEmployee.GetName(GroupUpdateApproval.GetApproverName(intGroupUpdateCode.ToString(), "1")); txtGroupHeadRemark.Text = GroupUpdateApproval.GetApproverRemarks(intGroupUpdateCode.ToString(), "1"); //lblDivisionHead.Text = clsEmployee.GetName(GroupUpdateApproval.GetApproverName(intGroupUpdateCode.ToString(), "2")); //txtDivisionHeadRemark.Text = GroupUpdateApproval.GetApproverRemarks(intGroupUpdateCode.ToString(), "2"); txtPhotoSource.Text = objView.PhotoSource; hdnGroupHead.Value = GroupUpdateApproval.GetApprover(GroupUpdateApproval.GroupUpdateUserType.GroupHead, clsEmployee.GetDepartmentCode(strUsername)); ckeContents.Text = objView.Content; txtContributor.Text = objView.Contributor; } } }
protected void Page_Load(object sender, EventArgs e) { clsSpeedo.Authenticate(); ValidateUser(); string strUsername = Request.Cookies["Speedo"]["UserName"]; int intGroupUpdateCode = Request.QueryString["GroupUpdateCode"].ToString().ToInt(); string strStatus = ""; using (clsGroupUpdate objView = new clsGroupUpdate()) { objView.GroupUpdateCode = intGroupUpdateCode; objView.Fill(); if (objView.Status == "0") { strStatus = "For Approval"; } else if (objView.Status == "1") { strStatus = "Approved"; } else if (objView.Status == "2") { strStatus = "Disapproved"; } else if (objView.Status == "3") { strStatus = "Voided"; } lblContributor.Text = objView.Contributor; lblTitle.Text = objView.Title; lblCreateBy.Text = clsEmployee.GetName(objView.CreateBy); lblCreateOn.Text = Convert.ToDateTime(objView.CreateOn).ToString("MMM dd, yyyy"); //lblLink.Text = "<a href='../UploadedFiles/GroupUpdates/" + objView.ImageFilename + "' target='_blank'>View Image</a>"; lblImage.Text = "<img src='../UploadedFiles/GroupUpdates/" + objView.ImageFilename + "' width='200' height='119' alt='' /></a>"; lblDescription.Text = objView.Description; lblContent.Text = objView.Content; lblStatus.Text = strStatus; lblPhotoSource.Text = objView.PhotoSource; lblGroupHead.Text = clsEmployee.GetName(GroupUpdateApproval.GetApproverName(intGroupUpdateCode.ToString(), "1")); txtGroupHeadRemark.Text = GroupUpdateApproval.GetApproverRemarks(intGroupUpdateCode.ToString(), "1"); //lblDivisionHead.Text = clsEmployee.GetName(GroupUpdateApproval.GetApproverName(intGroupUpdateCode.ToString(), "2")); //txtDivisionHeadRemark.Text = GroupUpdateApproval.GetApproverRemarks(intGroupUpdateCode.ToString(), "2"); } }
protected void LoadGroupUpdate() { string strGroupUpdateCode = ""; //string strActiveDivisionCode = ""; //if (string.IsNullOrEmpty(Request.QueryString["DivisionCode"])) //{ // strActiveDivisionCode = "ACDMCS"; //} //else //{ // strActiveDivisionCode = Request.QueryString["DivisionCode"].ToString(); //} //if (string.IsNullOrEmpty(Request.QueryString["GroupUpdateCode"])) //{ // strGroupUpdateCode = clsGroupUpdate.GetTopNews(strActiveDivisionCode).ToString(); //} //else //{ // strGroupUpdateCode = Request.QueryString["GroupUpdateCode"].ToString(); //} strGroupUpdateCode = Request.QueryString["GroupUpdateCode"].ToString(); using (clsGroupUpdate objUpdate = new clsGroupUpdate()) { //objUpdate.GroupUpdateCode = Request.QueryString["GroupUpdateCode"].ToString().ToInt(); objUpdate.GroupUpdateCode = strGroupUpdateCode.ToInt(); objUpdate.Fill(); string strPhoto = objUpdate.PhotoSource != string.Empty ? "Photo By: " + objUpdate.PhotoSource : ""; string strContributor = objUpdate.Contributor != string.Empty ? "<br/>Contributor: " + objUpdate.Contributor + "<br/>Posted by: <a href='../UserPage/Userpage.aspx?username="******"'>" + clsEmployee.GetName(objUpdate.CreateBy) + "</a> " : "<br/>Posted by: <a href='../UserPage/Userpage.aspx?username="******"'>" + clsEmployee.GetName(objUpdate.CreateBy) + "</a> "; string strImage = "<a href='#'><img class='imgl' src='../UploadedFiles/GroupUpdates/" + objUpdate.ImageFilename + "' width='420' height='250' alt='' /></a></img>"; litContent.Text += "<div class='post-title'><h2><font style='font-size:25px; font-weight:bold;'>" + objUpdate.Title + "</font></h2></div>"; litContent.Text += "<div class='post-date'><font style='font-size:11px;'>" + objUpdate.CreateOn.ToString("dddd, MMM dd, yyyy") + strContributor + "</font></div>"; litContent.Text += "<p><font style='font-size:12px;font-style:italic;'>" + objUpdate.Description + "</font></p>"; litContent.Text += "<p><img src='../UploadedFiles/GroupUpdates/" + objUpdate.ImageFilename + "' alt='' class='bordered' height='200px' width='350px' /></p>"; litContent.Text += strPhoto == string.Empty ? "" : "<font style='font-size:12px;font-style:italic;'>" + strPhoto + "</font>"; litContent.Text += "<font style='font-size:14px;'>" + objUpdate.Content + "</font>"; if (string.IsNullOrEmpty(objUpdate.Title)) { litContent.Text = "<p>" + "No Updates for this division" + "</p>"; } } }
protected void SaveData(bool pFinalize) { string username = Request.Cookies["Speedo"]["UserName"]; string fileName = ""; bool blnIsApprover = false; if (Validate()) { using (clsGroupUpdate objEdit = new clsGroupUpdate()) { fileName = System.Guid.NewGuid().ToString() + Path.GetExtension(fuAttachment.FileName); int intGroupUpdateCode = Request.QueryString["GroupUpdateCode"].ToString().ToInt(); objEdit.GroupUpdateCode = intGroupUpdateCode; objEdit.Title = txtTitle.Text; objEdit.Description = txtDescription.Text; objEdit.Content = ckeContents.Text; objEdit.DepartmentCode = clsEmployee.GetDepartmentCode(username); objEdit.DivisionCode = clsEmployee.GetDivisionCode(username); objEdit.CreateBy = username; objEdit.ModifyBy = username; objEdit.Status = hdnGroupHead.Value == username ? "1" : "0"; objEdit.Enabled = "1"; objEdit.Contributor = txtContributor.Text; objEdit.PhotoSource = txtPhotoSource.Text; if (fuAttachment.HasFile) { objEdit.ImageFilename = fileName; } else { objEdit.ImageFilename = ""; } if (pFinalize == true) { if (objEdit.Status == "1") { blnIsApprover = true; } } else { //Save As draft objEdit.Status = "5"; } if (objEdit.Update(blnIsApprover) > 0) { if (fuAttachment.HasFile) { fuAttachment.SaveAs(Server.MapPath(@"~\UploadedFiles\GroupUpdates\" + fileName)); } if (hndIsPreview.Value == string.Empty) { Response.Redirect("GroupUpdateMain.aspx"); } } } } }
protected void SaveData(bool pFinalize) { string username = Request.Cookies["Speedo"]["UserName"]; string fileName = ""; bool blnIsApprover = false; DataTable tblApprover = new DataTable(); tblApprover.Columns.Add("ApprovalLevel"); tblApprover.Columns.Add("Username"); //Add Grouphead in datatable DataRow drnew = tblApprover.NewRow(); drnew["ApprovalLevel"] = "1"; drnew["Username"] = hdnGroupHead.Value; tblApprover.Rows.Add(drnew); //Add DivisionHead in datatable //drnew = tblApprover.NewRow(); //drnew["ApprovalLevel"] = "2"; //drnew["Username"] = hdnDivisionHead.Value; //tblApprover.Rows.Add(drnew); if (Validate()) { using (clsGroupUpdate objAdd = new clsGroupUpdate()) { fileName = System.Guid.NewGuid().ToString() + Path.GetExtension(fuAttachment.FileName); objAdd.Title = txtTitle.Text; objAdd.Description = txtDescription.Text; objAdd.Content = ckeContents.Text; objAdd.DepartmentCode = clsEmployee.GetDepartmentCode(username); objAdd.DivisionCode = clsEmployee.GetDivisionCode(username); objAdd.Contributor = txtContributor.Text; objAdd.PhotoSource = txtPhotoSource.Text; objAdd.CreateBy = username; objAdd.ModifyBy = username; objAdd.Status = hdnGroupHead.Value == username ? "1" : "0"; objAdd.Enabled = "1"; objAdd.ImageFilename = fileName; if (pFinalize == true) { if (objAdd.Status == "1") { blnIsApprover = true; } } else { //Save As draft objAdd.Status = "5"; } if (hndGroupUpdateCode.Value == string.Empty) { int intGroupUpdateCode = objAdd.Insert(tblApprover, blnIsApprover); if (intGroupUpdateCode > 0) { fuAttachment.SaveAs(Server.MapPath(@"~\UploadedFiles\GroupUpdates\" + fileName)); if (pFinalize == true) { Response.Redirect("GroupUpdateMain.aspx"); } else { hndGroupUpdateCode.Value = intGroupUpdateCode.ToString(); } } } else { if (fuAttachment.HasFile) { objAdd.ImageFilename = fileName; } else { objAdd.ImageFilename = ""; } objAdd.GroupUpdateCode = hndGroupUpdateCode.Value.ToString().ToInt(); if (objAdd.Update(blnIsApprover) > 0) { if (fuAttachment.HasFile) { fuAttachment.SaveAs(Server.MapPath(@"~\UploadedFiles\GroupUpdates\" + fileName)); } if (hndIsPreview.Value == string.Empty) { Response.Redirect("GroupUpdateMain.aspx"); } } } } } }