Esempio n. 1
0
        public Boolean UpdateDocumentDetails(documentStorage ds)
        {
            Boolean status   = true;
            string  utString = "";

            try
            {
                string updateSQL = "update DocumentStorage set Description='" + ds.Description +
                                   "', DocumentContent='" + ds.DocumentContent + "'" +
                                   ", LastUpLoadedUser='******'" +
                                   ", LastUpLoadedTime=" + "GETDATE()" +
                                   " where DocumentID='" + ds.DocumentID + "' and DocumentSubID='" + ds.DocumentSubID + "' and FileName='" + ds.FileName + "'";
                ////utString = utString + updateSQL + Main.QueryDelimiter;
                ds.DocumentContent = "";
                ////utString = utString +
                //// ActivityLogDB.PrepareActivityLogQquerString("update", "DocumentStorage", "", updateSQL) +
                //// Main.QueryDelimiter;
                if (!UpdateTable.UTSingleQuery(updateSQL))
                {
                    status = false;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(this.ToString() + "-" + System.Reflection.MethodBase.GetCurrentMethod().Name + "() : Error");
                status = false;
            }
            return(status);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        public Boolean InsertDocumentDetails(documentStorage ds)
        {
            Boolean status   = true;
            string  utString = "";

            try
            {
                string updateSQL = "insert into DocumentStorage " +
                                   "(DocumentID,DocumentSubID,Directory,FileName,Description,DocumentContent,ProtectionLevel,FileType,LastUploadedUser,LastUploadedTime,CreateUser,CreateTime)" +
                                   " values (" +
                                   "'" + ds.DocumentID + "'," +
                                   "'" + ds.DocumentSubID + "'," +
                                   "'" + ds.Directory + "'," +
                                   "'" + ds.FileName + "'," +
                                   "'" + ds.Description + "'," +
                                   "'" + ds.DocumentContent + "'," +
                                   ds.ProtectionLevel + "," +
                                   "'" + ds.FileType + "'," +
                                   "'" + Login.userLoggedIn + "'," + "GETDATE()," +
                                   "'" + Login.userLoggedIn + "'," + "GETDATE()" + ")";
                ds.DocumentContent = "";
                //utString = utString + updateSQL + Main.QueryDelimiter;
                //updateSQL = "";
                ////utString = utString +
                ////ActivityLogDB.PrepareActivityLogQquerString("insert", "DocumentStorage", "", updateSQL) +
                ////Main.QueryDelimiter;
                if (!UpdateTable.UTSingleQuery(updateSQL))
                {
                    status = false;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(this.ToString() + "-" + System.Reflection.MethodBase.GetCurrentMethod().Name + "() : Error");
                status = false;
            }
            return(status);
        }