Пример #1
0
        public void Post(EbObjectChangeStatusRequest request)
        {
            ILog log = LogManager.GetLogger(GetType());

            log.Info("#DS Change status");

            try
            {
                using (var con = this.TenantDbFactory.ObjectsDB.GetNewConnection())
                {
                    con.Open();
                    DbCommand cmd = null;
                    log.Info("#DS insert 1 -- con open");

                    string sql = "SELECT eb_objects_change_status(@id, @status, @commit_uid, @obj_changelog)";
                    cmd = this.TenantDbFactory.ObjectsDB.GetNewCommand(con, sql);

                    cmd.Parameters.Add(this.TenantDbFactory.ObjectsDB.GetNewParameter("@id", System.Data.DbType.String, request.RefId));
                    cmd.Parameters.Add(this.TenantDbFactory.ObjectsDB.GetNewParameter("@status", System.Data.DbType.Int32, (int)request.Status));
                    cmd.Parameters.Add(this.TenantDbFactory.ObjectsDB.GetNewParameter("@commit_uid", System.Data.DbType.Int32, request.UserId));
                    cmd.Parameters.Add(this.TenantDbFactory.ObjectsDB.GetNewParameter("@obj_changelog", System.Data.DbType.String, request.ChangeLog));
                    cmd.ExecuteScalar();
                }
            }
            catch (Exception e)
            {
            }
        }
Пример #2
0
        public string ChangeStatus(string _refid, string _changelog, string _status)
        {
            var ds = new EbObjectChangeStatusRequest();

            ds.RefId     = _refid;
            ds.Status    = (ObjectLifeCycleStatus)Enum.Parse(typeof(ObjectLifeCycleStatus), _status);
            ds.ChangeLog = _changelog;
            var res = this.ServiceClient.Post <EbObjectChangeStatusResponse>(ds);

            return("success");
        }