示例#1
0
文件: Data.cs 项目: hoolanla/VMS
        public DataTable Update_Data(MODEL.Data criteria)
        {
            try
            {
                criteria.update_date = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                criteria.out_time    = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                Class.clsDB db = new Class.clsDB();
                string      sql;
                sql  = "Update vm_visitor SET flag_out='1',  ";
                sql += "out_time='" + criteria.out_time + "',";
                sql += "update_date='" + criteria.update_date + "' Where vm_id='" + criteria.vm_id + "'";

                int ret;
                ret = db.ExecuteNonQuery(sql);
                db.Close();
                if (ret == 1)
                {
                    DataTable dt;
                    sql = "Select * From vm_visitor Where vm_id = '" + criteria.vm_id + "'";
                    dt  = db.ExecuteDataTable(sql);
                    return(dt);
                }
                return(null);
            }
            catch (Exception ex)
            {
                return(null);
            }
        }
示例#2
0
        public string InsertDocument_step1(Model.Criteria.Document criteria)
        {
            Class.clsDB db = new Class.clsDB();
            string      sql;

            sql  = "Insert into document(";
            sql += "doc_id,";
            sql += "doc_name,";
            sql += "create_by,";
            sql += "content,";
            sql += "supplier_id,";
            sql += "supplier_name,";
            sql += "attach_file_name,";
            sql += "comment,";
            sql += "secure_prepare) Values(";
            sql += "'" + criteria.doc_id + "',";
            sql += "'" + criteria.doc_name + "',";
            sql += "'" + criteria.create_by + "',";
            sql += "'" + criteria.content + "',";
            sql += "'" + criteria.suplier_id + "',";
            sql += "'" + criteria.supplier_name + "',";
            sql += "'" + criteria.attach_file_name + "',";
            sql += "'" + criteria.comment + "',";
            sql += "'" + criteria.secure_prepare + "')";



            int ret;

            ret = db.ExecuteNonQuery(sql);
            db.Close();

            return(ret.ToString());
        }
示例#3
0
 public int UpdateAccount(Model.Criteria.M_AccountCriteria criteria)
 {
     try
     {
         Class.clsDB db = new Class.clsDB();
         string      sql;
         sql  = "Update account SET ";
         sql += "title='" + criteria.title + "',";
         sql += "name='" + criteria.name + "',";
         sql += "surname='" + criteria.surname + "',";
         sql += "username='******',";
         sql += "password='******',";
         sql += "level='" + criteria.level + "',";
         sql += "signature='" + criteria.signature + "' WHERE ";
         sql += " email='" + criteria.email + "'";
         int ret;
         ret = db.ExecuteNonQuery(sql);
         db.Close();
         return(ret);
     }
     catch (Exception ex)
     {
         return(0);
     }
 }
示例#4
0
        public int InsertAccount(Model.Criteria.M_AccountCriteria criteria)
        {
            try
            {
                Class.clsDB db = new Class.clsDB();
                string      sql;
                sql  = "Insert into account ( ";
                sql += "title,";
                sql += "name,";
                sql += "surname,";
                sql += "username,";
                sql += "password,";
                sql += "level,";
                sql += "signature,";
                sql += " email) VALUES(";
                sql += "'" + criteria.title + "',";
                sql += "'" + criteria.name + "',";
                sql += "'" + criteria.surname + "',";
                sql += "'" + criteria.username + "',";
                sql += "'" + criteria.password + "',";
                sql += "'" + criteria.level + "',";
                sql += "'" + criteria.signature + "',";
                sql += "'" + criteria.email + "')";

                int ret;
                ret = db.ExecuteNonQuery(sql);
                db.Close();
                return(ret);
            }
            catch (Exception ex)
            {
                return(0);
            }
        }
示例#5
0
文件: job.cs 项目: hoolanla/C-TMS
        public int Insert_Job(MODEL.Criteria.job criteria)
        {
            try
            {
                criteria.createdate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                Class.clsDB db = new Class.clsDB();
                string      sql;
                sql  = "Insert into job_trailer ( ";
                sql += "job_id,";
                sql += "job_name,";
                sql += "job_date,";
                sql += "place_type,";
                sql += "create_by ,";
                sql += "create_date) VALUES(";
                sql += "'" + criteria.job_id + "',";
                sql += "'" + criteria.job_name + "',";
                sql += "'" + criteria.job_date + "',";
                sql += "'" + criteria.place_type + "',";
                sql += "'" + criteria.createby + "',";
                sql += "'" + criteria.createdate + "')";

                int ret;
                ret = db.ExecuteNonQuery(sql);
                db.Close();

                return(ret);
            }
            catch (Exception ex)
            {
                return(0);
            }
        }
示例#6
0
        public void InsertFilename(string filename)
        {
            Class.clsDB db  = new Class.clsDB();
            string      sql = "insert into tb_file_name(file_name) values('" + filename + "')";

            db.ExecuteNonQuery(sql);
            db.Close();
        }
示例#7
0
        public void WriteLog(MODEL.Log log)
        {
            Class.clsDB db  = new Class.clsDB();
            string      sql = "Insert into log(create_by,content,ip_address,page) Values(";

            sql += "'" + log.create_by + "','" + log.content + "','" + log.ip + "','" + log.page + "')";
            db.ExecuteNonQuery(sql);
            db.Close();
        }
示例#8
0
        public void WriteLog(Model.Log log)
        {
            Class.clsDB db  = new Class.clsDB();
            string      sql = "Insert into log(create_by,content) Values(";

            sql += "'" + log.create_by + "','" + log.content + "')";
            db.ExecuteNonQuery(sql);
            db.Close();
        }
示例#9
0
        public int Update_send_mail_Review(Model.Criteria.Document criteria)
        {
            string sql;

            sql  = "Update document SET send_mail_approve_date = '" + criteria.send_mail_approve_date + "',step3=1,secure_approve='" + criteria.secure_approve + "'";
            sql += " WHERE doc_id='" + criteria.doc_id + "'";

            Class.clsDB db = new Class.clsDB();
            int         ret;

            ret = db.ExecuteNonQuery(sql);
            db.Close();
            return(ret);
        }
示例#10
0
        public int Update_sign_approve_problem(Model.Criteria.Document criteria)
        {
            string sql;

            sql  = "Update document SET approve_problem = '" + criteria.approve_problem + "',step4=1 ";
            sql += " WHERE doc_id='" + criteria.doc_id + "'";

            Class.clsDB db = new Class.clsDB();
            int         ret;

            ret = db.ExecuteNonQuery(sql);
            db.Close();
            return(ret);
        }
示例#11
0
        public int Update_AttachFile(Model.Criteria.Document criteria, int val)
        {
            string sql;

            sql  = "Update document SET attach_file_name = " + val;
            sql += " WHERE doc_id='" + criteria.doc_id + "'";

            Class.clsDB db = new Class.clsDB();
            int         ret;

            ret = db.ExecuteNonQuery(sql);
            db.Close();
            return(ret);
        }
示例#12
0
        public int Update_sign_review_date(Model.Criteria.Document criteria)
        {
            string sql;

            sql  = "Update document SET sign_prepare_date = '" + criteria.sign_prepare_date + "',step2=1 ";
            sql += " WHERE doc_id='" + criteria.doc_id + "'";

            Class.clsDB db = new Class.clsDB();
            int         ret;

            ret = db.ExecuteNonQuery(sql);
            db.Close();
            return(ret);
        }
示例#13
0
        public int Delete_Document(Model.Criteria.Document criteria)
        {
            string sql;

            sql  = "Delete From document ";
            sql += " WHERE doc_id='" + criteria.doc_id + "'";

            Class.clsDB db = new Class.clsDB();
            int         ret;

            ret = db.ExecuteNonQuery(sql);
            db.Close();

            return(ret);
        }
示例#14
0
        public int Update_Upload_date(Model.Criteria.Document criteria)
        {
            string sql;

            sql  = "Update document SET upload_date = '" + criteria.upload_date + "',";
            sql += "step1='1',page_count = " + criteria.page_count + ",paper_type = '" + criteria.paper_type + "'";
            sql += " WHERE doc_id='" + criteria.doc_id + "'";

            Class.clsDB db = new Class.clsDB();
            int         ret;

            ret = db.ExecuteNonQuery(sql);
            db.Close();
            return(ret);
        }
示例#15
0
文件: Data.cs 项目: hoolanla/VMS
        public int Insert_Data(MODEL.Data criteria)
        {
            try
            {
                criteria.create_date = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                criteria.in_time     = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                Class.clsDB db = new Class.clsDB();
                string      sql;
                sql  = "Insert into vm_visitor ( ";
                sql += "vm_id,";
                sql += "name,";
                sql += "lastname,";
                sql += "birthday,";
                sql += "address ,";
                sql += "company ,";
                sql += "contact_person ,";
                sql += "dept ,";
                sql += "id_card ,";
                sql += "license_plate ,";
                sql += "create_by ,";
                sql += "in_time ,";
                sql += "create_date) VALUES(";
                sql += "'" + criteria.vm_id + "',";
                sql += "'" + criteria.name + "',";
                sql += "'" + criteria.lastname + "',";
                sql += "'" + criteria.birth + "',";
                sql += "'" + criteria.address + "',";
                sql += "'" + criteria.company + "',";
                sql += "'" + criteria.contact_person + "',";
                sql += "'" + criteria.dept + "',";
                sql += "'" + criteria.id_card + "',";
                sql += "'" + criteria.license_plate + "',";
                sql += "'" + criteria.create_by + "',";
                sql += "'" + criteria.in_time + "',";
                sql += "'" + criteria.create_date + "')";

                int ret;
                ret = db.ExecuteNonQuery(sql);
                db.Close();

                return(ret);
            }
            catch (Exception ex)
            {
                return(0);
            }
        }
示例#16
0
        public bool InsertSupplier(List <Model.Supplier> lstSupp)
        {
            int k;

            k = lstSupp.Count();

            for (int i = 0; i < k; i++)
            {
                string         sql    = null;
                Model.Supplier m_supp = new Model.Supplier();
                m_supp = (Model.Supplier)lstSupp[i];

                sql += "Insert into supplier(supp_company,";
                sql += "supp_code,";
                sql += "supp_name,";
                sql += "supp_short_name,";
                sql += "supp_address_1,";
                sql += "supp_address_2,";
                sql += "supp_contact_person,";
                sql += "supp_contact_position) Values('";
                sql += m_supp.supp_company + "','";
                sql += m_supp.supp_code + "','";
                sql += m_supp.supp_name + "','";
                sql += m_supp.supp_short_name + "','";
                sql += m_supp.supp_address_1 + "','";
                sql += m_supp.supp_address_2 + "','";
                sql += m_supp.supp_contact_person + "','";
                sql += m_supp.supp_contact_position + "')";



                try
                {
                    Class.clsDB db = new Class.clsDB();
                    int         ret;
                    ret = db.ExecuteNonQuery(sql);
                    db.Close();
                }
                catch
                {
                }
            }



            return(true);
        }
示例#17
0
文件: job.cs 项目: hoolanla/C-TMS
 public int Update_stamp2(string appointed_time, string job_id)
 {
     try
     {
         Class.clsDB db = new Class.clsDB();
         string      sql;
         sql = "Update job_trailer SET timestamp2='" + appointed_time + "' Where job_id='" + job_id + "'";
         int ret;
         ret = db.ExecuteNonQuery(sql);
         db.Close();
         return(ret);
     }
     catch (Exception ex)
     {
         return(0);
     }
 }
示例#18
0
文件: job.cs 项目: hoolanla/C-TMS
 public int Update_stamp4(string job_id)
 {
     try
     {
         Class.clsDB db = new Class.clsDB();
         string      sql;
         string      timestamp1 = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
         sql = "Update job_trailer SET timestamp4='" + timestamp1 + "' Where job_id='" + job_id + "'";
         int ret;
         ret = db.ExecuteNonQuery(sql);
         db.Close();
         return(ret);
     }
     catch (Exception ex)
     {
         return(0);
     }
 }
示例#19
0
文件: job.cs 项目: hoolanla/C-TMS
        public int Insert_JobDetail(MODEL.Criteria.jobDetail criteria)
        {
            try
            {
                Class.clsDB db = new Class.clsDB();
                string      sql;
                sql  = "Insert into job_trailer_detail ( ";
                sql += "job_id,";
                sql += "job_name,";
                sql += "place_get_job ,";
                sql += "container_type,";
                sql += "container_dim,";
                sql += "cust_dest,";
                sql += "code_name ,";
                sql += "appointed_time,";
                sql += "doc_no,";
                sql += "place_send_job,";
                sql += "send_company,";
                sql += "place_type,";
                sql += "remark) VALUES('";
                sql += criteria.job_id + "',";
                sql += "'" + criteria.job_name + "',";
                sql += "'" + criteria.place_get_job + "',";
                sql += "'" + criteria.container_type + "',";
                sql += "'" + criteria.container_dim + "',";
                sql += "'" + criteria.cust_dest + "',";
                sql += "'" + criteria.code_name + "',";
                sql += "'" + criteria.appointed_time + "',";
                sql += "'" + criteria.doc_no + "',";
                sql += "'" + criteria.place_send_job + "',";
                sql += "'" + criteria.send_company + "',";
                sql += "'" + criteria.place_type + "',";
                sql += "'" + criteria.remark + "')";

                int ret;
                ret = db.ExecuteNonQuery(sql);
                db.Close();
                return(ret);
            }
            catch (Exception ex)
            {
                return(0);
            }
        }
示例#20
0
文件: job.cs 项目: hoolanla/C-TMS
 public int Delete_Job(string job_id)
 {
     try
     {
         string      nl = System.Environment.NewLine;
         Class.clsDB db = new Class.clsDB();
         string      sql;
         sql  = "Update job_trailer SET show_ = 0 Where job_id='" + job_id + "';" + nl;
         sql += "Update job_trailer_detail SET show_ = 0 Where job_id='" + job_id + "';";
         int ret;
         ret = db.ExecuteNonQuery(sql);
         db.Close();
         return(ret);
     }
     catch (Exception ex)
     {
         return(0);
     }
 }
示例#21
0
 public void ExecuteNonQuery(string sql)
 {
     Class.clsDB db = new Class.clsDB();
     db.ExecuteNonQuery(sql);
     db.Close();
 }