public int Update(OAFileDestroy model) { StringBuilder builder = new StringBuilder(); builder.Append("update OA_File_Destroy set"); builder.Append(" where DestroyRecordID=" + model.DestroyRecordID); return(publicDbOpClass.ExecSqlString(builder.ToString())); }
protected void btnAdd_Click(object sender, EventArgs e) { this.Session["FILEDESTROY"] = this.GetSession(); OAFileDestroy value = this.AddOneDestroyRecord(); ArrayList arrayList = (ArrayList)this.Session["FILEDESTROY"]; arrayList.Add(value); this.GVBook.DataSource = arrayList; this.GVBook.DataBind(); this.Session["FILEDESTROY"] = arrayList; }
public int Add(OAFileDestroy model) { StringBuilder builder = new StringBuilder(); builder.Append("insert into OA_File_Destroy("); builder.Append("DestroyRecordID,DestroyFileID"); builder.Append(")"); builder.Append(" values ("); builder.Append("'" + model.DestroyRecordID + "',"); builder.Append(model.DestroyFileID); builder.Append(")"); return(publicDbOpClass.ExecSqlString(builder.ToString())); }
protected void GVBook_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowIndex > -1) { OAFileDestroy oAFileDestroy = (OAFileDestroy)e.Row.DataItem; e.Row.Attributes["onmouseover"] = "OnMouseOverRecord(this);"; e.Row.Attributes["onclick"] = string.Concat(new object[] { "OnRecord(this);ClickRow('", oAFileDestroy.DestroyFileID, "','", Convert.ToString(e.Row.RowIndex + 1), "');" }); e.Row.Cells[0].Text = Convert.ToString(e.Row.RowIndex + 1); HtmlInputText htmlInputText = (HtmlInputText)e.Row.Cells[1].FindControl("txtFileName"); htmlInputText.Value = oAFileDestroy.OAFileCatalog.FileName; htmlInputText.Attributes["ondblclick"] = "javascript:SelectFileName(this,'" + this.LibraryCode + "');"; HtmlInputHidden htmlInputHidden = (HtmlInputHidden)e.Row.Cells[1].FindControl("HdnRecordID"); htmlInputHidden.Value = oAFileDestroy.DestroyFileID.ToString(); HtmlInputText htmlInputText2 = (HtmlInputText)e.Row.Cells[2].FindControl("txtFileCode"); htmlInputText2.Value = oAFileDestroy.OAFileCatalog.FileCode; HtmlInputText htmlInputText3 = (HtmlInputText)e.Row.Cells[3].FindControl("txtPrjName"); htmlInputText3.Value = oAFileDestroy.OAFileCatalog.PrjName; HtmlInputText htmlInputText4 = (HtmlInputText)e.Row.Cells[4].FindControl("txtSecretLevel"); switch (oAFileDestroy.OAFileCatalog.SecretLevel) { case 1: htmlInputText4.Value = "密秘"; return; case 2: htmlInputText4.Value = "机密"; return; case 3: htmlInputText4.Value = "绝密"; break; default: return; } } }
private ArrayList GetSession() { ArrayList arrayList = new ArrayList(); foreach (GridViewRow gridViewRow in this.GVBook.Rows) { OAFileDestroy oAFileDestroy = new OAFileDestroy(); HtmlInputHidden htmlInputHidden = (HtmlInputHidden)gridViewRow.Cells[1].FindControl("HdnRecordID"); oAFileDestroy.DestroyFileID = ((htmlInputHidden.Value.Trim() == "") ? -2 : int.Parse(htmlInputHidden.Value)); HtmlInputText htmlInputText = (HtmlInputText)gridViewRow.Cells[1].FindControl("txtFileName"); oAFileDestroy.OAFileCatalog.FileName = htmlInputText.Value; HtmlInputText htmlInputText2 = (HtmlInputText)gridViewRow.Cells[2].FindControl("txtFileCode"); oAFileDestroy.OAFileCatalog.FileCode = htmlInputText2.Value; HtmlInputText htmlInputText3 = (HtmlInputText)gridViewRow.Cells[2].FindControl("txtPrjName"); oAFileDestroy.OAFileCatalog.PrjName = htmlInputText3.Value; HtmlInputText htmlInputText4 = (HtmlInputText)gridViewRow.Cells[2].FindControl("txtSecretLevel"); oAFileDestroy.OAFileCatalog.SecretLevel = ((htmlInputText4.Value.Trim() == "密秘") ? 1 : ((htmlInputText4.Value.Trim() == "机密") ? 2 : ((htmlInputText4.Value.Trim() == "绝密") ? 3 : 0))); oAFileDestroy.DestroyRecordID = this.RecordCode; arrayList.Add(oAFileDestroy); } return(arrayList); }
public ArrayList GetModel(string strWhere) { ArrayList list = new ArrayList(); StringBuilder builder = new StringBuilder(); builder.Append("select * FROM V_OA_File_Destroy "); if (strWhere.Trim() != "") { builder.Append(" where " + strWhere); } DataTable table = publicDbOpClass.DataTableQuary(builder.ToString()); if (table.Rows.Count > 0) { for (int i = 0; i < table.Rows.Count; i++) { OAFileDestroy destroy = new OAFileDestroy(); if (table.Rows[i]["DestroyRecordID"].ToString() != "") { destroy.DestroyRecordID = new Guid(table.Rows[i]["DestroyRecordID"].ToString()); } if (table.Rows[i]["DestroyFileID"].ToString() != "") { destroy.DestroyFileID = int.Parse(table.Rows[i]["DestroyFileID"].ToString()); } destroy.OAFileCatalog.FileName = table.Rows[i]["FileName"].ToString(); destroy.OAFileCatalog.FileCode = table.Rows[i]["FileCode"].ToString(); destroy.OAFileCatalog.PrjName = table.Rows[i]["PrjName"].ToString(); if (table.Rows[i]["SecretLevel"].ToString() != "") { destroy.OAFileCatalog.SecretLevel = int.Parse(table.Rows[i]["SecretLevel"].ToString()); } list.Add(destroy); } } return(list); }