public override void ExecuteCommand(GRSession session, StringRequestInfo requestInfo)
        {
            string     req = string.Join("", requestInfo.Parameters);
            C_WellPara ac  = JsonConvert.DeserializeObject <C_WellPara>(req);

            C_DbTabEntWellPara.Add(ac);
        }
예제 #2
0
        public override void ExecuteCommand(GRSession session, StringRequestInfo requestInfo)
        {
            string     req = string.Join("", requestInfo.Parameters);
            C_WellPara ac  = JsonConvert.DeserializeObject <C_WellPara>(req);

            C_DbTabWellPara.Add(ac);

            //session.Send(API_ID.API_AddUser, RES_STATE.FAILED);
        }
예제 #3
0
        public static Tuple <E_DbRState, C_WellParas, Exception> Get()
        {
            Tuple <E_DbRState, MySqlDataReader, Exception> QRes;
            List <C_WellPara> res = new List <C_WellPara>();

            QRes = C_Db.Query("select * from grims.wellpara;");

            if (QRes.Item1 == E_DbRState.Success)
            {
                while (QRes.Item2.Read())
                {
                    C_WellPara tmp = new C_WellPara();
                    tmp.Type  = (E_WellParaType)Enum.Parse(typeof(E_WellParaType), QRes.Item2.GetString("paraType"), true);
                    tmp.Value = QRes.Item2.GetString("paraValue");
                    res.Add(tmp);
                }
                C_WellParas wps = new C_WellParas(res);
                return(new Tuple <E_DbRState, C_WellParas, Exception>(QRes.Item1, wps, QRes.Item3));
            }
            else
            {
                return(new Tuple <E_DbRState, C_WellParas, Exception>(QRes.Item1, null, QRes.Item3));
            }
        }
예제 #4
0
 public static Tuple <E_DbRState, Exception> Change(C_WellPara oldWp, C_WellPara newWp)
 {
     return(C_Db.Exec("update grims.wellpara set paraType='" + newWp.Type + "' , paraValue='" + newWp.Value + "' where paraType='" + oldWp.Type + "' and paraValue='" + oldWp.Value + "';"));
 }
예제 #5
0
 public static Tuple <E_DbRState, Exception> Delete(C_WellPara wellPara)
 {
     return(C_Db.Exec("delete from grims.wellpara where paraType='" + wellPara.Type + "' and paraValue='" + wellPara.Value + "';"));
 }
예제 #6
0
 public static Tuple <E_DbRState, Exception> Add(C_WellPara wellPara)
 {
     return(C_Db.Exec("insert into grims.wellpara (paraType,paraValue) values('" + wellPara.Type + "','" + wellPara.Value + "');"));
 }