Example #1
0
        public RequestResult RemoveSmallCode(string code)
        {
            RequestResult result = new RequestResult();

            try
            {
                Scale scale = Scale.GetScaleForSmall(code);

                if (scale != null)
                {
                    if (!scale.IsOut)
                    {
                        result.message = "未出货";
                        result.success = false;
                    }
                    else if (ScaleOutStoke.IsSubOutStock_Small(code))
                    {
                        result.message = "此条码下级已出货";
                        result.success = false;
                    }
                    else
                    {
                        scale.IsOut      = false;
                        scale.OutPDAUser = ""; // PdaUser.PUserName;
                        scale.OutTime    = 0;  // CommonFunc.GetNowTimestamp();
                        scale.UserName   = "";
                        scale.StateID    = 6;
                        scale.UpdateByID();
                        ScaleOutStoke.DeleteOutScaleRtnState(code);     // 移除出货表记录

                        result.message = "成功";
                        result.success = true;
                    }
                }
                else
                {
                    result.code    = 304;
                    result.message = "条码不存在";
                    result.success = false;
                }

                PDALog.Write("撤消出货", "小标", code, PdaUser.PUserName + "-" + PdaUser.PRealName, string.Format("code:{0}", code), result.message);
            }
            catch (Exception ex)
            {
                result.code    = 500;
                result.message = "服务出错";
                result.success = false;
                DAL.Log.Instance.Write("撤消小标出货出错:" + ex.Message, "PDA上传出错");
            }

            return(result);
        }