コード例 #1
0
        public Boolean updateDocCommList(doccommenter doc, doccommenter prevdoc)
        {
            Boolean status   = true;
            string  utString = "";

            try
            {
                string updateSQL = "update DocumentCommenter set EmployeeID='" + doc.EmployeeID + "'," +
                                   " Status=" + doc.DocumentStatus +
                                   " where DocumentID='" + prevdoc.DocumentID + "'" +
                                   " and EmployeeID='" + prevdoc.EmployeeID + "'";
                utString = utString + updateSQL + Main.QueryDelimiter;
                utString = utString +
                           ActivityLogDB.PrepareActivityLogQquerString("update", "DocumentCommenter", "", 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);
        }
コード例 #2
0
        public Boolean insertDocCommList(doccommenter doc)
        {
            Boolean status   = true;
            string  utString = "";

            try
            {
                DateTime cdt       = DateTime.Now;
                string   updateSQL = "insert into DocumentCommenter (DocumentID,EmployeeID,Status,CreateTime,CreateUser)" +
                                     "values (" +
                                     "'" + doc.DocumentID + "'," +
                                     "'" + doc.EmployeeID + "'," +
                                     doc.DocumentStatus + "," +
                                     "GETDATE()" + "," +
                                     "'" + Login.userLoggedIn + "'" + ")";
                utString = utString + updateSQL + Main.QueryDelimiter;
                utString = utString +
                           ActivityLogDB.PrepareActivityLogQquerString("insert", "DocumentCommenter", "", 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);
        }
コード例 #3
0
        public Boolean validateDocument(doccommenter doc)
        {
            Boolean status = true;

            try
            {
                if (doc.DocumentID.Trim().Length == 0 || doc.DocumentID == 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);
        }
コード例 #4
0
        public List <doccommenter> getDocCommList()
        {
            doccommenter        docComm;
            List <doccommenter> DocCommList = new List <doccommenter>();

            try
            {
                SqlConnection conn  = new SqlConnection(Login.connString);
                string        query = "select a.DocumentID, b.DocumentName,a.EmployeeID,c.Name," +
                                      "a.status,d.UserID from DocumentCommenter a, Document b, " +
                                      "Employee c,ERPUser d where a.DocumentID=b.DocumentID and " +
                                      "a.EmployeeID=c.EmployeeID and " +
                                      "a.EmployeeID=d.EmployeeID " +
                                      "order by a.DocumentID,c.Name";

                SqlCommand cmd = new SqlCommand(query, conn);
                conn.Open();
                SqlDataReader reader = cmd.ExecuteReader();
                while (reader.Read())
                {
                    docComm                = new doccommenter();
                    docComm.DocumentID     = reader.GetString(0);
                    docComm.DocumentName   = reader.GetString(1);
                    docComm.EmployeeID     = reader.GetString(2);
                    docComm.EmployeeName   = reader.GetString(3);
                    docComm.DocumentStatus = reader.GetInt32(4);
                    docComm.UserID         = reader.GetString(5);
                    DocCommList.Add(docComm);
                }
                conn.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(this.ToString() + "-" + System.Reflection.MethodBase.GetCurrentMethod().Name + "() : Error");
            }
            return(DocCommList);
        }