예제 #1
0
파일: Check_Func.cs 프로젝트: xcxlTeam/xcxl
 public bool GetCheckByID(ref CheckInfo model, UserInfo user, ref string strError)
 {
     try
     {
         CheckDetails_Func cdf = new CheckDetails_Func();
         using (SqlDataReader dr = _db.GetCheckByID(model))
         {
             if (dr.Read())
             {
                 model = (GetModelFromDataReader(dr));
                 //model.lstDetails = cdf.GetCheckDetailsListByCheckID(model.ID, ref strError);
                 if (!string.IsNullOrEmpty(strError))
                 {
                     return(false);
                 }
                 return(true);
             }
             else
             {
                 strError = "找不到任何数据";
                 return(false);
             }
         }
     }
     catch (Exception ex)
     {
         strError = ex.Message;
         return(false);
     }
     finally
     {
     }
 }
예제 #2
0
파일: Check_Func.cs 프로젝트: xcxlTeam/xcxl
        public string GetCheckListForAndroid(string strUserJson)
        {
            List <CheckInfo> lstModel = new List <CheckInfo>();
            CheckHeader      model    = new CheckHeader();
            string           strError = string.Empty;


            try
            {
                UserInfo user = JSONHelper.JsonToObject <UserInfo>(strUserJson);
                if (user == null || string.IsNullOrEmpty(user.UserNo))
                {
                    model.Status  = "E";
                    model.Message = "传入用户错误!盘点单列表获取失败!";
                    return(JSONHelper.ObjectToJson(model));
                }

                CheckInfo info = new CheckInfo()
                {
                    CheckStatus = 10, DutyUser = user.UserNo
                };
                DividPage page = new DividPage()
                {
                    CurrentPageShowCounts = -1
                };
                bool bResult = GetCheckListByPage(ref lstModel, info, ref page, user, ref strError);

                if (bResult)
                {
                    CheckDetails_Func cdf = new CheckDetails_Func();
                    foreach (var item in lstModel)
                    {
                        item.lstDetails = cdf.GetCheckMaterialListByCheckID(item.ID, ref strError);
                    }
                    model.Status   = "S";
                    model.lstCheck = lstModel;
                    return(JSONHelper.ObjectToJson(model));
                }
                else
                {
                    model.Status  = "E";
                    model.Message = strError;
                    return(JSONHelper.ObjectToJson(model));
                }
            }
            catch (Exception ex)
            {
                model.Status  = "E";
                model.Message = "Web异常:" + ex.Message + ex.StackTrace;
                //if (Common_Func.IsOracleError(model.Message, ref strError)) model.Message = strError;
                return(JSONHelper.ObjectToJson(model));
            }
        }