Beispiel #1
0
        private long m_lngUpdatePropertyValue(clsUnitPropertyValue_VO p_objVO)
        {
            long   lngRes = 0;
            string strSQL = @"UPDATE t_aid_lis_unit_property_value SET
							PROPERTY_ID_CHR = ?,
							VLAUE_VCHR = ?,
							INUSE_FLAG_NUM = ?
							WHERE VLAUE_ID_CHR = ?"                            ;

            try
            {
                System.Data.IDataParameter[] objDPArr = null;

                com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new clsHRPTableService();
                objHRPSvc.CreateDatabaseParameter(4, out objDPArr);

                objDPArr[0].Value = p_objVO.m_strPROPERTY_ID_CHR;
                objDPArr[1].Value = p_objVO.m_strVLAUE_VCHR;
                objDPArr[2].Value = p_objVO.m_intINUSE_FLAG_NUM;
                objDPArr[3].Value = p_objVO.m_strVALUE_ID_CHR;

                long lngRecEff = -1;

                //往表t_opr_lis_application增加记录
                lngRes = objHRPSvc.lngExecuteParameterSQL(strSQL, ref lngRecEff, objDPArr);
            }
            catch (Exception objEx)
            {
                com.digitalwave.Utility.clsLogText objLogger = new clsLogText();
                bool blnRes = objLogger.LogError(objEx);
                throw objEx;
            }
            return(lngRes);
        }
Beispiel #2
0
        public long m_lngGetAllUnitPropertyAndDetail(System.Security.Principal.IPrincipal p_objPrincipal,
                                                     out clsUnitProperty_VO[] p_objPropertyArr,
                                                     out clsUnitPropertyValue_VO[] p_objValueArr)
        {
            long lngRes = 0;

            p_objPropertyArr = null;
            p_objValueArr    = null;

            string strSQL1 = @"SELECT * FROM t_aid_lis_unit_property ORDER BY inuse_flag_num DESC, property_priority_num ";
            string strSQL2 = @"SELECT * FROM t_aid_lis_unit_property_value";

            try
            {
                DataTable        dtbData          = new DataTable();
                clsVOConstructor objVOConstructor = new clsVOConstructor();
                com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new clsHRPTableService();
                lngRes = objHRPSvc.lngGetDataTableWithoutParameters(strSQL1, ref dtbData);
                if (lngRes > 0 && dtbData != null)
                {
                    p_objPropertyArr = new clsUnitProperty_VO[dtbData.Rows.Count];
                    for (int i = 0; i < dtbData.Rows.Count; i++)
                    {
                        p_objPropertyArr[i] = objVOConstructor.m_objConstructUnitPropertyVO(dtbData.Rows[i]);
                    }
                    lngRes  = 0;
                    dtbData = new DataTable();
                    lngRes  = objHRPSvc.lngGetDataTableWithoutParameters(strSQL2, ref dtbData);
                    if (lngRes > 0 && dtbData != null)
                    {
                        p_objValueArr = new clsUnitPropertyValue_VO[dtbData.Rows.Count];
                        for (int j = 0; j < dtbData.Rows.Count; j++)
                        {
                            p_objValueArr[j] = objVOConstructor.m_objConstructUnitPropertyValueVO(dtbData.Rows[j]);
                        }
                    }
                }
                if (lngRes <= 0)
                {
                    p_objPropertyArr = null;
                    p_objValueArr    = null;
                }
            }
            catch (Exception objEx)
            {
                com.digitalwave.Utility.clsLogText objLogger = new clsLogText();
                bool blnRes = objLogger.LogError(objEx);//要在LogError方法中抛出异常。
            }
            return(lngRes);
        }
Beispiel #3
0
        public clsUnitPropertyValue_VO m_objConstructUnitPropertyValueVO(System.Data.DataRow p_objRow)
        {
            clsUnitPropertyValue_VO objVO = new clsUnitPropertyValue_VO();

            try
            {
                objVO.m_intINUSE_FLAG_NUM  = int.Parse(p_objRow["INUSE_FLAG_NUM"].ToString());
                objVO.m_strVLAUE_VCHR      = p_objRow["VLAUE_VCHR"].ToString();
                objVO.m_strPROPERTY_ID_CHR = p_objRow["PROPERTY_ID_CHR"].ToString().Trim();
                objVO.m_strVALUE_ID_CHR    = p_objRow["VLAUE_ID_CHR"].ToString().Trim();
            }
            catch
            {
                objVO = null;
            }
            return(objVO);
        }
Beispiel #4
0
        private long m_lngAddPropertyValue(clsUnitPropertyValue_VO p_objVO)
        {
            long   lngRes = 0;
            string strSQL = @"INSERT INTO t_aid_lis_unit_property_value(PROPERTY_ID_CHR,
							VLAUE_ID_CHR,VLAUE_VCHR,INUSE_FLAG_NUM) 
							VALUES (?, ?, ?, ?)"                            ;

            try
            {
                System.Data.IDataParameter[] objDPArr = null;

                com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new clsHRPTableService();
                objHRPSvc.CreateDatabaseParameter(4, out objDPArr);

                string strNewID = null;
                objHRPSvc.m_lngGenerateNewID("t_aid_lis_unit_property_value", "VLAUE_ID_CHR", out strNewID);
                if (strNewID == null || strNewID == "")
                {
                    throw new Exception("不能分配ID");
                }
                p_objVO.m_strVALUE_ID_CHR = strNewID;



                objDPArr[0].Value = p_objVO.m_strPROPERTY_ID_CHR;
                objDPArr[1].Value = p_objVO.m_strVALUE_ID_CHR;
                objDPArr[2].Value = p_objVO.m_strVLAUE_VCHR;
                objDPArr[3].Value = p_objVO.m_intINUSE_FLAG_NUM;

                long lngRecEff = -1;

                lngRes = objHRPSvc.lngExecuteParameterSQL(strSQL, ref lngRecEff, objDPArr);
            }
            catch (Exception objEx)
            {
                com.digitalwave.Utility.clsLogText objLogger = new clsLogText();
                bool blnRes = objLogger.LogError(objEx);
                throw objEx;
            }
            return(lngRes);
        }
Beispiel #5
0
 private void m_btnAdd_Click(object sender, System.EventArgs e)
 {
     if (this.m_cboValue.SelectedItem != null)
     {
         clsUnitPropertyValue_VO objValueVO = (clsUnitPropertyValue_VO)this.m_cboValue.SelectedItem;
         bool isAdded = false;
         foreach (ListViewItem objLvi in this.m_lsvValue.Items)
         {
             if ((objLvi.Tag as clsUnitPropertyValue_VO) == objValueVO)
             {
                 isAdded = true;
                 break;
             }
         }
         if (!isAdded)
         {
             ListViewItem lvi = new ListViewItem();
             lvi.Text = objValueVO.m_strVLAUE_VCHR;
             lvi.Tag  = objValueVO;
             this.m_lsvValue.Items.Add(lvi);
         }
     }
 }