Ejemplo n.º 1
0
 public int Update(Cms_ClassVideo model)
 {
     return((int)SqlHelper.ExecuteScalar(SqlConnection, CommonHelper.Config.GetFullyQualifiedName("Cms_ClassVideo_Update")
                                         , model.Id, CommonHelper.Null.GetNull(model.Name)
                                         , CommonHelper.Null.GetNull(model.Summary), model.ClassId, CommonHelper.Null.GetNull(model.Link), model.Orders, model.UsedState,
                                         model.CreatedBy, model.CreatedDate,
                                         CommonHelper.Null.GetNull(model.ModifiedDate), CommonHelper.Null.GetNull(model.ModifiedBy)));
 }
Ejemplo n.º 2
0
        public int Insert(Cms_ClassVideo model)
        {
            var deciResult = SqlHelper.ExecuteScalar(SqlConnection, CommonHelper.Config.GetFullyQualifiedName("Cms_ClassVideo_Insert")
                                                     , CommonHelper.Null.GetNull(model.Name)
                                                     , CommonHelper.Null.GetNull(model.Summary), model.ClassId, CommonHelper.Null.GetNull(model.Link), model.Orders, model.UsedState,
                                                     model.CreatedBy, model.CreatedDate,
                                                     CommonHelper.Null.GetNull(model.ModifiedDate), CommonHelper.Null.GetNull(model.ModifiedBy));

            return(CommonHelper.Convert.ConvertToInt32(deciResult));
        }
Ejemplo n.º 3
0
        public ActionResult Edit(Cms_ClassVideo sysModel)
        {
            try
            {
                #region Redirect Request

                int succcess = 0;
                if (sysModel.Id > 0)
                {
                    var objTemporary = _sysAction.GetById(sysModel.Id);
                    if (AuthorizeUser.IsAction(Ultity.Constant.Edit) || AuthorizeUser.IsAction(Ultity.Constant.ViewEditAll))
                    {
                        sysModel.CreatedBy    = objTemporary.CreatedBy;
                        sysModel.ModifiedDate = DateTime.Now;
                        sysModel.ModifiedBy   = WebSecurity.CurrentUserId;
                        sysModel.CreatedDate  = objTemporary.CreatedDate;
                        succcess = _sysAction.Update(sysModel);
                    }
                    else
                    {
                        succcess = 1;
                    }
                }
                else
                {
                    if (AuthorizeUser.IsAction(Ultity.Constant.Add) || AuthorizeUser.IsAction(Ultity.Constant.ViewEditAll))
                    {
                        sysModel.CreatedBy    = WebSecurity.CurrentUserId;
                        sysModel.ModifiedBy   = null;
                        sysModel.CreatedDate  = DateTime.Now;
                        sysModel.ModifiedDate = null;
                        succcess = _sysAction.Insert(sysModel);
                    }
                    else
                    {
                        succcess = 1;
                    }
                }

                if (succcess > 0)
                {
                    return(Json(new { status = "success", Message = Ultity.Constant.Ajax_Success }));
                }
                return(Json(new { status = "fail", Message = Ultity.Constant.Ajax_Fail }));

                #endregion Redirect Request
            }
            catch (Exception exception)
            {
                Ultity.TFunction.WriteToLog(exception);
            }

            return(Json(new { status = "fail", Message = Ultity.Constant.Ajax_Fail }));
        }
Ejemplo n.º 4
0
        public ActionResult GetById(int?id)
        {
            var objTemporary = new Cms_ClassVideo();

            try
            {
                int editId = id.HasValue ? id.Value : 0;
                if (editId > 0)
                {
                    objTemporary = _sysAction.GetById(editId);
                }
                return(Json(new { status = "success", Message = Ultity.Constant.Ajax_Success, Data = objTemporary }));
            }
            catch (Exception exception)
            {
                Ultity.TFunction.WriteToLog(exception);
                return(Json(new { status = "fail", Message = Ultity.Constant.Ajax_Fail }));
            }
        }