//[OperationBehavior]
        public UFIDA.U9.Cust.JSDY.BarCode.OperatorsDTOData DoEx(ICommonDataContract commonData)
        {
            this.CommonData = commonData;
            try
            {
                BeforeInvoke("UFIDA.U9.Cust.JSDY.BarCode.GetOperatorsForLoginUser");
                GetOperatorsForLoginUser objectRef = new GetOperatorsForLoginUser();


                //处理返回类型.
                UFIDA.U9.Cust.JSDY.BarCode.OperatorsDTO result = objectRef.Do();

                if (result == null)
                {
                    return(null);
                }
                UFIDA.U9.Cust.JSDY.BarCode.OperatorsDTOData resultdata = result.ToEntityData();
                DoSerializeKey(resultdata, "UFIDA.U9.Cust.JSDY.BarCode.GetOperatorsForLoginUser");
                return(resultdata);
            }
            catch (System.Exception e)
            {
                DealException(e);
                throw;
            }
            finally
            {
                FinallyInvoke("UFIDA.U9.Cust.JSDY.BarCode.GetOperatorsForLoginUser");
            }
        }
示例#2
0
        public override object Do(object obj)
        {
            GetOperatorsForLoginUser bpObj = (GetOperatorsForLoginUser)obj;
            User user = User.Finder.FindByID(Base.Context.LoginUserID);

            if (user == null)
            {
                return(null);
            }
            if (user.ContactKey == null)
            {
                return(null);
            }

            Operators operators = Operators.Finder.Find(string.Format("Org={0} and Contact={1}", Base.Context.LoginOrg.ID, user.ContactKey.ID));

            if (operators == null)
            {
                return(null);
            }

            OperatorsDTO dto = new OperatorsDTO();

            dto.OperatorsID   = operators.ID;
            dto.OperatorsCode = operators.Code;
            dto.OperatorsName = operators.Name;
            return(dto);
        }