예제 #1
0
        public Boolean updateDocumentnumber(documentnumber doc)
        {
            Boolean status   = true;
            string  utString = "";

            try
            {
                string updateSQL = "update DocumentNumber set TempNo=" + doc.TemporaryNo + "," +
                                   " DocumentNo = " + doc.DocumentNo +
                                   " where RowID='" + doc.rowid + "'  and DocumentID='" + doc.DocumentID + "' ";
                utString = utString + updateSQL + Main.QueryDelimiter;
                utString = utString +
                           ActivityLogDB.PrepareActivityLogQquerString("update", "DocumentNumber", "", 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 insertDocument(documentnumber doc)
        {
            Boolean status   = true;
            string  utString = "";

            try
            {
                DateTime cdt       = DateTime.Now;
                string   updateSQL = "insert into DocumentNumber (DocumentID,FYID,TempNo,DocumentNo,CreateTime,CreateUser)" +
                                     "values (" +
                                     "'" + doc.DocumentID + "'," +
                                     "'" + doc.fyID + "'," +
                                     "'" + doc.TemporaryNo + "'," +
                                     doc.DocumentNo + "," +
                                     "GETDATE()" + "," +
                                     "'" + Login.userLoggedIn + "'" + ")";
                utString = utString + updateSQL + Main.QueryDelimiter;
                utString = utString +
                           ActivityLogDB.PrepareActivityLogQquerString("insert", "DocumentNumber", "", 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
        //01-03-2018
        public List <documentnumber> getDocumentNo()
        {
            documentnumber        documentrec;
            List <documentnumber> Documents = new List <documentnumber>();

            try
            {
                SqlConnection conn  = new SqlConnection(Login.connString);
                string        query = "select a.RowID,a.FYID,a.DocumentID, b.DocumentName,a.TempNo,a.DocumentNo " +
                                      " from DocumentNumber a ,Document b " +
                                      " where a.DocumentID = b.DocumentID order by b.DocumentName";

                SqlCommand cmd = new SqlCommand(query, conn);
                conn.Open();
                SqlDataReader reader = cmd.ExecuteReader();
                while (reader.Read())
                {
                    documentrec              = new documentnumber();
                    documentrec.rowid        = reader.GetInt32(0);
                    documentrec.fyID         = reader.GetString(1);
                    documentrec.DocumentID   = reader.GetString(2);
                    documentrec.DocumentName = reader.GetString(3);
                    documentrec.TemporaryNo  = reader.IsDBNull(4) ? 0 : reader.GetInt32(4);
                    documentrec.DocumentNo   = reader.GetInt32(5);
                    Documents.Add(documentrec);
                }
                conn.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(this.ToString() + "-" + System.Reflection.MethodBase.GetCurrentMethod().Name + "() : Error");
            }
            return(Documents);
        }
예제 #4
0
        public Boolean validateDocumentNo(documentnumber doc)
        {
            Boolean status = true;

            try
            {
                if (doc.DocumentID.Trim().Length == 0 || doc.DocumentID == null)
                {
                    return(false);
                }
                if (doc.fyID.Trim().Length == 0 || doc.fyID == null)
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(this.ToString() + "-" + System.Reflection.MethodBase.GetCurrentMethod().Name + "() : Error");
                return(false);
            }

            return(status);
        }