Ejemplo n.º 1
0
        public ActionResult UpdatePro(ProducerProperties model)
        {
            if (ModelState.IsValid)
            {
                var obj = ServiceFactory.ProducerPropertyManager.Get(new ProducerProperties {
                    ProducerPropertyId = model.ProducerPropertyId
                });
                if (obj != null)
                {
                    try
                    {
                        ServiceFactory.ProducerPropertyManager.Update(model, obj);

                        return(RedirectToAction("ProducerProperties", "Producers", new { producerId = model.ProducerId }));
                    }
                    catch (Exception ex)
                    {
                        //throw;
                    }
                }
            }
            ViewBag.IsEdit = true;
            var pro = ServiceFactory.ProducerManager.Get(new Producers {
                ProducerId = model.ProducerId
            });

            ViewBag.Producer = pro;
            return(View(model));
        }
        public void Remove(ProducerProperties item)
        {
            var comm = this.GetCommand("sp_ProducerProperty_Delete");

            if (comm == null)
            {
                return;
            }
            comm.AddParameter <int>(this.Factory, "ProducerPropertyId", item.ProducerPropertyId);
            comm.SafeExecuteNonQuery();
        }
Ejemplo n.º 3
0
        public ActionResult CreatePro(int producerId)
        {
            ProducerProperties data = new ProducerProperties();

            data.ProducerId = producerId;
            var pro = ServiceFactory.ProducerManager.Get(new Producers {
                ProducerId = producerId
            });

            ViewBag.Producer = pro;
            return(View("UpdatePro", data));
        }
        public ProducerProperties Get(ProducerProperties dummy)
        {
            var comm = this.GetCommand("sp_ProducerPropertyGet");

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

            return(htmlPage ?? null);
        }
        public ProducerProperties GetByShortName(ProducerProperties dummy, string culture)
        {
            var comm = this.GetCommand("sp_ProducerPropertyGetByShortName");

            if (comm == null)
            {
                return(null);
            }
            comm.AddParameter <string>(this.Factory, "ShortName", dummy.ShortName);
            comm.AddParameter <string>(this.Factory, "Culture", culture);
            var dt       = this.GetTable(comm);
            var htmlPage = EntityBase.ParseListFromTable <ProducerProperties>(dt).FirstOrDefault();

            return(htmlPage ?? null);
        }
        public void Update(ProducerProperties @new, ProducerProperties old)
        {
            var item = @new;

            item.ProducerPropertyId = old.ProducerPropertyId;
            var comm = this.GetCommand("sp_ProducerProperty_Update");

            if (comm == null)
            {
                return;
            }
            comm.AddParameter <int>(this.Factory, "ProducerPropertyId", item.ProducerPropertyId);
            comm.AddParameter <string>(this.Factory, "PropertyName", item.PropertyName);
            comm.AddParameter <int>(this.Factory, "OrderNo", item.OrderNo);
            comm.AddParameter <bool>(this.Factory, "IsActive", item.IsActive);
            comm.SafeExecuteNonQuery();
        }
        public void Add(ProducerProperties item, string culture)
        {
            var comm = this.GetCommand("sp_ProducerProperty_Insert");

            if (comm == null)
            {
                return;
            }
            //comm.AddParameter<int>(this.Factory, "ProducerPropertyId", item.ProducerPropertyId);
            comm.AddParameter <int>(this.Factory, "ProducerId", item.ProducerId);
            comm.AddParameter <string>(this.Factory, "PropertyName", item.PropertyName);
            comm.AddParameter <string>(this.Factory, "ShortName", item.ShortName);
            comm.AddParameter <string>(this.Factory, "CreateBy", item.CreateBy);
            comm.AddParameter <int>(this.Factory, "OrderNo", item.OrderNo);
            comm.AddParameter <bool>(this.Factory, "IsActive", item.IsActive);
            comm.AddParameter <string>(this.Factory, "Culture", culture);
            comm.SafeExecuteNonQuery();
        }
Ejemplo n.º 8
0
        public ActionResult CreatePro(ProducerProperties model)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    model.CreateBy = CurrentUser.Name;
                    ServiceFactory.ProducerPropertyManager.Add(model, Culture);

                    return(RedirectToAction("ProducerProperties", "Producers", new { producerId = model.ProducerId }));
                }
                catch (Exception e)
                {
                    //throw;
                }
            }
            var pro = ServiceFactory.ProducerManager.Get(new Producers {
                ProducerId = model.ProducerId
            });

            ViewBag.Producer = pro;
            return(View("UpdatePro", model));
        }
Ejemplo n.º 9
0
 public override IBuilder UseProducerProperties(ProducerProperties properties)
 {
     return(this);
 }
Ejemplo n.º 10
0
 public abstract IBuilder UseProducerProperties(ProducerProperties properties);
Ejemplo n.º 11
0
 public override IBuilder UseProducerProperties(ProducerProperties properties)
 {
     ApplyParameters(properties);
     return(this);
 }
 public void Add(ProducerProperties item)
 {
     throw new NotImplementedException();
 }