Ejemplo n.º 1
0
         public int AddItemIpoCreate(ItemIpoCreateLogQuery query)
        {
            try
            {
                return _ItemIpo.AddItemIpoCreate(query);
            }
            catch (Exception ex)
            {

                throw new Exception("ItemIpoCreateLogMgr-->AddItemIpoCreate-->" + ex.Message, ex);
            }
        }
Ejemplo n.º 2
0
        public int AddItemIpoCreate(ItemIpoCreateLogQuery query)
        {
            StringBuilder sql = new StringBuilder();

            try
            {
                sql.Append(getAddsql(query));
                if (!string.IsNullOrEmpty(sql.ToString()))
                {
                    return _accessMySql.execCommand(sql.ToString());
                }
                else 
                {
                    return 0;
                }
            }
            catch (Exception ex)
            {
                throw new Exception("ItemIpoCreateLogDao.AddItemIpoCreate-->" + ex.Message + sql.ToString(), ex);
            }

        }
Ejemplo n.º 3
0
 public string getAddsql(ItemIpoCreateLogQuery query)
 {  
     StringBuilder sb = new StringBuilder();
     try
     {
       
         if (!string.IsNullOrEmpty(query.item_id_in))
         {
             string[] item_id = query.item_id_in.Split(',');
             for (int i = 0; i < item_id.Length;i++ )
             {
                 sb.Append(" insert into item_ipo_create_log (item_id,create_time,create_user,log_status)value( ");
                 sb.AppendFormat("'{0}','{1}','{2}','{3}');", item_id[i], Common.CommonFunction.DateTimeToString(query.create_datetime), query.create_user, query.log_status); 
             }
         }
         return sb.ToString();
     }
     catch (Exception ex)
     {
         throw new Exception("ItemIpoCreateLogDao.AddItemIpoCreate-->" + ex.Message + sb.ToString(), ex);
     }
 }
        public HttpResponseBase AddItemIpo()
        {
           
            ItemIpoCreateLogQuery query = new ItemIpoCreateLogQuery();
            string json = string.Empty;
            try
            {
                string Item_id = "";
                if (!string.IsNullOrEmpty(Request.Params["Items"]))
                {
                    Item_id = Request.Params["Items"];
                    Item_id = Item_id.TrimEnd(',');
                    query.item_id_in = Item_id;
                }
                query.create_datetime = DateTime.Now;
                query.create_user = (Session["caller"] as Caller).user_id;
                _ItemIpoMgr = new ItemIpoCreateLogMgr(mySqlConnectionString);

                int result = _ItemIpoMgr.AddItemIpoCreate(query);
                if (result > 0)
                {

                    json = "{success:true,msg:\"" + result + "\"}";
                }
                else
                {
                    json = "{success:false,msg:\"" + result + "\"}";
                }
            }
            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);
                json = "{success:false,msg:'0'}";
            }
            this.Response.Clear();
            this.Response.Write(json);
            this.Response.End();
            return this.Response;

        }