Exemple #1
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="pc">pc</param>
        /// <returns>影响的记录行数</returns>
        public int DeleteMultiple(ParameterCollection pc)
        {
            int ret = 0;

            ActionInfoModel actioninfo = new ActionInfoModel();

            ret = DbUtil.Current.DeleteMultiple(actioninfo, pc);

            return(ret);
        }
Exemple #2
0
        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="actioninfo">实体</param>
        /// <returns>影响的记录行数</returns>
        public int Update(ActionInfoModel actioninfo)
        {
            int ret = 0;

            actioninfo.ModifiedBy = SessionUtil.Current.UserId;
            actioninfo.ModifiedOn = DateTime.Now;

            ret = DbUtil.Current.Update(actioninfo);

            return(ret);
        }
Exemple #3
0
        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="actioninfo">实体</param>
        /// <param name="pc">pc</param>
        /// <returns>影响的记录行数</returns>
        public int UpdateMultiple(ActionInfoModel actioninfo, ParameterCollection pc)
        {
            int ret = 0;

            actioninfo.ModifiedBy = SessionUtil.Current.UserId;
            actioninfo.ModifiedOn = DateTime.Now;

            ret = DbUtil.Current.UpdateMultiple(actioninfo, pc);

            return(ret);
        }
Exemple #4
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="actionid"></param>
        /// <returns>影响的记录行数</returns>
        public int Delete(string actionid)
        {
            int ret = 0;

            ActionInfoModel actioninfo = new ActionInfoModel();

            actioninfo.ActionId = actionid;

            ret = DbUtil.Current.Delete(actioninfo);

            return(ret);
        }
        public int UpdateByModel(ActionInfoModel Model)
        {
            String sql = "UPDATE ActionInfo SET AName=@AName,ADetail=@ADetail,ABeginTime=@ABeginTime,AEndTime=@AEndTime,AStatus=@AStatus WHERE AID=@AID";

            return(DataBaseOpen.NoQuery(sql, new SqlParameter[] {
                new SqlParameter("@AID", Model.AID),
                new SqlParameter("@AName", Model.AName),
                new SqlParameter("@ADetail", Model.ADetail),
                new SqlParameter("@ABeginTime", Model.ABeginTime),
                new SqlParameter("@AEndTime", Model.AEndTime),
                new SqlParameter("@AStatus", Model.AStatus),
            }));
        }
        public int InsertByModel(ActionInfoModel Model)
        {
            String sql = "INSERT INTO ActionInfo(AName,ADetail,ABeginTime,AEndTime,AStatus) VALUES(@AName,@ADetail,@ABeginTime,@AEndTime,@AStatus)";

            return(DataBaseOpen.NoQuery(sql, new SqlParameter[] {
                new SqlParameter("@AID", Model.AID),
                new SqlParameter("@AName", Model.AName),
                new SqlParameter("@ADetail", Model.ADetail),
                new SqlParameter("@ABeginTime", Model.ABeginTime),
                new SqlParameter("@AEndTime", Model.AEndTime),
                new SqlParameter("@AStatus", Model.AStatus),
            }));
        }
Exemple #7
0
        /// <summary>
        /// 新建
        /// </summary>
        /// <param name="actioninfo">实体</param>
        /// <returns>影响的记录行数</returns>
        public int Create(ActionInfoModel actioninfo)
        {
            int ret = 0;

            actioninfo.CreatedBy  = SessionUtil.Current.UserId;
            actioninfo.CreatedOn  = DateTime.Now;
            actioninfo.ModifiedBy = SessionUtil.Current.UserId;
            actioninfo.ModifiedOn = DateTime.Now;
            actioninfo.StatusCode = 0;

            ret = DbUtil.Current.Create(actioninfo);

            return(ret);
        }
Exemple #8
0
        /// <summary>
        /// 根据条件获取实体集合
        /// </summary>
        /// <param name="pc">pc</param>
        /// <param name="obc">obc</param>
        /// <returns>实体</returns>
        public List <ActionInfoModel> RetrieveMultiple(ParameterCollection pc, OrderByCollection obc)
        {
            List <ActionInfoModel> actioninfos = new List <ActionInfoModel>();

            ActionInfoModel actioninfo = new ActionInfoModel();
            DataTable       dt         = DbUtil.Current.RetrieveMultiple(actioninfo, pc, obc);

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                actioninfo = new ActionInfoModel();
                actioninfo.ConvertFrom(dt, i);
                actioninfos.Add(actioninfo);
            }

            return(actioninfos);
        }
Exemple #9
0
        /// <summary>
        /// 根据主键获取实体
        /// </summary>
        /// <param name="actionid"></param>
        /// <returns>实体</returns>
        public ActionInfoModel Retrieve(string actionid)
        {
            ActionInfoModel actioninfo = new ActionInfoModel();

            actioninfo.ActionId = actionid;

            DataTable dt = DbUtil.Current.Retrieve(actioninfo);

            if (dt.Rows.Count < 1)
            {
                return(null);
            }

            actioninfo.ConvertFrom(dt);

            return(actioninfo);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack)
            {
                return;
            }
            int AID = Convert.ToInt32(Request["AID"]);

            try
            {
                ActionInfoModel infoModel = actionInfoBLL.ToModel(actionInfoBLL.SelectByID(AID))[0];
                TEXTBOX_BeginTime.Text          = infoModel.ABeginTime;
                TEXTBOX_Detail.Text             = infoModel.ADetail;
                TEXTBOX_EndeTime.Text           = infoModel.AEndTime;
                TEXTBOX_Name.Text               = infoModel.AName;
                DROPDOWNLIST_Stat.SelectedIndex = infoModel.AStatus ? 1 : 0;
            }
            catch
            {
                Response.End();
            }
        }
Exemple #11
0
 public int UpdateByModel(ActionInfoModel Model)
 {
     return(DAL.UpdateByModel(Model));
 }
Exemple #12
0
 public int InsertByModel(ActionInfoModel Model)
 {
     return(DAL.InsertByModel(Model));
 }