public Boolean updateTapalDetails(tapal tap, int rowid) { Boolean status = true; string utString = ""; try { string updateSQL = "update TapalStorage set" + " InwardDocumentType='" + tap.InwardDocumentType + "', " + "ReceivedFrom='" + tap.ReceivedFrom + "'," + " Description='" + tap.Description + "' " + "where RowID='" + rowid + "'"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("update", "AccoutCode", "", 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 updateTapalStatus(tapal tap) { Boolean status = true; string utString = ""; try { string updateSQL = "update TapalStorage set Status = 1" + " where RowID=" + tap.RowID; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("update", "TapalStorage", "", updateSQL) + Main.QueryDelimiter; if (!UpdateTable.UT(utString)) { status = false; } } catch (Exception) { status = false; MessageBox.Show(this.ToString() + "-" + System.Reflection.MethodBase.GetCurrentMethod().Name + "() : Error"); } return(status); }
public Boolean validateTapal(tapal tap) { Boolean status = true; string utString = ""; try { if (tap.FileName.Trim().Length == 0 || tap.FileName == null) { return(false); } if (tap.InwardDocumentType.Trim().Length == 0 || tap.InwardDocumentType == null) { return(false); } if (tap.ReceivedFrom.Trim().Length == 0 || tap.ReceivedFrom == null) { return(false); } } catch (Exception) { } return(status); }
public Boolean inserttapal(tapal tap) { Boolean status = true; string utString = ""; try { string updateSQL = "insert into TapalStorage " + "(DocumentID, Date, FileName, InwardDocumentType,ReceivedFrom,Description, DocumentContent,ProtectionLevel," + " FileType, Status ,CreateTime,CreateUser) " + "values ('" + tap.DocumentID + "','" + tap.Date.ToString("yyyy-MM-dd") + "','" + tap.FileName + "','" + tap.InwardDocumentType + "','" + tap.ReceivedFrom.Replace("'", "''") + "','" + tap.Description.Replace("'", "''") + "','" + tap.DocumentContent + "'," + tap.ProtectionLevel + ",'" + tap.FileType + "'," + tap.Status + "," + "GETDATE()" + ",'" + Login.userLoggedIn + "')"; tap.DocumentContent = ""; if (!UpdateTable.UTSingleQuery(updateSQL)) { status = false; } } catch (Exception ex) { status = false; } return(status); }
public Boolean insertTapalDistribution(List <user> UserList, tapal tap) { Boolean status = true; string utString = ""; try { string updateSQL = ""; //string updateSQL = "Delete from PODetail where DocumentID='" + poh.DocumentID + "'" + // " and TemporaryNo=" + poh.TemporaryNo + // " and TemporaryDate='" + poh.TemporaryDate.ToString("yyyy-MM-dd") + "'"; //utString = utString + updateSQL + Main.QueryDelimiter; //utString = utString + // ActivityLogDB.PrepareActivityLogQquerString("delete", "PODetail", "", updateSQL) + // Main.QueryDelimiter; foreach (user us in UserList) { updateSQL = "insert into TapalDistribution " + "(DocumentID, TapalReference, UserID, Date, Status,CreateTime,CreateUser) " + "values ('" + tap.DocumentID + "'," + tap.RowID + ",'" + us.userID + "','" + tap.Date.ToString("yyyy-MM-dd") + "'," + tap.Status + "," + "GETDATE()" + ",'" + Login.userLoggedIn + "')"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("insert", "TapalDistribution", "", updateSQL) + Main.QueryDelimiter; } if (!UpdateTable.UT(utString)) { status = false; } } catch (Exception ex) { status = false; } return(status); }
public List <tapal> getTapalPicFileDetails() { tapal tap; List <tapal> List = new List <tapal>(); try { string query = "select RowID,DocumentID, Date, FileName, InwardDocumentType,ReceivedFrom," + " ProtectionLevel, FileType, Status , CreateUser, CreateTime,Description " + " from TapalStorage where Status = 0 and CreateUser = '******'"; SqlConnection conn = new SqlConnection(Login.connString); SqlCommand cmd = new SqlCommand(query, conn); conn.Open(); SqlDataReader reader = cmd.ExecuteReader(); while (reader.Read()) { tap = new tapal(); tap.RowID = reader.GetInt32(0); tap.DocumentID = reader.GetString(1); tap.Date = reader.GetDateTime(2); tap.FileName = reader.GetString(3); tap.InwardDocumentType = reader.GetString(4); tap.ReceivedFrom = reader.GetString(5); tap.ProtectionLevel = reader.GetInt32(6); tap.FileType = reader.GetString(7); tap.Status = reader.GetInt32(8); tap.CreateUser = reader.GetString(9); tap.CreateTime = reader.GetDateTime(10); tap.Description = reader.IsDBNull(11)?"":reader.GetString(11); List.Add(tap); } conn.Close(); } catch (Exception ex) { MessageBox.Show(this.ToString() + "-" + System.Reflection.MethodBase.GetCurrentMethod().Name + "() : Error"); } return(List); }