public ActionResult CreateMonth(int yearid)
        {
            DevelopMonth data = new DevelopMonth();

            data.DevelopYearId = yearid;
            return(View("UpdateMonth", data));
        }
Beispiel #2
0
        public void Remove(DevelopMonth item)
        {
            var comm = this.GetCommand("sp_DevelopMonthDelete");

            if (comm == null)
            {
                return;
            }
            comm.AddParameter <int>(this.Factory, "DevelopMonthId", item.DevelopMonthId);
            comm.SafeExecuteNonQuery();
            //throw new NotImplementedException();
        }
Beispiel #3
0
 public void Add(DevelopMonth item)
 {
     //var comm = this.GetCommand("sp_DevelopMonth_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 DevelopMonth Get(DevelopMonth dummy)
        {
            var comm = this.GetCommand("sp_DevelopMonthGet");

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

            return(sliderBanner ?? null);
            //throw new NotImplementedException();
        }
 public ActionResult CreateMonth(DevelopMonth model)
 {
     if (ModelState.IsValid)
     {
         try
         {
             model.CreateBy = UserState.SysUser.Fullname;
             ServiceFactory.DevelopMonthManager.Add(model, Culture);
             return(RedirectToAction("SearchMonth", "Introduction", new { DevelopYearId = model.DevelopYearId }));
         }
         catch (Exception)
         {
             //throw;
         }
     }
     return(View("UpdateMonth", model));
 }
Beispiel #6
0
        public void Add(DevelopMonth item, string culture)
        {
            var comm = this.GetCommand("sp_DevelopMonthInsert");

            if (comm == null)
            {
                return;
            }
            comm.AddParameter <int>(this.Factory, "DevelopYearId", item.DevelopYearId);
            comm.AddParameter <int>(this.Factory, "DevelopMonthName", item.DevelopMonthName);
            comm.AddParameter <string>(this.Factory, "DevelopMonthTitle", item.DevelopMonthTitle);
            comm.AddParameter <string>(this.Factory, "DevelopMonthDescription", item.DevelopMonthDescription);
            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();
        }
Beispiel #7
0
        public void Update(DevelopMonth @new, DevelopMonth old)
        {
            var item = @new;

            item.DevelopMonthId = old.DevelopMonthId;
            var comm = this.GetCommand("sp_DevelopMonthUpdate");

            if (comm == null)
            {
                return;
            }
            comm.AddParameter <int>(this.Factory, "DevelopMonthId", item.DevelopMonthId);
            comm.AddParameter <int>(this.Factory, "DevelopYearId", item.DevelopYearId);
            comm.AddParameter <int>(this.Factory, "DevelopMonthName", item.DevelopMonthName);
            comm.AddParameter <string>(this.Factory, "DevelopMonthTitle", item.DevelopMonthTitle);
            comm.AddParameter <string>(this.Factory, "DevelopMonthDescription", item.DevelopMonthDescription);
            comm.AddParameter <bool>(this.Factory, "IsActive", item.IsActive);

            comm.SafeExecuteNonQuery();
            //throw new NotImplementedException();
        }
        public ActionResult UpdateMonth(DevelopMonth model)
        {
            if (ModelState.IsValid)
            {
                var obj = ServiceFactory.DevelopMonthManager.Get(new DevelopMonth {
                    DevelopMonthId = model.DevelopMonthId
                });
                if (obj != null)
                {
                    try
                    {
                        ServiceFactory.DevelopMonthManager.Update(model, obj);

                        return(RedirectToAction("SearchMonth", "Introduction", new { DevelopYearId = model.DevelopYearId }));
                    }
                    catch (Exception)
                    {
                        //throw;
                    }
                }
            }
            ViewBag.IsEdit = true;
            return(View(model));
        }