//保存活動
       public bool SaveEventPromoAdditionalPrice(EventPromoAdditionalPrice model, List<EventPromoAdditionalPriceProduct> models, string condiType)
       {
           ArrayList _list = new ArrayList();
           MySqlCommand mySqlCmd = new MySqlCommand();
           MySqlConnection mySqlConn = new MySqlConnection(conn);
           try
           {
               if (mySqlConn != null && mySqlConn.State == System.Data.ConnectionState.Closed)
               {
                   mySqlConn.Open();
               }
               mySqlCmd.Connection = mySqlConn;
               mySqlCmd.Transaction = mySqlConn.BeginTransaction();
               mySqlCmd.CommandType = System.Data.CommandType.Text;
               if (model.row_id == 0)//新增
               {                          
                   model.event_type = "AD";
                   model.create_user = (System.Web.HttpContext.Current.Session["caller"] as Caller).user_id;
                   model.create_time = DateTime.Now;
                   mySqlCmd.CommandText = dao.AddOrUpdate(model);
                   model.row_id =Convert.ToInt32(mySqlCmd.ExecuteScalar());
                   model.modify_user = model.create_user;
                   model.modify_time = model.create_time;
                   model.event_id = Common.CommonFunction.GetEventId(model.event_type, model.row_id.ToString());
                   _list.Add(dao.AddOrUpdate(model));

                   //處理輔表
                   EventPromoAdditionalPriceProductDao _epgDao = new EventPromoAdditionalPriceProductDao(conn);
                   foreach (EventPromoAdditionalPriceProduct item in models)
                   {
                       item.group_id = model.group_id;
                       item.create_user = model.create_user;
                       item.create_time = model.create_time;
                       item.modify_user = item.create_user;
                       item.modify_time = item.create_time;
                       _list.Add(_epgDao.AddOrUpdate(item));
                   }

                   //處理輔表活動商品設定
                   _list.AddRange(InsertCondiType(model, condiType));
               }
               else//編輯 
               {
                   model.event_type = "AD";
                   model.modify_user = (System.Web.HttpContext.Current.Session["caller"] as Caller).user_id;
                   model.modify_time = DateTime.Now;
                   model.event_id = Common.CommonFunction.GetEventId(model.event_type, model.row_id.ToString());
                   _list.Add(dao.AddOrUpdate(model));

                   EventPromoAdditionalPriceProductDao _epdDao = new EventPromoAdditionalPriceProductDao(conn);
                   string row_ids = "";
                   foreach (EventPromoAdditionalPriceProduct item in models)
                   {
                       item.modify_user = model.modify_user;
                       item.modify_time = model.modify_time;

                       _list.Add(_epdDao.AddOrUpdate(item));
                       if (item.row_id != 0)
                       {
                           row_ids = row_ids + item.row_id + ",";
                       }
                   }

                   row_ids = row_ids.TrimEnd(',');
                   var row_id = row_ids.Split(',');
                   EventPromoAdditionalPriceProductQuery product = new EventPromoAdditionalPriceProductQuery();
                   product.group_id = model.group_id;
                   List<EventPromoAdditionalPriceProductQuery> product_models = _epdDao.GetList(product);
                   string del_row_ids = string.Empty;//存放本次刪除的
                   foreach (EventPromoAdditionalPriceProduct item in product_models)
                   {
                       if (!row_id.Contains(item.row_id.ToString()))
                       {
                           del_row_ids = del_row_ids + item.row_id.ToString() + ",";
                       }
                   }
                   if (!string.IsNullOrEmpty(del_row_ids))
                   {
                       del_row_ids = del_row_ids.TrimEnd(',');
                       _list.Add(_epdDao.Delete(model.group_id.ToString(), del_row_ids));
                   }


                   //處理輔表活動商品設定
                   EventPromoBrandDao _epbDao = new EventPromoBrandDao(conn);
                   _list.Add(_epbDao.Delete(model.event_id));
                   EventPromoCategoryDao _epcateDao = new EventPromoCategoryDao(conn);
                   _list.Add(_epcateDao.Delete(model.event_id));
                   EventPromoClassDao _epclassDao = new EventPromoClassDao(conn);
                   _list.Add(_epclassDao.Delete(model.event_id));
                   EventPromoPaymentDao _eppayDao = new EventPromoPaymentDao(conn);
                   _list.Add(_eppayDao.Delete(model.event_id));
                   EventPromoShoppingcartDao _epcartDao = new EventPromoShoppingcartDao(conn);
                   _list.Add(_epcartDao.Delete(model.event_id));
                   EventPromoProductDao _epproDao = new EventPromoProductDao(conn);
                   _list.Add(_epproDao.Delete(model.event_id));

                   _list.AddRange(InsertCondiType(model, condiType));

               }

               for (int i = 0; i < _list.Count; i++)
               {
                   mySqlCmd.CommandText = _list[i].ToString();
                   mySqlCmd.ExecuteNonQuery();
               }
               mySqlCmd.Transaction.Commit();
               return true;

           }
           catch (Exception ex)
           {
               mySqlCmd.Transaction.Rollback();
               return false;
               throw new Exception("EventPromoAdditionalPriceMgr-->SaveEventPromoAdditionalPrice" + ex.Message, ex);
           }
           finally
           {
               if (mySqlConn != null && mySqlConn.State == System.Data.ConnectionState.Open)
               {
                   mySqlConn.Close();
               }
           }
       }
       public bool UpdateActive(EventPromoAdditionalPrice model)
       {
           ArrayList _list = new ArrayList();
           try
           {
               _list.Add(dao.UpdateActive(model));
               //處理輔表活動商品設定
               if (model.condition_type == 1)
               {
                   EventPromoBrandDao _epbDao = new EventPromoBrandDao(conn);
                   _list.Add(_epbDao.UpdateActive(new EventPromoBrand { event_status = model.event_status, modify_user = model.modify_user, modify_time = model.modify_time, event_id = model.event_id }));
               }
               else if (model.condition_type == 2)
               {
                   EventPromoCategoryDao _epcateDao = new EventPromoCategoryDao(conn);
                   _list.Add(_epcateDao.UpdateActive(new EventPromoCategory { event_status = model.event_status, modify_user = model.modify_user, modify_time = model.modify_time, event_id = model.event_id }));
               }
               else if (model.condition_type == 3)
               {
                   EventPromoClassDao _epclassDao = new EventPromoClassDao(conn);
                   _list.Add(_epclassDao.UpdateActive(new EventPromoClass { event_status = model.event_status, modify_user = model.modify_user, modify_time = model.modify_time, event_id = model.event_id }));
               }
               else if (model.condition_type == 4)
               {
                   EventPromoProductDao _epproDao = new EventPromoProductDao(conn);
                   _list.Add(_epproDao.UpdateActive(new EventPromoProduct { event_status = model.event_status, modify_user = model.modify_user, modify_time = model.modify_time, event_id = model.event_id }));

               }
               else if (model.condition_type == 5)
               {
                   EventPromoShoppingcartDao _epcartDao = new EventPromoShoppingcartDao(conn);
                   _list.Add(_epcartDao.UpdateActive(new EventPromoShoppingcart { event_status = model.event_status, modify_user = model.modify_user, modify_time = model.modify_time, event_id = model.event_id }));
               }
               else if (model.condition_type == 6)
               {
                   EventPromoPaymentDao _eppayDao = new EventPromoPaymentDao(conn);
                   _list.Add(_eppayDao.UpdateActive(new EventPromoPayment { event_status = model.event_status, modify_user = model.modify_user, modify_time = model.modify_time, event_id = model.event_id }));

               }
               MySqlDao _mySqlDao = new MySqlDao(conn);
               return _mySqlDao.ExcuteSqls(_list);
           }
           catch (Exception ex)
           {
               throw new Exception("EventPromoAdditionalPriceMgr-->UpdateActive" + ex.Message, ex);
           }
       }
       //商品設定
       public ArrayList InsertCondiType(EventPromoAdditionalPrice model, string condiType)
       {
           ArrayList _list = new ArrayList();
           if (!string.IsNullOrEmpty(condiType))
           {
               var arryType = condiType.Split(',');
               if (model.condition_type == 1)//按品牌
               {
                   foreach (string iType in arryType)
                   {
                       EventPromoBrand epb = new EventPromoBrand();
                       epb.event_type = model.event_type;
                       epb.site_id = model.site_id;
                       epb.brand_id = Convert.ToInt32(iType);
                       epb.event_id = model.event_id;
                       epb.event_status = model.event_status;
                       epb.create_user = model.create_user;
                       epb.create_time = model.create_time;
                       epb.modify_user = epb.create_user;
                       epb.modify_time = epb.create_time;
                       epb.event_start = model.event_start;
                       epb.event_end = model.event_end;
                       EventPromoBrandDao _epbDao = new EventPromoBrandDao(conn);
                       _list.Add(_epbDao.AddOrUpdate(epb));

                   }
               }
               else if (model.condition_type == 2)//類別
               {
                   foreach (string iType in arryType)
                   {
                       EventPromoCategory epcate = new EventPromoCategory();
                       epcate.event_type = model.event_type;
                       epcate.site_id = model.site_id;
                       epcate.category_id = Convert.ToInt32(iType);
                       epcate.event_id = model.event_id;
                       epcate.event_status = model.event_status;
                       epcate.create_user = model.create_user;
                       epcate.create_time = model.create_time;
                       epcate.modify_user = epcate.create_user;
                       epcate.modify_time = epcate.create_time;
                       epcate.event_start = model.event_start;
                       epcate.event_end = model.event_end;
                       EventPromoCategoryDao _epcateDao = new EventPromoCategoryDao(conn);
                       _list.Add(_epcateDao.AddOrUpdate(epcate));

                   }
               }
               else if (model.condition_type == 3)//館別
               {
                   foreach (string iType in arryType)
                   {
                       EventPromoClass epclass = new EventPromoClass();
                       epclass.event_type = model.event_type;
                       epclass.site_id = model.site_id;
                       epclass.class_id = Convert.ToInt32(iType);
                       epclass.event_id = model.event_id;
                       epclass.event_status = model.event_status;
                       epclass.create_user = model.create_user;
                       epclass.create_time = model.create_time;
                       epclass.modify_user = epclass.create_user;
                       epclass.modify_time = epclass.create_time;
                       epclass.event_start = model.event_start;
                       epclass.event_end = model.event_end;
                       EventPromoClassDao _epclassDao = new EventPromoClassDao(conn);
                       _list.Add(_epclassDao.AddOrUpdate(epclass));

                   }
               }
               else if (model.condition_type == 4)//商品
               {
                   foreach (string iType in arryType)
                   {
                       var arryPro = iType.Split('&');
                       EventPromoProduct eppro = new EventPromoProduct();
                       eppro.event_type = model.event_type;
                       eppro.site_id = model.site_id;
                       eppro.product_id = Convert.ToInt32(arryPro[0]);
                       eppro.product_num_limit = Convert.ToInt32(arryPro[1]);
                       eppro.event_id = model.event_id;
                       eppro.event_status = model.event_status;
                       eppro.create_user = model.create_user;
                       eppro.create_time = model.create_time;
                       eppro.modify_user = eppro.create_user;
                       eppro.modify_time = eppro.create_time;
                       eppro.event_start = model.event_start;
                       eppro.event_end = model.event_end;
                       EventPromoProductDao _epproDao = new EventPromoProductDao(conn);
                       _list.Add(_epproDao.AddOrUpdate(eppro));
                   }
               }
               else if (model.condition_type == 5)//購物車
               {
                   foreach (string iType in arryType)
                   {
                       EventPromoShoppingcart epcart = new EventPromoShoppingcart();
                       epcart.event_type = model.event_type;
                       //epcart.site_id = epaGift.site_id;
                       epcart.cart_id = Convert.ToInt32(iType);
                       epcart.event_id = model.event_id;
                       epcart.event_status = model.event_status;
                       epcart.create_user = model.create_user;
                       epcart.create_time = model.create_time;
                       epcart.modify_user = epcart.create_user;
                       epcart.modify_time = epcart.create_time;
                       epcart.event_start = model.event_start;
                       epcart.event_end = model.event_end;
                       EventPromoShoppingcartDao _epcartDao = new EventPromoShoppingcartDao(conn);
                       _list.Add(_epcartDao.AddOrUpdate(epcart));
                   }
               }
               else if (model.condition_type == 6)//付款方式
               {
                   foreach (string iType in arryType)
                   {
                       EventPromoPayment eppay = new EventPromoPayment();
                       eppay.event_type = model.event_type;
                       eppay.site_id = model.site_id;
                       eppay.payment_id = Convert.ToInt32(iType);
                       eppay.event_id = model.event_id;
                       eppay.event_status = model.event_status;
                       eppay.create_user = model.create_user;
                       eppay.create_time = model.create_time;
                       eppay.modify_user = eppay.create_user;
                       eppay.modify_time = eppay.create_time;
                       eppay.event_start = model.event_start;
                       eppay.event_end = model.event_end;
                       EventPromoPaymentDao _eppayDao = new EventPromoPaymentDao(conn);
                       _list.Add(_eppayDao.AddOrUpdate(eppay));
                   }
               }

           }
           return _list;
       }
        public bool SavePromoAmountDiscount(Model.EventPromoAmountDiscount epadmodel, List<Model.EventPromoDiscount> epdmodels, string condiType)
        {
            ArrayList _list = new ArrayList();
            MySqlCommand mySqlCmd = new MySqlCommand();
            MySqlConnection mySqlConn = new MySqlConnection(conn);
            try
            {
                if (mySqlConn != null && mySqlConn.State == System.Data.ConnectionState.Closed)
                {
                    mySqlConn.Open();
                }
                mySqlCmd.Connection = mySqlConn;
                mySqlCmd.Transaction = mySqlConn.BeginTransaction();
                mySqlCmd.CommandType = System.Data.CommandType.Text;
                if (epadmodel.row_id == 0)//新增
                {
                    epadmodel.event_type = "AB";
                    epadmodel.create_user = (System.Web.HttpContext.Current.Session["caller"] as Caller).user_id;
                    epadmodel.create_time = DateTime.Now;
                    epadmodel.modify_user = epadmodel.create_user;
                    epadmodel.modify_time = epadmodel.create_time;
                    mySqlCmd.CommandText = IDiscountDao.AddOrUpdate(epadmodel);
                    epadmodel.row_id = Convert.ToInt32(mySqlCmd.ExecuteScalar());
                    epadmodel.event_id = Common.CommonFunction.GetEventId(epadmodel.event_type, epadmodel.row_id.ToString());

                    _list.Add(IDiscountDao.UpdateEventId(epadmodel.row_id, epadmodel.event_id));

                    //處理輔表event_promo_gift
                    EventPromoDiscountDao _epgDao = new EventPromoDiscountDao(conn);
                    foreach (EventPromoDiscount item in epdmodels)
                    {
                        item.event_id = epadmodel.event_id;
                        item.create_user = epadmodel.create_user;
                        item.create_time = epadmodel.create_time;
                        item.modify_user = item.create_user;
                        item.modify_time = item.create_time;
                        _list.Add(_epgDao.AddOrUpdate(item));
                    }

                    //處理輔表活動商品設定
                    _list.AddRange(InsertCondiType(epadmodel, condiType));
                }
                else//編輯 
                {
                    //處理主表event_promo_amount_gift
                    epadmodel.event_type = "AB";
                    epadmodel.modify_user = (System.Web.HttpContext.Current.Session["caller"] as Caller).user_id;
                    epadmodel.modify_time = DateTime.Now;
                    epadmodel.create_user = epadmodel.modify_user;
                    epadmodel.create_time = epadmodel.modify_time;

                    epadmodel.event_id = Common.CommonFunction.GetEventId(epadmodel.event_type, epadmodel.row_id.ToString());
                    _list.Add(IDiscountDao.AddOrUpdate(epadmodel));

                    //處理輔表event_promo_gift
                    EventPromoDiscountDao _epdDao = new EventPromoDiscountDao(conn);
                    string discount_ids = "";
                    foreach (EventPromoDiscount item in epdmodels)
                    {
                        item.event_id = epadmodel.event_id;
                        item.modify_user = epadmodel.modify_user;
                        item.modify_time = epadmodel.modify_time;

                        _list.Add(_epdDao.AddOrUpdate(item));
                        if (item.discount_id != 0)
                        {
                            discount_ids = discount_ids + item.discount_id + ",";
                        }
                    }

                    discount_ids = discount_ids.TrimEnd(',');
                    var arr_new_g = discount_ids.Split(',');
                    //獲取本次修改刪除的discount_id,先獲取現有的除新增外的discount,那麼原有的不在其中的discount則是刪除的

                    List<EventPromoDiscount> models = _epdDao.GetList(epadmodel.event_id);
                    string del_g = string.Empty;//存放本次刪除的discount
                    foreach (EventPromoDiscount item in models)
                    {
                        if (!arr_new_g.Contains(item.discount_id.ToString()))
                        {
                            del_g = del_g + item.discount_id.ToString() + ",";
                        }
                    }
                    if (!string.IsNullOrEmpty(del_g))
                    {
                        del_g = del_g.TrimEnd(',');
                        _list.Add(_epdDao.Delete(epadmodel.event_id, del_g));

                    }


                    //處理輔表活動商品設定
                    EventPromoBrandDao _epbDao = new EventPromoBrandDao(conn);
                    _list.Add(_epbDao.Delete(epadmodel.event_id));
                    EventPromoCategoryDao _epcateDao = new EventPromoCategoryDao(conn);
                    _list.Add(_epcateDao.Delete(epadmodel.event_id));
                    EventPromoClassDao _epclassDao = new EventPromoClassDao(conn);
                    _list.Add(_epclassDao.Delete(epadmodel.event_id));
                    EventPromoPaymentDao _eppayDao = new EventPromoPaymentDao(conn);
                    _list.Add(_eppayDao.Delete(epadmodel.event_id));
                    EventPromoShoppingcartDao _epcartDao = new EventPromoShoppingcartDao(conn);
                    _list.Add(_epcartDao.Delete(epadmodel.event_id));
                    EventPromoProductDao _epproDao = new EventPromoProductDao(conn);
                    _list.Add(_epproDao.Delete(epadmodel.event_id));

                    _list.AddRange(InsertCondiType(epadmodel, condiType));

                }

                for (int i = 0; i < _list.Count; i++)
                {
                    mySqlCmd.CommandText = _list[i].ToString();
                    mySqlCmd.ExecuteNonQuery();
                }
                mySqlCmd.Transaction.Commit();
                return true;

            }
            catch (Exception ex)
            {
                mySqlCmd.Transaction.Rollback();
                return false;
                throw new Exception("EventPromoAmountDiscountMgr-->SavePromoAmountDiscount" + ex.Message, ex);
            }
            finally
            {
                if (mySqlConn != null && mySqlConn.State == System.Data.ConnectionState.Open)
                {
                    mySqlConn.Close();
                }
            }
        }
        public string GetCondiType(int condiType, string event_id)
        {
            string content = string.Empty;
            if (condiType != 0 && !string.IsNullOrEmpty(event_id))
            {

                if (condiType == 1)//按品牌
                {
                    EventPromoBrandDao _epbDao = new EventPromoBrandDao(conn);
                    List<EventPromoBrand> model = _epbDao.GetList(event_id);
                    foreach (EventPromoBrand item in model)
                    {
                        content += item.brand_id + ",";
                    }
                    content = content.TrimEnd(',');
                }
                else if (condiType == 2)//類別
                {
                    EventPromoCategoryDao _epcateDao = new EventPromoCategoryDao(conn);
                    List<EventPromoCategory> model = _epcateDao.GetList(event_id);
                    foreach (EventPromoCategory item in model)
                    {
                        content += item.category_id + "&" + item.category_name + ",";
                    }
                    content = content.TrimEnd(',');
                }
                else if (condiType == 3)//館別
                {
                    EventPromoClassDao _epclassDao = new EventPromoClassDao(conn);
                    List<EventPromoClass> model = _epclassDao.GetList(event_id);
                    foreach (EventPromoClass item in model)
                    {
                        content += item.class_id + ",";
                    }
                    content = content.TrimEnd(',');
                }
                else if (condiType == 4)//商品
                {
                    EventPromoProductDao _epproDao = new EventPromoProductDao(conn);

                    List<EventPromoProduct> model = _epproDao.GetList(event_id);
                    foreach (EventPromoProduct item in model)
                    {
                        content += item.product_id + "&" + item.product_num_limit + "&" + item.product_name + ",";
                    }
                    content = content.TrimEnd(',');
                }
                else if (condiType == 5)//購物車
                {
                    EventPromoShoppingcartDao _epcartDao = new EventPromoShoppingcartDao(conn);

                    List<EventPromoShoppingcart> model = _epcartDao.GetList(event_id);
                    foreach (EventPromoShoppingcart item in model)
                    {
                        content += item.cart_id + ",";
                    }
                    content = content.TrimEnd(',');
                }
                else if (condiType == 6)//付款方式
                {
                    EventPromoPaymentDao _eppayDao = new EventPromoPaymentDao(conn);

                    List<EventPromoPayment> model = _eppayDao.GetList(event_id);
                    foreach (EventPromoPayment item in model)
                    {
                        content += item.payment_id + ",";
                    }
                    content = content.TrimEnd(',');
                }



            }
            return content;
        }
        public bool SavePromoAmountFare(EventPromoAmountFare epaFare, string condiType)
        {
            ArrayList _list = new ArrayList();
            MySqlCommand mySqlCmd = new MySqlCommand();
            MySqlConnection mySqlConn = new MySqlConnection(_conn);
            bool isSave = false;
            try
            {
                if (mySqlConn != null && mySqlConn.State == System.Data.ConnectionState.Closed)
                {
                    mySqlConn.Open();
                }
                mySqlCmd.Connection = mySqlConn;
                mySqlCmd.Transaction = mySqlConn.BeginTransaction();
                mySqlCmd.CommandType = System.Data.CommandType.Text;
                if (epaFare.row_id == 0)//新增
                {
                    //處理主表event_promo_amount_fare
                    epaFare.event_type = "AC";
                    epaFare.create_user = (System.Web.HttpContext.Current.Session["caller"] as Caller).user_id;
                    epaFare.create_time = DateTime.Now;
                    epaFare.modify_user = epaFare.create_user;
                    epaFare.modify_time = epaFare.create_time;

                    mySqlCmd.CommandText = _iepaFareDao.AddOrUpdate(epaFare);
                    epaFare.row_id = Convert.ToInt32(mySqlCmd.ExecuteScalar());
                    epaFare.event_id = Common.CommonFunction.GetEventId(epaFare.event_type, epaFare.row_id.ToString());

                    _list.Add(_iepaFareDao.UpdateEventId(epaFare.row_id, epaFare.event_id));

                    //處理輔表活動商品設定
                    _list.AddRange(InsertCondiType(epaFare, condiType));
                }
                else//編輯 
                {
                    //處理主表event_promo_amount_fare
                    epaFare.event_type = "AC";
                    epaFare.modify_user = (System.Web.HttpContext.Current.Session["caller"] as Caller).user_id;
                    epaFare.modify_time = DateTime.Now;
                    epaFare.event_id = Common.CommonFunction.GetEventId(epaFare.event_type, epaFare.row_id.ToString());
                    _list.Add(_iepaFareDao.AddOrUpdate(epaFare));


                    //處理輔表活動商品設定
                    EventPromoBrandDao _epbDao = new EventPromoBrandDao(_conn);
                    _list.Add(_epbDao.Delete(epaFare.event_id));
                    EventPromoCategoryDao _epcateDao = new EventPromoCategoryDao(_conn);
                    _list.Add(_epcateDao.Delete(epaFare.event_id));
                    EventPromoClassDao _epclassDao = new EventPromoClassDao(_conn);
                    _list.Add(_epclassDao.Delete(epaFare.event_id));
                    EventPromoPaymentDao _eppayDao = new EventPromoPaymentDao(_conn);
                    _list.Add(_eppayDao.Delete(epaFare.event_id));
                    EventPromoShoppingcartDao _epcartDao = new EventPromoShoppingcartDao(_conn);
                    _list.Add(_epcartDao.Delete(epaFare.event_id));
                    EventPromoProductDao _epproDao = new EventPromoProductDao(_conn);
                    _list.Add(_epproDao.Delete(epaFare.event_id));

                    _list.AddRange(InsertCondiType(epaFare, condiType));

                }

                for (int i = 0; i < _list.Count; i++)
                {
                    mySqlCmd.CommandText = _list[i].ToString();
                    mySqlCmd.ExecuteNonQuery();
                }
                mySqlCmd.Transaction.Commit();
                isSave = true;

            }
            catch (MySqlException ex)
            {
                throw new Exception(ex.Number.ToString() + ":EventPromoAmountFareMgr-->SavePromoAmountFare" + ex.Message, ex);
            }
            catch (Exception ex)
            {
                mySqlCmd.Transaction.Rollback();
                throw new Exception("EventPromoAmountFareMgr-->SavePromoAmountFare" + ex.Message, ex);
            }
            finally
            {

                if (mySqlConn != null && mySqlConn.State == System.Data.ConnectionState.Open)
                {
                    mySqlConn.Close();
                }
            }
            return isSave;
        }