Example #1
0
        /// <summary>
        /// 查询客户信息表上报
        /// </summary>
        public string FindCustomer()
        {
            string tag = "上报客户信息表成功!";

            using (PersistentManager dbpm = new PersistentManager("ZYDB2Connection"))
            {
                UploadDao dao = new UploadDao();
                dao.SetPersistentManager(dbpm);
                DataTable customerTable = this.QueryCustomer();
                if (customerTable.Rows.Count > 0)
                {
                    try
                    {
                        dbpm.BeginTransaction();
                        dao.InsertCustomer(customerTable);
                        this.UpdateCustomer("");
                        dbpm.Commit();
                    }
                    catch (Exception exp)
                    {
                        dbpm.Rollback();
                        throw new Exception(exp.Message);
                    }
                }
                else
                {
                    tag = "没有新的客户信息要上报!";
                }
            } return(tag);
        }