protected void btnAdd_Click(object sender, System.EventArgs e) { OAWFApplyItem data = this.GetData(); if (this.OperateType == "add") { int num = this.hrAction.Add(data); if (num > 0) { base.RegisterScript("successed();"); } else { base.RegisterScript("top.ui.alert('没有相关数据可添加');"); } } if (this.OperateType == "upd") { int num = this.hrAction.Update(data); if (num > 0) { base.RegisterScript("successed();"); return; } base.RegisterScript("top.ui.alert('没有相关数据可更新');"); } }
private void EditDisplay() { OAWFApplyItem model = this.hrAction.GetModel(this.RecordID); if (model != null) { this.txtLayoutName.Text = model.Title; this.txtRemark.Text = model.Remark; } }
public int Update(OAWFApplyItem model) { StringBuilder builder = new StringBuilder(); builder.Append("update OA_WF_ApplyItem set "); builder.Append("UserCode='" + model.UserCode + "',"); builder.Append("RecordDate='" + model.RecordDate + "',"); builder.Append("Title='" + model.Title + "',"); builder.Append("Remark='" + model.Remark + "',"); builder.Append("OriginalName='" + model.OriginalName + "',"); builder.Append("FilePath='" + model.FilePath + "',"); builder.Append("TemplateID=" + model.TemplateID); builder.Append(" where RecordID='" + model.RecordID + "'"); return(publicDbOpClass.ExecSqlString(builder.ToString())); }
protected void gvAuditingList_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { DataRowView dataRowView = (DataRowView)e.Row.DataItem; e.Row.Attributes["onmouseover"] = "OnMouseOverRecord(this);"; string text = this.gvAuditingList.DataKeys[e.Row.RowIndex]["InstanceCode"].ToString(); string text2 = this.gvAuditingList.DataKeys[e.Row.RowIndex]["NoteID"].ToString(); string text3 = this.gvAuditingList.DataKeys[e.Row.RowIndex]["IsAllPass"].ToString(); string text4 = this.gvAuditingList.DataKeys[e.Row.RowIndex]["NodeID"].ToString(); string text5 = this.gvAuditingList.DataKeys[e.Row.RowIndex]["BusinessCode"].ToString(); string text6 = dataRowView["BusinessClass"].ToString(); string text7 = FlowAuditAction.DoWithUrl(text5); if (text7 == "about:blank") { text7 = ""; } e.Row.Attributes["onclick"] = string.Concat(new string[] { "OnRecord(this);ClickRow('", text5, "','", text, "','", text2, "','", text3, "','", text4, "','", text7, "','", text6, "');" }); if (dataRowView["BusinessCode"].ToString() == "999") { OAWFApplyItem model = this.hrAction.GetModel((System.Guid)dataRowView["InstanceCode"]); if (model != null) { e.Row.Cells[1].Text = model.Title; } } } }
public int Add(OAWFApplyItem model) { StringBuilder builder = new StringBuilder(); builder.Append("insert into OA_WF_ApplyItem("); builder.Append("RecordID,AuditState,UserCode,RecordDate,BusinessClass,Title,Remark,OriginalName,FilePath,TemplateID"); builder.Append(")"); builder.Append(" values ("); builder.Append("'" + model.RecordID + "',"); builder.Append(model.AuditState + ","); builder.Append("'" + model.UserCode + "',"); builder.Append("'" + model.RecordDate + "',"); builder.Append("'" + model.BusinessClass + "',"); builder.Append("'" + model.Title + "',"); builder.Append("'" + model.Remark + "',"); builder.Append("'" + model.OriginalName + "',"); builder.Append("'" + model.FilePath + "',"); builder.Append(model.TemplateID); builder.Append(")"); return(publicDbOpClass.ExecSqlString(builder.ToString())); }
public OAWFApplyItem GetModel(Guid RecordID) { StringBuilder builder = new StringBuilder(); builder.Append(" select RecordID,AuditState,UserCode,RecordDate,BusinessClass,Title,Remark,OriginalName,FilePath,TemplateID "); builder.Append(" from OA_WF_ApplyItem "); builder.Append(" where RecordID='" + RecordID + "' "); OAWFApplyItem item = new OAWFApplyItem(); DataSet set = publicDbOpClass.DataSetQuary(builder.ToString()); if (set.Tables[0].Rows.Count <= 0) { return(null); } if (set.Tables[0].Rows[0]["RecordID"].ToString() != "") { item.RecordID = new Guid(set.Tables[0].Rows[0]["RecordID"].ToString()); } if (set.Tables[0].Rows[0]["AuditState"].ToString() != "") { item.AuditState = int.Parse(set.Tables[0].Rows[0]["AuditState"].ToString()); } item.UserCode = set.Tables[0].Rows[0]["UserCode"].ToString(); if (set.Tables[0].Rows[0]["RecordDate"].ToString() != "") { item.RecordDate = DateTime.Parse(set.Tables[0].Rows[0]["RecordDate"].ToString()); } item.BusinessClass = set.Tables[0].Rows[0]["BusinessClass"].ToString(); item.Title = set.Tables[0].Rows[0]["Title"].ToString(); item.Remark = set.Tables[0].Rows[0]["Remark"].ToString(); item.OriginalName = set.Tables[0].Rows[0]["OriginalName"].ToString(); item.FilePath = set.Tables[0].Rows[0]["FilePath"].ToString(); if (set.Tables[0].Rows[0]["TemplateID"].ToString() != "") { item.TemplateID = (int)set.Tables[0].Rows[0]["TemplateID"]; } return(item); }
protected void gvAuditingList_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Cells[0].Text = Convert.ToString(e.Row.RowIndex + 1) + "、"; DataRowView dataRowView = (DataRowView)e.Row.DataItem; string text = dataRowView["InstanceCode"].ToString(); string text2 = dataRowView["NoteID"].ToString(); string text3 = dataRowView["IsAllPass"].ToString(); string text4 = dataRowView["NodeID"].ToString(); string text5 = dataRowView["BusinessCode"].ToString(); string text6 = dataRowView["BusinessClass"].ToString(); Convert.ToInt32(dataRowView["During"]); decimal d = 0m; try { d = Convert.ToDecimal(dataRowView["cs"]); } catch { } LinkButton linkButton = (LinkButton)e.Row.Cells[1].Controls[0]; if (dataRowView["BusinessCode"].ToString() == "999") { OAWFApplyItem model = this.hrAction.GetModel((Guid)dataRowView["InstanceCode"]); if (model != null) { if (model.Title.Length > 12) { linkButton.Text = model.Title.Substring(0, 11) + ".. "; linkButton.Attributes["title"] = model.Title; } else { linkButton.Text = model.Title + " "; linkButton.Attributes["title"] = model.Title; } } } linkButton.Attributes["class"] = "firstpage"; linkButton.Style["cursor"] = "hand"; if (d > 0m) { string str = "超时"; linkButton.Text = "[<font color=\"red\">" + str + "</font>]" + linkButton.Text; } string text7 = string.Concat(new string[] { "../EPC/Workflow/AuditFrame.aspx?ic=", text, "&id=", text2, "&pass="******"&nid=", text4, "&bc=", text5, "&bcl=", text6 }); linkButton.Attributes.Add("para", text7); linkButton.Attributes["onclick"] = "javascript:parent.desktop.flowclass = window;toolbox_oncommand('" + text7 + "', '流程审核');"; } }
protected void gvAuditingList_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Cells[0].Text = Convert.ToString(e.Row.RowIndex + 1); DataRowView dataRowView = (DataRowView)e.Row.DataItem; string text = dataRowView["InstanceCode"].ToString(); string text2 = dataRowView["NoteID"].ToString(); string text3 = dataRowView["IsAllPass"].ToString(); string text4 = dataRowView["NodeID"].ToString(); string text5 = dataRowView["BusinessCode"].ToString(); string text6 = dataRowView["BusinessClass"].ToString(); Convert.ToInt32(dataRowView["During"]); decimal d = 0m; try { d = Convert.ToDecimal(dataRowView["cs"]); } catch { } LinkButton linkButton = (LinkButton)e.Row.Cells[1].Controls[0]; if (dataRowView["BusinessCode"].ToString() == "999") { OAWFApplyItem model = this.hrAction.GetModel((Guid)dataRowView["InstanceCode"]); if (model != null) { if (model.Title.Length > 20) { linkButton.Text = model.Title.Substring(0, 19) + ".. "; linkButton.Attributes["title"] = model.Title; } else { linkButton.Text = model.Title + " "; linkButton.Attributes["title"] = model.Title; } } } linkButton.Attributes["class"] = "firstpage"; if (d > 0m) { string str = "超时"; linkButton.Text = "[<font color=\"red\">" + str + "</font>]" + linkButton.Text; } string str2 = string.Concat(new string[] { "../EPC/Workflow/WorkflowAuditFrame.aspx?ic=", text, "&id=", text2, "&pass="******"&nid=", text4, "&bc=", text5, "&bcl=", text6 }); linkButton.Attributes["onclick"] = "javascript:if(window.showModalDialog('" + str2 + "', window, 'dialogHeight:600px;dialogWidth:800px;center:1;help:0;status:0;')){window.window.location.reload(true)}else{return false;};"; } }