public HttpResponseBase SaveTwo()
        {
            _promoadditionproceMgr = new PromoAdditionalPriceMgr(mySqlConnectionString);
            string jsonStr = String.Empty;
            try
            {
                PromoAdditionalPrice model = new PromoAdditionalPrice();
                PromoAdditionalPrice oldermodel = new PromoAdditionalPrice();

                PromoAdditionalPriceQuery PPQuery = new PromoAdditionalPriceQuery();
                PromoAdditionalPriceQuery oldPPQuery = new PromoAdditionalPriceQuery();
                //DateTime dtdt = Convert.ToDateTime(times);
                model.id = Convert.ToInt32(Request.Params["rowid"].ToString());
                model.category_id = PPQuery.category_id = Convert.ToInt32(Request.Params["categoryid"].ToString());
                model.deliver_type = Convert.ToInt32(Request.Params["deliver_id"].ToString());
                model.device = Request.Params["device_id"].ToString();
                model.starts = Convert.ToDateTime(Request.Params["start_date"].ToString());
                model.end = Convert.ToDateTime(Request.Params["end_date"].ToString());
                model.muser = (System.Web.HttpContext.Current.Session["caller"] as Caller).user_id.ToString();
                model.modified = DateTime.Now;
                model.fixed_price = Convert.ToInt32(Request.Params["fixed_price"].ToString());
                model.buy_limit = Convert.ToInt32(Request.Params["buy_limit"].ToString());
                model.event_type = Request.Params["event_type"];
                model.event_desc = Request.Params["event_desc"];
                PPQuery.category_ipfrom = Request.UserHostAddress;
                PPQuery.event_id = GetEventId(model.event_type, model.id.ToString());
                if (!string.IsNullOrEmpty(Request.Params["side"].ToString()))
                {
                    model.website = Request.Params["side"].ToString();
                }
                else
                    model.website = oldermodel.website;

                try//存連接地址
                {
                    PPQuery.category_link_url = Request.Params["banner_url"].ToString();
                    if (PPQuery.category_link_url == "" || PPQuery.category_link_url == null)
                    {
                        model.url_by = 0;
                        PPQuery.category_link_url = oldPPQuery.category_link_url;
                        //"http://www.gigade100.com/combo_promotion.php?event_id=" + GetEventId(model.event_type, model.id.ToString());
                    }
                    else
                    {
                        model.url_by = 1;
                        #region 上傳圖片
                        try
                        {
                            string path = Server.MapPath(xmlPath);
                            SiteConfigMgr _siteConfigMgr = new SiteConfigMgr(path);
                            SiteConfig extention_config = _siteConfigMgr.GetConfigByName("PIC_Extention_Format");
                            SiteConfig minValue_config = _siteConfigMgr.GetConfigByName("PIC_Length_MinValue");
                            SiteConfig maxValue_config = _siteConfigMgr.GetConfigByName("PIC_Length_MaxValue");
                            SiteConfig admin_userName = _siteConfigMgr.GetConfigByName("ADMIN_USERNAME");
                            SiteConfig admin_passwd = _siteConfigMgr.GetConfigByName("ADMIN_PASSWD");
                            //擴展名、最小值、最大值
                            string extention = extention_config.Value == "" ? extention_config.DefaultValue : extention_config.Value;
                            string minValue = minValue_config.Value == "" ? minValue_config.DefaultValue : minValue_config.Value;
                            string maxValue = maxValue_config.Value == "" ? maxValue_config.DefaultValue : maxValue_config.Value;
                            string localPromoPath = imgLocalPath + promoPath;//圖片存儲地址
                            Random rand = new Random();
                            int newRand = rand.Next(1000, 9999);
                            FileManagement fileLoad = new FileManagement();
                            for (int iFile = 0; iFile < Request.Files.Count; iFile++)
                            {
                                HttpPostedFileBase file = Request.Files[iFile];
                                string fileName = string.Empty;//當前文件名
                                string fileExtention = string.Empty;//當前文件的擴展名
                                fileName = Path.GetFileName(file.FileName);
                                // string returnName = imgServerPath;
                                bool result = false;
                                string NewFileName = string.Empty;
                                fileExtention = fileName.Substring(fileName.LastIndexOf(".")).ToLower();
                                NewFileName = PPQuery.event_id + newRand + fileExtention;
                                string ServerPath = string.Empty;
                                //判斷目錄是否存在,不存在則創建
                                //string[] mapPath = new string[1];
                                //mapPath[0] = promoPath.Substring(1, promoPath.Length - 2);
                                //string s = localPromoPath.Substring(0, localPromoPath.Length - promoPath.Length + 1);
                                CreateFolder(localPromoPath.Substring(0, localPromoPath.Length - promoPath.Length + 1), promoPath.Substring(1, promoPath.Length - 2).Split('/'));
                                //  returnName += promoPath + NewFileName;
                                fileName = NewFileName;
                                NewFileName = localPromoPath + NewFileName;//絕對路徑
                                ServerPath = Server.MapPath(imgLocalServerPath + promoPath);
                                string ErrorMsg = string.Empty;
                                //上傳之前刪除已有的圖片
                                string oldFileName = oldPPQuery.banner_image;
                                FTP ftp = new FTP(localPromoPath, ftpuser, ftppwd);
                                List<string> tem = ftp.GetFileList();
                                if (tem.Contains(oldFileName))
                                {
                                    FTP ftps = new FTP(localPromoPath + oldFileName, ftpuser, ftppwd);
                                    ftps.DeleteFile(localPromoPath + oldFileName);//刪除ftp:71.159上的舊圖片
                                    DeletePicFile(ServerPath + oldFileName);//刪除本地圖片
                                }
                                try
                                {
                                    //上傳
                                    result = fileLoad.UpLoadFile(file, ServerPath, NewFileName, extention, int.Parse(maxValue), int.Parse(minValue), ref ErrorMsg, ftpuser, ftppwd);
                                    if (result)//上傳成功
                                    {
                                        PPQuery.banner_image = fileName;
                                    }
                                }
                                catch (Exception)
                                {
                                    PPQuery.banner_image = oldPPQuery.banner_image;
                                }
                            }
                        }
                        catch (Exception)
                        {
                            PPQuery.banner_image = oldPPQuery.banner_image;
                        }
                        #endregion
                    }
                }
                catch (Exception)
                {
                    PPQuery.category_link_url = oldPPQuery.category_link_url;
                }
                #region 會員群組會員管理


                if (Request.Params["group_id"].ToString() != "")
                {
                    try//group_id
                    {
                        model.group_id = Convert.ToInt32(Request.Params["group_id"].ToString());
                    }
                    catch (Exception)
                    {
                        model.group_id = oldermodel.group_id;
                    }
                    model.condition_id = 0;
                }
                if (Request.Params["condition_id"].ToString() != "" && Request.Params["condition_id"].ToString() != "0")
                {
                    try//condition_id
                    {
                        model.condition_id = Convert.ToInt32(Request.Params["condition_id"].ToString());
                    }
                    catch (Exception)
                    {
                        model.condition_id = oldermodel.condition_id;
                    }
                    model.group_id = 0;
                }

                #endregion
                model.kuser = (System.Web.HttpContext.Current.Session["caller"] as Caller).user_id.ToString();
                model.created = DateTime.Now;
                model.muser = model.kuser;
                model.modified = model.created;
                PPQuery.created = DateTime.Now;
                PPQuery.event_id = GetEventId(model.event_type, model.id.ToString());
                model.category_id = Convert.ToInt32(_promoadditionproceMgr.GetModel(model.id).category_id);
                //20140925 jialei add discount
                if (model.event_type == "A3")
                {
                    model.discount = Convert.ToInt32(Request.Params["discount"]);
                }
                else
                {
                    model.discount = 0;
                }
                if (_promoadditionproceMgr.CategoryID(model).ToString() == "true")
                {
                    _promoadditionproceMgr.InsertSecond(model, PPQuery);
                    jsonStr = "{success:true}";
                }
                else
                {
                    jsonStr = "{success:false,msg:3}";
                }
            }
            catch (Exception ex)
            {
                Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage();
                logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message);
                logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name;
                log.Error(logMessage);
                jsonStr = "{success:false}";
            }
            this.Response.Clear();
            this.Response.Write(jsonStr.ToString());
            this.Response.End();
            return this.Response;
        }