public Boolean updateSubdocReceiver(subdocreceiver doc, subdocreceiver prevdoc) { Boolean status = true; string utString = ""; try { string updateSQL = "update SubDocumentReceivers set EmployeeID='" + doc.EmployeeID + "'," + " SubDocumentID= '" + doc.SubDocID + "'," + " Status=" + doc.Status + " where RowID=" + prevdoc.RowID; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("update", "SubDocumentReceivers", "", updateSQL) + Main.QueryDelimiter; if (!UpdateTable.UT(utString)) { status = false; } } catch (Exception ex) { MessageBox.Show(this.ToString() + "-" + System.Reflection.MethodBase.GetCurrentMethod().Name + "() : Error"); status = false; } return(status); }
public Boolean validateDocument(subdocreceiver doc) { Boolean status = true; try { if (doc.DocumentID.Trim().Length == 0 || doc.DocumentID == null) { return(false); } if (doc.SubDocID.Trim().Length == 0 || doc.SubDocID == null) { return(false); } if (doc.EmployeeID.Trim().Length == 0 || doc.EmployeeID == null) { return(false); } } catch (Exception ex) { MessageBox.Show(this.ToString() + "-" + System.Reflection.MethodBase.GetCurrentMethod().Name + "() : Error"); return(false); } return(status); }
public Boolean insertSubDocumentReceivers(subdocreceiver doc) { Boolean status = true; string utString = ""; try { DateTime cdt = DateTime.Now; string updateSQL = "insert into SubDocumentReceivers (DocumentID,SubDocumentID,EmployeeID,Status,CreateTime,CreateUser)" + "values (" + "'" + doc.DocumentID + "'," + "'" + doc.SubDocID + "'," + "'" + doc.EmployeeID + "'," + doc.Status + "," + "GETDATE()" + "," + "'" + Login.userLoggedIn + "'" + ")"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("insert", "SubDocumentReceivers", "", updateSQL) + Main.QueryDelimiter; if (!UpdateTable.UT(utString)) { status = false; } } catch (Exception ex) { MessageBox.Show(this.ToString() + "-" + System.Reflection.MethodBase.GetCurrentMethod().Name + "() : Error"); status = false; } return(status); }
public List <subdocreceiver> getsubdocreceiverList() { subdocreceiver drrec; List <subdocreceiver> subdocreceivers = new List <subdocreceiver>(); try { SqlConnection conn = new SqlConnection(Login.connString); string query = "select a.DocumentID, b.DocumentName,a.EmployeeID,c.Name," + "a.status,a.RowId,a.SubDocumentID from SubDocumentReceivers a, Document b, " + "Employee c where a.DocumentID=b.DocumentID and " + "a.EmployeeID=c.EmployeeID " + "order by c.Name"; SqlCommand cmd = new SqlCommand(query, conn); conn.Open(); SqlDataReader reader = cmd.ExecuteReader(); while (reader.Read()) { drrec = new subdocreceiver(); drrec.DocumentID = reader.GetString(0); drrec.DocumentName = reader.GetString(1); drrec.EmployeeID = reader.GetString(2); drrec.EmployeeName = reader.GetString(3); drrec.Status = reader.GetInt32(4); drrec.RowID = reader.GetInt32(5); drrec.SubDocID = reader.GetString(6); subdocreceivers.Add(drrec); } conn.Close(); } catch (Exception ex) { MessageBox.Show(this.ToString() + "-" + System.Reflection.MethodBase.GetCurrentMethod().Name + "() : Error"); } return(subdocreceivers); }