//int fileID = 0; protected void Page_Load(object sender, EventArgs e) { lblProcedureId.Attributes.Add("style", "visibility:hidden"); if (AjaxFileUploadInsertImage.IsInFileUploadPostBack) { } else { if (!IsPostBack) { BindUserList(); txtProcedureSectionDetails.config.toolbar = new object[] { new object[] { "Source", "-", "Save", "NewPage", "Preview", "-", "Templates" }, new object[] { "Cut", "Copy", "Paste", "PasteText", "PasteFromWord", "-", "Print", "SpellChecker", "Scayt" }, new object[] { "Undo", "Redo", "-", "Find", "Replace", "-", "SelectAll", "RemoveFormat" }, new object[] { "Form", "Checkbox", "Radio", "TextField", "Textarea", "Select", "Button", "ImageButton", "HiddenField" }, "/", new object[] { "Bold", "Italic", "Underline", "Strike", "-", "Subscript", "Superscript" }, new object[] { "NumberedList", "BulletedList", "-", "Outdent", "Indent", "Blockquote", "CreateDiv" }, new object[] { "JustifyLeft", "JustifyCenter", "JustifyRight", "JustifyBlock" }, new object[] { "BidiLtr", "BidiRtl" }, new object[] { "Link", "Unlink", "Anchor" }, new object[] { "Image", "Flash", "Table", "HorizontalRule", "Smiley", "SpecialChar", "PageBreak", "Iframe" }, "/", new object[] { "Styles", "Format", "Font", "FontSize" }, new object[] { "TextColor", "BGColor" }, new object[] { "Maximize", "ShowBlocks", "-", "InsertImage" }, }; // fileID = Convert.ToInt32(Request.PathInfo.Substring(1)); lblProcedureId.Text = Request.QueryString["FileID"].ToString(); txtProcedureSectionDetails.Width = 800; ////get the version & Operation info by Check out fileID DataTable dsOperationInfo = BLL_QMSDB_Procedures.QMSDBProcedures_Edit(int.Parse(lblProcedureId.Text)); if (dsOperationInfo.Rows.Count > 0) { //get the last row of the table to know the current status of the file string FileStatus = dsOperationInfo.Rows[0]["CHECK_INOUT_STATUS"].ToString(); string User = dsOperationInfo.Rows[0]["MODIFIED_BY"].ToString(); if (FileStatus == "true" && (Convert.ToInt32(Session["USERID"]) != Convert.ToInt32(dsOperationInfo.Rows[0]["MODIFIED_BY"].ToString()))) { string Message = "The file is already Checked Out by " + dsOperationInfo.Rows[0]["MODIFIED_BY"].ToString(); String msg = String.Format("myMessage('" + Message + "')"); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msg", msg, true); } else { showSaveDialog(); } } else { showSaveDialog(); } } } LoadtreeView(); }
protected void Page_Load(object sender, EventArgs e) { if (AjaxFileUploadInsertImage.IsInFileUploadPostBack) { } else { if (!IsPostBack) { DataTable dtprocedure= BLL_QMSDB_Procedures.QMSDBProcedures_Edit(Convert.ToInt32(Request.QueryString["PROCEDURE_ID"])); txtProcedureName.Text = Convert.ToString(dtprocedure.Rows[0]["PROCEDURES_NAME"]); txtProcedureCode.Text = Convert.ToString(dtprocedure.Rows[0]["PROCEDURE_CODE"]); Session["UploadedFiles_Name"] = ""; Load_Sections(); if (Request.QueryString["CheckOut"] != null) { CheckCheckOut(Request.QueryString["PROCEDURE_ID"]); } imgbtnPreviewProdecure_Click(null, null); } string js = "initScripts();"; ScriptManager.RegisterStartupScript(this, this.GetType(), "script1", js, true); txtProcedureSectionDetails.config.toolbar = new object[] { new object[] { "Templates" }, new object[] { "Cut", "Copy", "Paste", "PasteText", "PasteFromWord", "-", "Print", "SpellChecker", "Scayt","Image" }, new object[] { "Undo", "Redo", "-", "Find", "Replace", "-", "SelectAll", "RemoveFormat" }, new object[] { "Checkbox", "Radio", "TextField", "Textarea", "Select", "Button", "ImageButton" }, new object[] { "InsertImage", "Table", "HorizontalRule", "Smiley", "SpecialChar", "PageBreak" }, new object[] { "Bold", "Italic", "Underline", "Strike", "-", "Subscript", "Superscript" }, new object[] { "NumberedList", "BulletedList", "-", "Outdent", "Indent", "Blockquote" }, new object[] { "JustifyLeft", "JustifyCenter", "JustifyRight", "JustifyBlock" }, new object[] { "BidiLtr", "BidiRtl" }, new object[] { "Link", "Unlink", "Anchor" }, "/", new object[] { "Styles", "Format", "Font", "FontSize" }, new object[] { "TextColor", "BGColor" }, }; BindUserList(); btnLoadUploadedFiles_Click(null, null); } }
protected void Page_Load(object sender, EventArgs e) { lblProcedureId.Attributes.Add("style", "visibility:hidden"); if (!IsPostBack) { txtProcedureDetails.config.toolbar = new object[] { new object[] { "Print" }, }; txtProcedureDetails.BodyClass = "cke_show_borders"; txtProcedureDetails.Enabled = false; txtProcedureDetails.ReadOnly = true; txtProcedureDetails.FilebrowserImageUploadUrl = "true"; txtProcedureDetails.BackColor = System.Drawing.Color.LightYellow; txtProcedureDetails.Width = 900; if (Convert.ToString(Session["userid"]) == "") { Response.Write("<center><br><br><h2><font color=gray>Session is lost. Please click on the Logout option and login again.</font></h2></center>"); Response.End(); } if (Request.QueryString["DocVer"] != null) { if (Request.QueryString["DocVer"].ToString() != "") { string[] temp = Request.QueryString["DocVer"].ToString().Split('-'); DocID = temp[0]; //DocVersion = temp[1]; } } else { DocID = Request.QueryString["DocID"]; lblProcedureId.Text = Request.QueryString["DocID"]; } System.Data.DataTable dsFileDetails = BLL_QMSDB_Procedures.QMSDBProcedures_Edit(int.Parse(lblProcedureId.Text)); if (dsFileDetails.Rows.Count > 0) { DataRow dr = dsFileDetails.Rows[0]; lblDocName.Text = dr["PROCEDURE_CODE"].ToString() + "/" + dr["PROCEDURES_NAME"].ToString(); lblCurrentVersion.Text = dr["PUBLISH_VERSION"].ToString(); lblProcedureStatus.Text = dr["PROCEDURE_STATUS"].ToString(); //lblDetails.Text = dr["HeaderDetails"].ToString().Replace("@PROCEDURECODE", dr["PROCEDURE_CODE"].ToString()).Replace("@publishDate", dr["PUBLISHED_DATE"].ToString()).Replace("@ApproverName", dr["PUBLISHED_BY"].ToString()).Replace("@CreatedBy", dr["CREATED_BY_USER"].ToString()) + dr["DETAILS"].ToString(); lblDetails.Text = dr["DETAILS"].ToString(); // txtProcedureDetails.Text = dr["HeaderDetails"].ToString() + dr["DETAILS"].ToString(); lblHeader.Text = dr["HeaderDetails"].ToString().Replace("@ProcedureCode", dr["PROCEDURE_CODE"].ToString()).Replace("@publishdate", dr["PUBLISHED_DATE"].ToString()).Replace("@ApproverName", dr["PUBLISHED_BY"].ToString()).Replace("@CreatedBy", dr["CREATED_BY_USER"].ToString()).Replace("@UserName", dr["CREATED_BY_USER"].ToString()).Replace("@FolderName", dr["FOLDER_NAME"].ToString()).Replace("@historiCode", dr["PUBLISH_VERSION"].ToString()); txtProcedureDetails.Text = lblHeader.Text + dr["DETAILS"].ToString(); } } }
public void browseFileDialog() { //save the check out information into the database int i = BLL_QMSDB_Procedures.QMSDBProcedure_CheckOUT(int.Parse(lblProcedureId.Text), Convert.ToInt32(Session["USERID"])); //get latest File details by the file ID DataTable dsFileDetails = BLL_QMSDB_Procedures.QMSDBProcedures_Edit(int.Parse(lblProcedureId.Text)); string navURL = ""; if (dsFileDetails.Rows.Count > 0) { txtProcedureSectionDetails.Text = dsFileDetails.Rows[0]["DETAILS"].ToString(); } }
public void showSaveDialog(string procedureid) { //checking for avoid the multiple Check Out the file DataTable dsOperationInfo = BLL_QMSDB_Procedures.QMSDBProcedures_Edit(int.Parse(procedureid)); if (dsOperationInfo.Rows.Count > 0) { if (dsOperationInfo.Rows[0]["CHECK_INOUT_STATUS"].ToString() == "1") { String msg = String.Format("alert('You have already Checked Out the file.');window.close();"); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msg", msg, true); } else { int i = BLL_QMSDB_Procedures.QMSDBProcedure_CheckOUT(int.Parse(procedureid), Convert.ToInt32(Session["USERID"])); } } }
/// <summary> /// this is check the all the condition & operation for particular file, give the apropriate message to end user. /// </summary> public void showSaveDialog() { //checking for avoid the multiple Check Out the file DataTable dsOperationInfo = BLL_QMSDB_Procedures.QMSDBProcedures_Edit(int.Parse(lblProcedureId.Text)); if (dsOperationInfo.Rows.Count > 0) { if (dsOperationInfo.Rows[0]["CHECK_INOUT_STATUS"].ToString() == "true") { String msg = String.Format("myMessage('You have already Checked Out the file.');window.location.href='fileloader.aspx?docid=" + lblProcedureId.Text + "';"); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msg", msg, true); } else { browseFileDialog(); } } else { browseFileDialog(); } }
public void CheckCheckOut(string procedureid) { DataTable dsOperationInfo = BLL_QMSDB_Procedures.QMSDBProcedures_Edit(int.Parse(procedureid)); if (dsOperationInfo.Rows.Count > 0) { //get the last row of the table to know the current status of the file string FileStatus = dsOperationInfo.Rows[0]["CHECK_INOUT_STATUS"].ToString(); string User = dsOperationInfo.Rows[0]["MODIFIED_BY"].ToString(); if (FileStatus == "1" && (Convert.ToInt32(Session["USERID"]) != Convert.ToInt32(dsOperationInfo.Rows[0]["MODIFIED_BY"].ToString()))) { string Message = "The file is already Checked Out by " + dsOperationInfo.Rows[0]["MODIFIED_BY"].ToString(); String msg = String.Format("alert('" + Message + "');window.close();"); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msg", msg, true); } else { showSaveDialog(procedureid); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { DataTable dtprocedure = BLL_QMSDB_Procedures.QMSDBProcedures_Edit(Convert.ToInt32(Request.QueryString["PROCEDURE_ID"])); txtProcedureName.Text = Convert.ToString(dtprocedure.Rows[0]["PROCEDURES_NAME"]); txtProcedureCode.Text = Convert.ToString(dtprocedure.Rows[0]["PROCEDURE_CODE"]); Session["UploadedFiles_Name"] = ""; Load_Sections(); if (Request.QueryString["CheckOut"] != null) { CheckCheckOut(Request.QueryString["PROCEDURE_ID"]); } imgbtnPreviewProdecure_Click(null, null); } string js = "initScripts();"; ScriptManager.RegisterStartupScript(this, this.GetType(), "script1", js, true); BindUserList(); btnLoadUploadedFiles_Click(null, null); }
private void BindProcedures(string procedureId) { DataTable dtProc; txtProcedureDetails.ReadOnly = true; if (Request.QueryString["FileStatus"].ToString() == "View") { dtProc = BLL_QMSDB_Procedures.QMSDBProcedures_Edit(int.Parse(procedureId)); if (dtProc.Rows.Count > 0) { txtProcedureDetails.Text = dtProc.Rows[0]["HeaderDetails"].ToString().Replace("@ProcedureCode", dtProc.Rows[0]["PROCEDURE_CODE"].ToString()).Replace("@publishdate", dtProc.Rows[0]["PUBLISHED_DATE"].ToString()).Replace("@ApproverName", dtProc.Rows[0]["PUBLISHED_BY"].ToString()).Replace("@CreatedBy", dtProc.Rows[0]["CREATED_BY_USER"].ToString()).Replace("@UserName", dtProc.Rows[0]["CREATED_BY_USER"].ToString()).Replace("@FolderName", dtProc.Rows[0]["FOLDER_NAME"].ToString()).Replace("@historiCode", dtProc.Rows[0]["PUBLISH_VERSION"].ToString()) + dtProc.Rows[0]["DETAILS"].ToString(); lblProcedureName.Text = dtProc.Rows[0]["PROCEDURE_CODE"].ToString() + " / " + dtProc.Rows[0]["PROCEDURES_NAME"].ToString(); pnlCtl.Visible = false; } } else if (Request.QueryString["FileStatus"].ToString() == "ViewEdit") { dtProc = BLL_QMSDB_Procedures.QMSDBProcedures_Edit(int.Parse(procedureId)); if (dtProc.Rows.Count > 0) { txtProcedureDetails.Text = dtProc.Rows[0]["HeaderDetails"].ToString().Replace("@ProcedureCode", dtProc.Rows[0]["PROCEDURE_CODE"].ToString()).Replace("@publishdate", dtProc.Rows[0]["PUBLISHED_DATE"].ToString()).Replace("@ApproverName", dtProc.Rows[0]["PUBLISHED_BY"].ToString()).Replace("@CreatedBy", dtProc.Rows[0]["CREATED_BY_USER"].ToString()).Replace("@UserName", dtProc.Rows[0]["CREATED_BY_USER"].ToString()).Replace("@FolderName", dtProc.Rows[0]["FOLDER_NAME"].ToString()).Replace("@historiCode", dtProc.Rows[0]["PUBLISH_VERSION"].ToString()) + dtProc.Rows[0]["CHANGE_DETAILS"].ToString(); lblProcedureName.Text = dtProc.Rows[0]["PROCEDURE_CODE"].ToString() + " / " + dtProc.Rows[0]["PROCEDURES_NAME"].ToString(); } } else if (Request.QueryString["FileStatus"].ToString() == "Compare") { dtProc = BLL_QMSDB_Procedures.QMSDBProcedures_Edit(int.Parse(procedureId)); if (dtProc.Rows.Count > 0) { Merger a = new Merger(dtProc.Rows[0]["DETAILS"].ToString(), dtProc.Rows[0]["CHANGE_DETAILS"].ToString()); lblProcedureName.Text = dtProc.Rows[0]["PROCEDURE_CODE"].ToString() + " / " + dtProc.Rows[0]["PROCEDURES_NAME"].ToString(); txtProcedureDetails.Text = a.merge(); } } }