/// <summary> /// 차단 목록을 추가한다. /// </summary> /// <param name="model"></param> /// <returns>고유키 -1 일경우 이미 등록됨</returns> public static int InsertBreaker(BreakerModel model) { SqlParameter[] param = { CreateInParam("@UserIP", SqlDbType.VarChar, 20, model.UserIP), CreateReturnValue() }; SqlCommand cmd = GetSpCommand("UBB_InsertBreaker", param, IsolationLevel.ReadUncommitted); try { cmd.ExecuteNonQuery(); int seqNo = (int)cmd.Parameters["@ReturnValue"].Value; ReleaseCommandWithCommit(cmd); return(seqNo); } catch (UmcDataException ex) { ReleaseCommandWithRollback(cmd); throw new UmcDataException("UBB_InsertBreaker 프로시져 호출중 에러", ex); } }
protected void dlList_ItemCommand(object source, DataListCommandEventArgs e) { if (e.CommandName == "breaker") { BreakerModel breakerModel = new BreakerModel(); breakerModel.UserIP = e.CommandArgument.ToString(); if (BreakerManager.GetInstance().InsertBreaker(breakerModel) == -1) { Umc.Core.Util.Utility.JS_Alert(this, BreakerConst.MESSAGE_BREAKER_ALREADY_INSERT); } else { Umc.Core.Util.Utility.JS_Alert(this, BreakerConst.MESSAGE_BREAKER_INSERT); } } else if (e.CommandName == "unbreaker") { if (BreakerManager.GetInstance().RemoveBreaker(e.CommandArgument.ToString())) { Umc.Core.Util.Utility.JS_Alert(this, BreakerConst.MESSAGE_BREAKER_REMOVE); } else { Umc.Core.Util.Utility.JS_Alert(this, BreakerConst.MESSAGE_BREAKER_CAN_NOT_REMOVE); } } bind(); }
/// <summary> /// ���� ����� �߰��Ѵ�. /// </summary> /// <param name="model"></param> /// <returns>����Ű -1 �ϰ�� �̹� ��ϵ�</returns> public static int InsertBreaker(BreakerModel model) { SqlParameter[] param = { CreateInParam("@UserIP", SqlDbType.VarChar,20, model.UserIP), CreateReturnValue() }; SqlCommand cmd = GetSpCommand("UBB_InsertBreaker", param, IsolationLevel.ReadUncommitted); try { cmd.ExecuteNonQuery(); int seqNo = (int)cmd.Parameters["@ReturnValue"].Value; ReleaseCommandWithCommit(cmd); return seqNo; } catch (UmcDataException ex) { ReleaseCommandWithRollback(cmd); throw new UmcDataException("UBB_InsertBreaker ���ν��� ȣ���� ����", ex); } }
/// <summary> /// 차단 목록 리스트를 가져온다. /// </summary> /// <returns></returns> public static List <BreakerModel> GetBreakerList() { SqlCommand cmd = GetRawCommand("SELECT * FROM Breaker ORDER BY InsertDate"); SqlDataReader reader = cmd.ExecuteReader(CommandBehavior.CloseConnection); List <BreakerModel> bindModel = new List <BreakerModel>(); while (reader.Read()) { BreakerModel model = new BreakerModel(); fillBreakerModel(reader, model); bindModel.Add(model); model = null; } return(bindModel); }
/// <summary> /// ���� ��� ����Ʈ�� �����´�. /// </summary> /// <returns></returns> public static List<BreakerModel> GetBreakerList() { SqlCommand cmd = GetRawCommand("SELECT * FROM Breaker ORDER BY InsertDate"); SqlDataReader reader = cmd.ExecuteReader(CommandBehavior.CloseConnection); List<BreakerModel> bindModel = new List<BreakerModel>(); while (reader.Read()) { BreakerModel model = new BreakerModel(); fillBreakerModel( reader, model ); bindModel.Add( model ); model = null; } return bindModel; }
private static void fillBreakerModel(IDataRecord row, BreakerModel model) { model.SeqNo = (int)row["SeqNo"]; model.UserIP = (string)row["UserIP"]; model.InsertDate = (object)row["InsertDate"]; }
/// <summary> /// 차단 목록을 추가한다. /// </summary> /// <param name="model"></param> /// <returns>고유키 -1 일경우 이미 등록됨</returns> public int InsertBreaker(BreakerModel model) { return(BreakerAccess.InsertBreaker(model)); }
/// <summary> /// ���� ����� �߰��Ѵ�. /// </summary> /// <param name="model"></param> /// <returns>����Ű -1 �ϰ�� �̹� ��ϵ�</returns> public int InsertBreaker(BreakerModel model) { return BreakerAccess.InsertBreaker( model ); }