예제 #1
0
 private void map(SearchKeyTrackInfo oParam, DataRow tempdr)
 {
     oParam.SysNo = Util.TrimIntNull(tempdr["SysNo"]);
     oParam.CustomerID = Util.TrimNull(tempdr["CustomerID"]);
     oParam.Keyword = Util.TrimNull(tempdr["Keyword"]);
     oParam.SearchTime = Util.TrimDateNull(tempdr["SearchTime"]);
 }
예제 #2
0
        public int Update(SearchKeyTrackInfo oParam)
        {
            string sql = @"UPDATE SearchKeyTrack SET
                            CustomerID=@CustomerID, Keyword=@Keyword,
                            SearchTime=@SearchTime
                            WHERE SysNo=@SysNo";
            SqlCommand cmd = new SqlCommand(sql);

            SqlParameter paramSysNo = new SqlParameter("@SysNo", SqlDbType.Int, 4);
            SqlParameter paramCustomerID = new SqlParameter("@CustomerID", SqlDbType.NVarChar, 50);
            SqlParameter paramKeyword = new SqlParameter("@Keyword", SqlDbType.NVarChar, 200);
            SqlParameter paramSearchTime = new SqlParameter("@SearchTime", SqlDbType.DateTime);

            if (oParam.SysNo != AppConst.IntNull)
                paramSysNo.Value = oParam.SysNo;
            else
                paramSysNo.Value = System.DBNull.Value;
            if (oParam.CustomerID != AppConst.StringNull)
                paramCustomerID.Value = oParam.CustomerID;
            else
                paramCustomerID.Value = System.DBNull.Value;
            if (oParam.Keyword != AppConst.StringNull)
                paramKeyword.Value = oParam.Keyword;
            else
                paramKeyword.Value = System.DBNull.Value;
            if (oParam.SearchTime != AppConst.DateTimeNull)
                paramSearchTime.Value = oParam.SearchTime;
            else
                paramSearchTime.Value = System.DBNull.Value;

            cmd.Parameters.Add(paramSysNo);
            cmd.Parameters.Add(paramCustomerID);
            cmd.Parameters.Add(paramKeyword);
            cmd.Parameters.Add(paramSearchTime);

            return SqlHelper.ExecuteNonQuery(cmd);
        }
예제 #3
0
        public int Insert(SearchKeyTrackInfo oParam)
        {
            string sql = @"INSERT INTO SearchKeyTrack
                            (
                            CustomerID, Keyword, SearchTime
                            )
                            VALUES (
                            @CustomerID, @Keyword, @SearchTime
                            );set @SysNo = SCOPE_IDENTITY();";
            SqlCommand cmd = new SqlCommand(sql);

            SqlParameter paramSysNo = new SqlParameter("@SysNo", SqlDbType.Int, 4);
            SqlParameter paramCustomerID = new SqlParameter("@CustomerID", SqlDbType.NVarChar, 50);
            SqlParameter paramKeyword = new SqlParameter("@Keyword", SqlDbType.NVarChar, 200);
            SqlParameter paramSearchTime = new SqlParameter("@SearchTime", SqlDbType.DateTime);
            paramSysNo.Direction = ParameterDirection.Output;
            if (oParam.CustomerID != AppConst.StringNull)
                paramCustomerID.Value = oParam.CustomerID;
            else
                paramCustomerID.Value = System.DBNull.Value;
            if (oParam.Keyword != AppConst.StringNull)
                paramKeyword.Value = oParam.Keyword;
            else
                paramKeyword.Value = System.DBNull.Value;
            if (oParam.SearchTime != AppConst.DateTimeNull)
                paramSearchTime.Value = oParam.SearchTime;
            else
                paramSearchTime.Value = System.DBNull.Value;

            cmd.Parameters.Add(paramSysNo);
            cmd.Parameters.Add(paramCustomerID);
            cmd.Parameters.Add(paramKeyword);
            cmd.Parameters.Add(paramSearchTime);

            return SqlHelper.ExecuteNonQuery(cmd, out oParam.SysNo);
        }
예제 #4
0
 public int Update(SearchKeyTrackInfo oParam)
 {
     return new SearchKeyTrackDac().Update(oParam);
 }
예제 #5
0
 public int Insert(SearchKeyTrackInfo oParam)
 {
     return new SearchKeyTrackDac().Insert(oParam);
 }