Ejemplo n.º 1
0
        /// <summary>
        /// 发送申请单
        /// </summary>
        /// <param name="p_strMessage">消息</param>
        /// <param name="objApp"></param>
        /// <returns>是/否成功</returns>
        private bool m_blnSendApp(out string message, clsLIS_App objApp)
        {
            message = "";
            if (objApp.m_StrAppID == null || objApp.m_StrAppID == "")
            {
                message = "请先保存申请!";
                return(false);
            }

            objApp.m_IntPStatus = 2;

            long lngRes = clsApplicationSmp.s_obj.m_lngAddNewApplication(objApp.m_ObjDataVO);

            if (lngRes > 0)
            {
                objApp.m_mthAcceptChanges();
                return(true);
            }

            objApp.m_IntPStatus    = 1;
            objApp.m_StrOperatorID = objApp.m_ObjOriginalDataVO.m_strOperator_ID;
            message = "操作失败!";
            return(false);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 保存申请单
        /// </summary>
        /// <param name="p_strMessage">消息</param>
        /// <param name="objApp"></param>
        /// <returns></returns>
        private bool m_blnSaveApp(out string errorMessage, clsLIS_App objApp)
        {
            errorMessage = string.Empty;

            #region 构造保存参数

            ArrayList arlRep      = new ArrayList();
            ArrayList arlSam      = new ArrayList();
            ArrayList arlItem     = new ArrayList();
            ArrayList arlUnit     = new ArrayList();
            ArrayList arlUnitItem = new ArrayList();

            foreach (clsLIS_AppCheckReport objRep in objApp.m_ObjAppReports)
            {
                arlRep.Add(objRep.m_ObjDataVO);
                foreach (clsLIS_AppSampleGroup objSam in objRep.m_ObjAppSampleGroups)
                {
                    arlSam.Add(objSam.m_ObjDataVO);
                    foreach (clsLIS_AppCheckItem objItem in objSam.m_ObjAppCheckItems)
                    {
                        arlItem.Add(objItem.m_ObjDataVO);
                    }
                }
            }

            foreach (clsLIS_AppApplyUnit objUnit in objApp.m_ObjAppApplyUnits)
            {
                arlUnit.Add(objUnit.m_ObjDataVO);
                arlUnitItem.AddRange(objUnit.m_ObjItemArr);
            }

            clsT_OPR_LIS_APP_REPORT_VO[]     objRepArr      = (clsT_OPR_LIS_APP_REPORT_VO[])arlRep.ToArray(typeof(clsT_OPR_LIS_APP_REPORT_VO));
            clsT_OPR_LIS_APP_SAMPLE_VO[]     objSamArr      = (clsT_OPR_LIS_APP_SAMPLE_VO[])arlSam.ToArray(typeof(clsT_OPR_LIS_APP_SAMPLE_VO));
            clsT_OPR_LIS_APP_CHECK_ITEM_VO[] objItemArr     = (clsT_OPR_LIS_APP_CHECK_ITEM_VO[])arlItem.ToArray(typeof(clsT_OPR_LIS_APP_CHECK_ITEM_VO));
            clsT_OPR_LIS_APP_APPLY_UNIT_VO[] objUnitArr     = (clsT_OPR_LIS_APP_APPLY_UNIT_VO[])arlUnit.ToArray(typeof(clsT_OPR_LIS_APP_APPLY_UNIT_VO));
            clsLisAppUnitItemVO[]            objUnitItemArr = (clsLisAppUnitItemVO[])arlUnitItem.ToArray(typeof(clsLisAppUnitItemVO));

            #endregion

            if (objApp.m_StrAppID == null)
            {
                long lngRes = 0;

                //4002开关:是否跳过样本的采集和核收
                int intConfig = clsLisSetting.IsSkipCollectionReceive();
                switch (intConfig)
                {
                case 1:
                    objApp.m_ObjDataVO.m_intPStatus_int = 2;
                    lngRes = 0;
                    lngRes = clsApplicationBizSmp.s_obj.m_lngAddApplicationInfo(objApp.m_ObjDataVO, objRepArr, objSamArr, objItemArr, objUnitArr, objUnitItemArr);
                    break;

                case 2:       //跳过采集不跳过核收
                    lngRes = 0;
                    objApp.m_ObjDataVO.m_intPStatus_int = 2;
                    lngRes = clsApplicationBizSmp.s_obj.m_lngAddNewAppInfo(objApp.m_ObjDataVO, objRepArr, objSamArr, objItemArr, objUnitArr, objUnitItemArr);
                    break;

                default:
                    lngRes = 0;
                    lngRes = clsApplicationBizSmp.s_obj.m_lngAddNewAppInfo(objApp.m_ObjDataVO, objRepArr, objSamArr, objItemArr, objUnitArr, objUnitItemArr);
                    new com.digitalwave.Utility.clsLogText().LogError(errorMessage);
                    break;
                }

                if (lngRes > 0)
                {
                    objApp.m_mthAcceptChanges();
                    return(true);
                }
            }
            else if (objApp.m_ObjAppApplyUnits.Count > 0)
            {
                long lngRes = clsApplicationBizSmp.s_obj.m_lngModifyAppInfo(objApp.m_ObjDataVO, objRepArr, objSamArr, objItemArr, objUnitArr, objUnitItemArr);
                if (lngRes > 0)
                {
                    objApp.m_mthAcceptChanges();
                    return(true);
                }
            }
            else
            {
                long lngRes = clsApplicationSmp.s_obj.m_lngAddNewApplication(objApp.m_ObjDataVO);
                if (lngRes > 0)
                {
                    objApp.m_mthAcceptChanges();
                    return(true);
                }
            }

            errorMessage = "操作失败!";
            return(false);
        }