public ActionResult SearchMonth(int DevelopYearId)
        {
            DevelopYear developyear = ServiceFactory.DevelopYearManager.Get(new DevelopYear {
                DevelopYearId = DevelopYearId
            });
            List <DevelopMonth> listmonth = new List <DevelopMonth>();

            listmonth             = ServiceFactory.DevelopMonthManager.GetByYear(DevelopYearId, Culture);
            developyear.ListMonth = listmonth;
            return(View(developyear));
        }
Beispiel #2
0
        public void Remove(DevelopYear item)
        {
            var comm = this.GetCommand("sp_DevelopYearDelete");

            if (comm == null)
            {
                return;
            }
            comm.AddParameter <int>(this.Factory, "DevelopYearId", item.DevelopYearId);
            comm.SafeExecuteNonQuery();
            //throw new NotImplementedException();
        }
Beispiel #3
0
 public void Add(DevelopYear item)
 {
     //var comm = this.GetCommand("sp_DevelopYear_Insert");
     //if (comm == null) return;
     //comm.AddParameter<string>(this.Factory, "Url", item.Url);
     //comm.AddParameter<bool>(this.Factory, "IsActive", item.IsActive);
     ////comm.AddParameter<DateTime>(this.Factory, "CreateDate", item.CreateDate);
     ////comm.AddParameter<DateTime>(this.Factory, "EditDate", item.EditDate);
     //comm.AddParameter<string>(this.Factory, "CreateBy", item.CreateBy);
     //comm.AddParameter<string>(this.Factory, "Image", item.Image);
     //comm.AddParameter<int>(this.Factory, "OrderNo", item.OrderNo);
     //comm.SafeExecuteNonQuery();
     throw new NotImplementedException();
 }
Beispiel #4
0
        public DevelopYear Get(DevelopYear dummy)
        {
            var comm = this.GetCommand("sp_DevelopYearGet");

            if (comm == null)
            {
                return(null);
            }
            comm.AddParameter <int>(this.Factory, "DevelopYearId", dummy.DevelopYearId);
            var dt           = this.GetTable(comm);
            var sliderBanner = EntityBase.ParseListFromTable <DevelopYear>(dt).FirstOrDefault();

            return(sliderBanner ?? null);
            //throw new NotImplementedException();
        }
Beispiel #5
0
        public void Add(DevelopYear item, string culture)
        {
            var comm = this.GetCommand("sp_DevelopYearInsert");

            if (comm == null)
            {
                return;
            }
            comm.AddParameter <int>(this.Factory, "DevelopYearName", item.DevelopYearName);
            comm.AddParameter <string>(this.Factory, "DevelopYearBg", item.DevelopYearBg);
            comm.AddParameter <bool>(this.Factory, "IsActive", item.IsActive);
            comm.AddParameter <string>(this.Factory, "Culture", culture);
            comm.AddParameter <string>(this.Factory, "CreateBy", item.CreateBy);
            comm.SafeExecuteNonQuery();
            //throw new NotImplementedException();
        }
 public ActionResult CreateYear(DevelopYear model)
 {
     if (ModelState.IsValid)
     {
         try
         {
             model.CreateBy = UserState.SysUser.Fullname;
             ServiceFactory.DevelopYearManager.Add(model, Culture);
             return(RedirectToAction("SearchYear", "Introduction"));
         }
         catch (Exception)
         {
             //throw;
         }
     }
     return(View("UpdateYear", model));
 }
Beispiel #7
0
        public void Update(DevelopYear @new, DevelopYear old)
        {
            var item = @new;

            item.DevelopYearId = old.DevelopYearId;
            var comm = this.GetCommand("sp_DevelopYearUpdate");

            if (comm == null)
            {
                return;
            }
            comm.AddParameter <int>(this.Factory, "DevelopYearId", item.DevelopYearId);
            comm.AddParameter <int>(this.Factory, "DevelopYearName", item.DevelopYearName);
            comm.AddParameter <string>(this.Factory, "DevelopYearBg", item.DevelopYearBg);
            comm.AddParameter <bool>(this.Factory, "IsActive", item.IsActive);
            comm.SafeExecuteNonQuery();
            //throw new NotImplementedException();
        }
        public ActionResult UpdateYear(DevelopYear model)
        {
            if (ModelState.IsValid)
            {
                var obj = ServiceFactory.DevelopYearManager.Get(new DevelopYear {
                    DevelopYearId = model.DevelopYearId
                });
                if (obj != null)
                {
                    try
                    {
                        ServiceFactory.DevelopYearManager.Update(model, obj);

                        return(RedirectToAction("SearchYear", "Introduction"));
                    }
                    catch (Exception)
                    {
                        //throw;
                    }
                }
            }
            ViewBag.IsEdit = true;
            return(View(model));
        }
        public ActionResult CreateYear()
        {
            DevelopYear data = new DevelopYear();

            return(View("UpdateYear", data));
        }