示例#1
0
 public ActionResult Edit(int id, Models.AppSalesPriceGroupTable collection)
 {
     try
     {
         int outputId = _dataobject.Update(collection);
         return(RedirectToAction(this.ActionReturn()));
     }
     catch (Exception ex)
     {
         Services.GlobalErrors.Parse(ModelState, _dataobject.Errors, ex);
         return(PartialView(this._updateview, collection));
     }
 }
示例#2
0
        public int Insert(Models.AppSalesPriceGroupTable data)
        {
            try
            {
                this.Validate(data);

                data.CreatedBy       = GlobalVariant.GetAppUser().UserID;
                data.CreatedDateTime = DateTime.Now;

                SqlParameter[] parameters = ExConvert.Data2SqlParam(data, this._metaobject, this._paramnameoutput).ToArray();
                this._db.Database.ExecuteSqlCommand(this._storeNameI, parameters);

                return((int)parameters.GetValueSqlParam(this._paramnameoutput));
            }
            catch (Exception)
            {
                throw;
            }
        }
示例#3
0
        public int Update(Models.AppSalesPriceGroupTable data)
        {
            try
            {
                this.Validate(data);

                data.ModifiedBy       = GlobalVariant.GetAppUser().UserID;
                data.ModifiedDateTime = DateTime.Now;

                SqlParameter pOriginal  = ExConvert.ParseSqlParam(data, this._metaobject.GetMetaByColumnName(this._paramnameoutput), this._paramnameupdate);
                var          parameters = ExConvert.Data2SqlParam(data, this._metaobject, pOriginal).ToArray();
                this._db.Database.ExecuteSqlCommand(this._storeNameU, parameters);

                return(data.SalesPriceGroupID);
            }
            catch (Exception)
            {
                throw;
            }
        }