public static int Insert(PromotionTypeEntity promotionTypeEntity) { PromotionTypeDBEntity dbParm = (promotionTypeEntity.PromotiontypeDBEntity.Count > 0) ? promotionTypeEntity.PromotiontypeDBEntity[0] : new PromotionTypeDBEntity(); OracleParameter[] lmParm ={ new OracleParameter("ID",OracleType.Number), new OracleParameter("NAME",OracleType.VarChar), new OracleParameter("SEQ",OracleType.Number) }; lmParm[0].Value = getMaxIDfromSeq("t_lm_promotion_method_seq"); if (string.IsNullOrEmpty(dbParm.Name)) { lmParm[1].Value = DBNull.Value; } else { lmParm[1].Value = dbParm.Name; } if (string.IsNullOrEmpty(dbParm.Seq)) { lmParm[2].Value = DBNull.Value; } else { lmParm[2].Value = dbParm.Seq; } return DbManager.ExecuteSql("Promotion", "t_promotion_method_insert", lmParm); }
public static int Delete(PromotionTypeEntity promotionTypeEntity) { PromotionTypeDBEntity dbParm = (promotionTypeEntity.PromotiontypeDBEntity.Count > 0) ? promotionTypeEntity.PromotiontypeDBEntity[0] : new PromotionTypeDBEntity(); OracleParameter[] lmParm ={ new OracleParameter("ID",OracleType.Number) }; lmParm[0].Value = dbParm.ID; return DbManager.ExecuteSql("Promotion", "t_promotion_method_delete", lmParm); }
public static int Insert(PromotionTypeEntity promotionTypeEntity) { promotionTypeEntity.LogMessages.MsgType = MessageType.INFO; promotionTypeEntity.LogMessages.Content = _nameSpaceClass + "Insert"; LoggerHelper.LogWriter(promotionTypeEntity.LogMessages); try { return PromotionTypeDA.Insert(promotionTypeEntity); } catch (Exception ex) { promotionTypeEntity.LogMessages.MsgType = MessageType.ERROR; promotionTypeEntity.LogMessages.Content = _nameSpaceClass + "Insert Error: " + ex.Message; LoggerHelper.LogWriter(promotionTypeEntity.LogMessages); throw ex; } }
public static PromotionTypeEntity CommonSelect(PromotionTypeEntity promotionTypeEntity) { PromotionTypeDBEntity dbParm = (promotionTypeEntity.PromotiontypeDBEntity.Count > 0) ? promotionTypeEntity.PromotiontypeDBEntity[0] : new PromotionTypeDBEntity(); OracleParameter[] lmParm ={ new OracleParameter("NAME",OracleType.VarChar) }; if (String.IsNullOrEmpty(dbParm.Name)) { lmParm[0].Value = DBNull.Value; } else { lmParm[0].Value = dbParm.Name; } promotionTypeEntity.QueryResult = DbManager.Query("Promotion", "t_promotion_method", false, lmParm); return promotionTypeEntity; }
public void BindPromotionType() { PromotionTypeEntity _promotionTypeEntity = new PromotionTypeEntity(); _promotionTypeEntity.LogMessages = new HotelVp.Common.Logger.LogMessage(); _promotionTypeEntity.LogMessages.Userid = UserSession.Current.UserAccount; _promotionTypeEntity.LogMessages.Username = UserSession.Current.UserDspName; _promotionTypeEntity.LogMessages.IpAddress = UserSession.Current.UserIP; _promotionTypeEntity.PromotiontypeDBEntity = new List<PromotionTypeDBEntity>(); PromotionTypeDBEntity promotionTypeDBEntity = new PromotionTypeDBEntity(); _promotionTypeEntity.PromotiontypeDBEntity.Add(promotionTypeDBEntity); _promotionTypeEntity = PromotionTypeBP.CommonSelect(_promotionTypeEntity); ddpPromotionType.DataTextField = "NAME"; ddpPromotionType.DataValueField = "ID"; ddpPromotionType.DataSource = _promotionTypeEntity.QueryResult.Tables[0]; ddpPromotionType.DataBind(); }