Пример #1
0
        /// <summary>
        /// Save Data To Database
        /// <para>Use it when save data through a stored procedure</para>
        /// </summary>
        public int UpdateUserType(vmUserType model)
        {
            int result = 0;

            try
            {
                if (model != null)
                {
                    using (GenericFactoryFor_UserType = new vmUserType_GF())
                    {
                        Hashtable ht = new Hashtable();
                        ht.Add("CompanyID", model.CompanyID);
                        ht.Add("LoggedUser", model.LoggedUser);

                        ht.Add("UserTypeID", model.UserTypeID);
                        ht.Add("UserTypeName", model.UserTypeName);
                        ht.Add("ParentID", model.ParentID);

                        string spQuery = "[Put_CmnUserType]";
                        result = GenericFactoryFor_UserType.ExecuteCommand(spQuery, ht);
                    }
                }
            }
            catch (Exception e)
            {
                e.ToString();
            }

            return(result);
        }
Пример #2
0
        public HttpResponseMessage UpdateUserType(vmUserType model)
        {
            int result = 0;

            try
            {
                if (model != null)
                {
                    result = objUserService.UpdateUserType(model);
                }
            }
            catch (Exception e)
            {
                e.ToString();
                result = -0;
            }

            return(Request.CreateResponse(HttpStatusCode.OK, result));
        }