コード例 #1
0
ファイル: TVSController.cs プロジェクト: PatiparnVsm/GCL_TVS
 public ResponseInfo <string> PostSystemNoti([FromBody] ReqPostSystemNoti data)
 {
     try
     {
         return(base.PostDataToAPINotAuth <ResponseInfo <string> >(base.apiPathAndQuery, data));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #2
0
ファイル: TVSController.cs プロジェクト: PatiparnVsm/GCL_TVS
        public ResponseInfo <string> PostSystemNoti([FromBody] ReqPostSystemNoti data)
        {
            ResponseInfo <string> res = new ResponseInfo <string>();

            try
            {
                res = process.PostSystemNoti(data);
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(res);
        }
コード例 #3
0
ファイル: TVSProcess.cs プロジェクト: PatiparnVsm/GCL_TVS
        public ResponseInfo <string> PostSystemNoti(ReqPostSystemNoti data)
        {
            ResponseInfo <string> res = new ResponseInfo <string>();

            try
            {
                SODAL.PostSystemNoti(data);
                res.ResponseData = "Success";
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(res);
        }
コード例 #4
0
ファイル: TVSDAL.cs プロジェクト: PatiparnVsm/GCL_TVS
 public void PostSystemNoti(ReqPostSystemNoti data)
 {
     using (IDbConnection connection = GetOpenConnection())
     {
         try
         {
             string sql   = @"insert into SystemNotification (UserID, MsgTitle,MsgValue, MsgUrl, CreatedBy, CreatedOn)
                            values (@UserID, @MsgTitle, @MsgValue,@MsgUrl, @SystemName, getdate())
                                 ";
             var    param = new DynamicParameters();
             param.Add("@UserID", data.UserID);
             param.Add("@MsgTitle", data.MsgTitle);
             param.Add("@MsgValue", data.MsgValue);
             param.Add("@MsgUrl", data.MsgUrl);
             param.Add("@SystemName", data.SystemName);
             connection.ExecuteScalar(sql, param, commandType: CommandType.Text);
         }
         catch (Exception ex)
         {
             throw ex;
         }
     }
 }