Exemplo n.º 1
0
        public string DelDept(string pRequest)
        {
            var rd     = new APIResponse <DelDeptRD>();
            var rdData = new DelDeptRD();
            var rp     = pRequest.DeserializeJSONTo <APIRequest <DelDeptRP> >();

            if (rp.Parameters == null)
            {
                throw new ArgumentException();
            }

            if (rp.Parameters != null)
            {
                rp.Parameters.Validate();
            }

            var loggingSessionInfo = new LoggingSessionManager().CurrentSession;

            try
            {
                TUnitBLL unitBll   = new TUnitBLL(loggingSessionInfo);
                string[] unitIdArr = rp.Parameters.UnitID.Split(',');
                unitBll.Delete(unitIdArr);
                rdData.IsSuccess = true;
                rd.ResultCode    = 0;
                rd.Data          = rdData;
            }
            catch (Exception ex)
            {
                rd.ResultCode = 103;
                rd.Message    = ex.Message;
            }
            return(rd.ToJSON());
        }
Exemplo n.º 2
0
        public string DelDept(string pRequest)
        {
            var rd     = new APIResponse <DelDeptRD>();
            var rdData = new DelDeptRD();
            var rp     = pRequest.DeserializeJSONTo <APIRequest <DelDeptRP> >();

            if (rp.Parameters == null)
            {
                throw new ArgumentException();
            }

            if (rp.Parameters != null)
            {
                rp.Parameters.Validate();
            }

            var loggingSessionInfo = Default.GetBSLoggingSession(rp.CustomerID, rp.UserID);

            try
            {
                TUnitBLL unitBll = new TUnitBLL(loggingSessionInfo);
                unitBll.Delete(rp.Parameters.UnitID, null);
                rdData.IsSuccess = true;
                rd.ResultCode    = 0;
                rd.Data          = rdData;
            }
            catch (Exception ex)
            {
                rd.ResultCode = 103;
                rd.Message    = ex.Message;
            }
            return(rd.ToJSON());
        }