示例#1
0
 private void toolStripMenuItemUnPublicStore_Click(object sender, EventArgs e)
 {
     Wait.Show("Ngừng public cửa hàng" + shopNameTextEdit.Text);
     #region Cập nhật Toàn bộ sản phẩm Valid = 0
     try
     {
         long idcompanywss = Common.Obj2Int64(companyIdWSSTextEdit.Text);
         DBBizwebTableAdapters.ProductTableAdapter productAdapter = new DBBizwebTableAdapters.ProductTableAdapter();
         productAdapter.Connection.ConnectionString = Server.ConnectionString;
         productAdapter.UpdateValidProductByCompanyId(false, idcompanywss);
     }
     catch (Exception ex)
     {
         MessageBox.Show("Cập nhật Valid = 0 lỗi!" + ex.Message);
         return;
     }
     #endregion
     #region Cập nhật IsPublic = 0 trong Company_Haravan
     try
     {
         long idcompanybizweb = Common.Obj2Int64(companyIdBizwebTextEdit.Text);
         DBBizwebTableAdapters.Company_BizwebTableAdapter bizwebAdapter = new DBBizwebTableAdapters.Company_BizwebTableAdapter();
         bizwebAdapter.Connection.ConnectionString = Server.ConnectionString;
         bizwebAdapter.UpdateIsPublic(false, idcompanybizweb);
     }
     catch (Exception ex)
     {
         MessageBox.Show("Cập nhật IsPublic = 0 lỗi!" + ex.Message);
     }
     #endregion
     Wait.Close();
 }
示例#2
0
 private void simpleButtonLoadProductInSql_Click(object sender, EventArgs e)
 {
     Wait.Show("Load all product in database!");
     try
     {
         DBBizwebTableAdapters.ProductTableAdapter productAdapter = new DBBizwebTableAdapters.ProductTableAdapter();
         productAdapter.Connection.ConnectionString = Server.ConnectionString;
         long idwss = Common.Obj2Int64(companyIdWSSTextEdit.Text);
         productAdapter.FillBy_CompanyId(dBBizweb.Product, idwss);
     }
     catch (Exception)
     {
         MessageBox.Show("ERROR! Load Product from Database fails!");
     }
     Wait.Close();
 }