public int SaveGCC(GroupCommitteContact query)
 {
     try
     {
         int i = _accessMySql.execCommand(_gccDao.SaveGCC(query));
         return i;
     }
     catch (Exception ex)
     {
         throw new Exception(" GroupCommitteContactMgr -->SaveGCC " + ex.Message, ex);
     }
 }
 public string DeleteGCC(GroupCommitteContact query)
 {
     StringBuilder sql = new StringBuilder();
     try
     {
         sql.AppendFormat(@"DELETE FROM group_committe_contact where gcc_id={0}", query.gcc_id);
         return sql.ToString();
     }
     catch (Exception ex)
     {
         throw new Exception(" GroupCommitteContactDao -->SaveGCC " + ex.Message, ex);
     }
 }
 public string UpdateGCC(GroupCommitteContact query)
 {
     StringBuilder sql = new StringBuilder();
     try
     {
         sql.AppendFormat(@"UPDATE group_committe_contact SET gcc_chairman='{0}',gcc_phone={1},gcc_mail='{2}',m_user='******',m_date='{4}' WHERE gcc_id={5}", query.gcc_chairman, query.gcc_phone, query.gcc_mail, query.m_user, CommonFunction.DateTimeToString(query.m_date), query.gcc_id);
         return sql.ToString();
     }
     catch (Exception ex)
     {
         throw new Exception(" GroupCommitteContactDao -->SaveGCC " + ex.Message, ex);
     }
 }
 public string SaveGCC(GroupCommitteContact query)
 {
     StringBuilder sql = new StringBuilder();
     try
     {
         sql.AppendFormat(@"INSERT INTO group_committe_contact (group_id,gcc_chairman,gcc_phone,gcc_mail,k_user,k_date,m_user,m_date) VALUES({0},'{1}','{2}','{3}',{4},'{5}',{6},'{7}')", query.group_id, query.gcc_chairman, query.gcc_phone, query.gcc_mail, query.k_user, CommonFunction.DateTimeToString(query.k_date), query.m_user, CommonFunction.DateTimeToString(query.m_date));
         return sql.ToString();
     }
     catch (Exception ex)
     {
         throw new Exception(" GroupCommitteContactDao -->SaveGCC " + ex.Message, ex);
     }
 }
 public string GetGroupCommitteContact(GroupCommitteContact query)
 {
     StringBuilder sql = new StringBuilder();
     try
     {
         sql.AppendFormat(@"SELECT gcc_id,group_id,gcc_chairman,gcc_phone,gcc_mail FROM group_committe_contact WHERE group_id={0}", query.group_id);
         return sql.ToString();
     }
     catch (Exception ex)
     {
         throw new Exception(" GroupCommitteContactDao -->GetGroupCommitteContact " + ex.Message, ex);
     }
 }
 public List<GroupCommitteContact> GetGroupCommitteContact(GroupCommitteContact query)
 {
     List<GroupCommitteContact> store = new List<GroupCommitteContact>();
     try
     {
         string sql = _gccDao.GetGroupCommitteContact(query);
         store = _accessMySql.getDataTableForObj<GroupCommitteContact>(sql);
         return store;
     }
     catch (Exception ex)
     {
         throw new Exception(" GroupCommitteContactMgr -->GetGroupCommitteContact " + ex.Message, ex);
     }
 }
 public HttpResponseBase DeleteGCC()
 {
     string json = string.Empty;
     GroupCommitteContact query = new GroupCommitteContact();
     _gccMgr = new GroupCommitteContactMgr(mySqlConnectionString);
     try
     {
         if (!string.IsNullOrEmpty(Request.Params["gcc_id"]))
         {
             query.gcc_id = Convert.ToInt32(Request.Params["gcc_id"]);
         }
         int i = _gccMgr.DeleteGCC(query);
         if (i > 0)
         {
             json = "{success:true}";
         }
         else
         {
             json = "{success:false}";
         }
     }
     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;
 }
 public HttpResponseBase SaveGCC()
 {
     string json = string.Empty;
     GroupCommitteContact query = new GroupCommitteContact();
     _gccMgr = new GroupCommitteContactMgr(mySqlConnectionString);
     try
     {
         if (!string.IsNullOrEmpty(Request.Params["group_id"]))
         {
             query.group_id = Convert.ToInt32(Request.Params["group_id"]);
         }
         if (!string.IsNullOrEmpty(Request.Params["group_committe_chairman"]))
         {
             query.gcc_chairman = Request.Params["group_committe_chairman"];
         }
         if (!string.IsNullOrEmpty(Request.Params["group_committe_phone"]))
         {
             query.gcc_phone = Request.Params["group_committe_phone"];
         }
         if (!string.IsNullOrEmpty(Request.Params["group_committe_mail"]))
         {
             query.gcc_mail = Request.Params["group_committe_mail"];
         }
         query.k_user = (Session["caller"] as Caller).user_id;
         query.k_date = DateTime.Now;
         query.m_user = (Session["caller"] as Caller).user_id;
         query.m_date = DateTime.Now;
         int i = _gccMgr.SaveGCC(query);
         if (i > 0)
         {
             json = "{success:true}";
         }
         else
         {
             json = "{success:false}";
         }
     }
     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;
 }
 public HttpResponseBase GetGroupCommitteContact()
 {
     List<GroupCommitteContact> store = new List<GroupCommitteContact>();
     string json = string.Empty;
     GroupCommitteContact query = new GroupCommitteContact();
     _gccMgr = new GroupCommitteContactMgr(mySqlConnectionString);
     try
     {
         if (!string.IsNullOrEmpty(Request.Params["group_id"]))
         {
             query.group_id = Convert.ToInt32(Request.Params["group_id"]);
             store = _gccMgr.GetGroupCommitteContact(query);
             json = "{success:true,data:" + JsonConvert.SerializeObject(store) + "}";
         }
     }
     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}";
     }
     this.Response.Clear();
     this.Response.Write(json);
     this.Response.End();
     return this.Response;
 }