Esempio n. 1
0
        /// <summary>
        /// 修改保险计划
        /// </summary>
        /// <param name="objResult"></param>
        /// <returns></returns>
        public long m_lngModifyINSPLAN(clsInsPlan_VO objResult)
        {
            com.digitalwave.iCare.middletier.HIS.clsOPChargeInsSvc objSvc =
                (com.digitalwave.iCare.middletier.HIS.clsOPChargeInsSvc)com.digitalwave.iCare.common.clsObjectGenerator.objCreatorObjectByType(typeof(com.digitalwave.iCare.middletier.HIS.clsOPChargeInsSvc));
            long lngRes = objSvc.m_lngModifyINSPLAN(objPrincipal, objResult);

            objSvc.Dispose();
            return(lngRes);
        }
Esempio n. 2
0
        public long m_lngGetINSPLANDataArr(System.Security.Principal.IPrincipal p_objPrincipal, out clsInsPlan_VO[] p_objResultArr)
        {
            p_objResultArr = new clsInsPlan_VO[0];
            long lngRes = 0;
            clsPrivilegeHandleService objPrivilege = new clsPrivilegeHandleService();

            lngRes = objPrivilege.m_lngCheckCallPrivilege(p_objPrincipal, "com.digitalwave.iCare.middletier.LIS.clsLisDeviceSvc", "m_lngGetINSPLANDataArr");
            if (lngRes < 0)
            {
                return(-1);
            }
            string strSQL = @"select p.planid_chr, p.planname_chr, p.remark_vchr, p.companyid_chr, p.usercode_chr,companyname_chr from t_aid_insplan p join t_aid_inscompany c on p.companyid_chr = c.companyid_chr order by planid_chr";

            try
            {
                DataTable dtbResult = new DataTable();
                com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new clsHRPTableService();
                lngRes = objHRPSvc.lngGetDataTableWithoutParameters(strSQL, ref dtbResult);
                objHRPSvc.Dispose();
                if (lngRes > 0 && dtbResult.Rows.Count > 0)
                {
                    p_objResultArr = new clsInsPlan_VO[dtbResult.Rows.Count];
                    for (int i1 = 0; i1 < p_objResultArr.Length; i1++)
                    {
                        p_objResultArr[i1] = new clsInsPlan_VO();
                        p_objResultArr[i1].m_strPLANID_CHR      = dtbResult.Rows[i1]["PLANID_CHR"].ToString().Trim();
                        p_objResultArr[i1].m_strPLANNAME_CHR    = dtbResult.Rows[i1]["PLANNAME_CHR"].ToString().Trim();
                        p_objResultArr[i1].m_strREMARK_VCHR     = dtbResult.Rows[i1]["REMARK_VCHR"].ToString().Trim();
                        p_objResultArr[i1].m_strCOMPANYID_CHR   = dtbResult.Rows[i1]["COMPANYID_CHR"].ToString().Trim();
                        p_objResultArr[i1].m_strUSERCODE_CHR    = dtbResult.Rows[i1]["USERCODE_CHR"].ToString().Trim();
                        p_objResultArr[i1].m_strCOMPANYNAME_CHR = dtbResult.Rows[i1]["COMPANYNAME_CHR"].ToString().Trim();
                    }
                }
            }
            catch (Exception objEx)
            {
                string strTmp = objEx.Message;
                com.digitalwave.Utility.clsLogText objLogger = new clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            return(lngRes);
        }
Esempio n. 3
0
        public long m_lngModifyINSPLAN(System.Security.Principal.IPrincipal p_objPrincipal, clsInsPlan_VO objResult)
        {
            long lngRes = 0;
            //权限类
            clsPrivilegeHandleService objPrivilege = new clsPrivilegeHandleService();

            //检查是否有使用些函数的权限
            lngRes = objPrivilege.m_lngCheckCallPrivilege(p_objPrincipal, "com.digitalwave.iCare.middletier.HIS.clsRegChargeTypeSvc", "m_lngModifyINSPLAN");

            if (lngRes < 0)            //没有使用的权限
            {
                return(-1);
            }
            string strSQL = "UPDate T_AID_INSPLAN Set  " +
                            "PLANNAME_CHR='" + objResult.m_strPLANNAME_CHR + "' " +
                            ", USERCODE_CHR='" + objResult.m_strUSERCODE_CHR + "' " +
                            ", REMARK_VCHR='" + objResult.m_strREMARK_VCHR + "' " +
                            ", COMPANYID_CHR='" + objResult.m_strCOMPANYID_CHR + "' " +
                            " Where PLANID_CHR='" + objResult.m_strPLANID_CHR + "' ";

            try
            {
                com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new clsHRPTableService();
                lngRes = objHRPSvc.DoExcute(strSQL);
                objHRPSvc.Dispose();
            }
            catch (Exception objEx)
            {
                com.digitalwave.Utility.clsLogText objLogger = new clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            return(lngRes);
        }
Esempio n. 4
0
        public long m_lngAddNewINSPLAN(System.Security.Principal.IPrincipal p_objPrincipal, clsInsPlan_VO p_objRecord, out string p_strRecordID)
        {
            long lngRes = 0;

            p_strRecordID = "";
            //权限类
            clsPrivilegeHandleService objPrivilege = new clsPrivilegeHandleService();

            //检查是否有使用些函数的权限
            lngRes = objPrivilege.m_lngCheckCallPrivilege(p_objPrincipal, "com.digitalwave.iCare.middletier.HIS.clsRegChargeTypeSvc", "m_lngAddNewINSPLAN");
            if (lngRes < 0)           //没有使用的权限
            {
                return(-1);
            }

            com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new clsHRPTableService();
            //返回一最大的计划号
            lngRes = objHRPSvc.lngGenerateID(4, "PLANID_CHR", "T_AID_INSPLAN", out p_strRecordID);
            if (lngRes < 0)
            {
                return(lngRes);
            }

            string strSQL = "INSERT INTO T_AID_INSPLAN (PLANID_CHR,PLANNAME_CHR,USERCODE_CHR,REMARK_VCHR,COMPANYID_CHR) VALUES ('" + p_strRecordID + "','" + p_objRecord.m_strPLANNAME_CHR + "','" + p_objRecord.m_strUSERCODE_CHR + "','" + p_objRecord.m_strREMARK_VCHR + "','" + p_objRecord.m_strCOMPANYID_CHR + "')";

            try
            {
                lngRes = objHRPSvc.DoExcute(strSQL);
                objHRPSvc.Dispose();
            }
            catch (Exception objEx)
            {
                string strTmp = objEx.Message;
                com.digitalwave.Utility.clsLogText objLogger = new clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            return(lngRes);
        }
Esempio n. 5
0
        /// <summary>
        /// 保存保险计划
        /// </summary>
        public void m_mthSaveINSPLAN()
        {
            if (m_objViewer.m_txtPLANNAME_CHR_INSPLAN.Text.Trim() == "")
            {
                m_ephHandler.m_mthAddControl(m_objViewer.m_txtPLANNAME_CHR_INSPLAN);
                m_ephHandler.m_mthShowControlsErrorProvider();
                m_ephHandler.m_mthClearControl();
                m_objViewer.m_txtPLANNAME_CHR_INSPLAN.Focus();
                m_objViewer.m_txtPLANNAME_CHR_INSPLAN.SelectAll();
                return;
            }

            if (m_objViewer.m_txtUSERCODE_CHR_INSPLAN.Text.Trim() == "")
            {
                m_ephHandler.m_mthAddControl(m_objViewer.m_txtUSERCODE_CHR_INSPLAN);
                m_ephHandler.m_mthShowControlsErrorProvider();
                m_ephHandler.m_mthClearControl();
                m_objViewer.m_txtUSERCODE_CHR_INSPLAN.Focus();
                m_objViewer.m_txtUSERCODE_CHR_INSPLAN.SelectAll();
                return;
            }
            if (m_objViewer.m_txtREMARK_VCHR_INSPLAN.Text.Trim() == "")
            {
                m_ephHandler.m_mthAddControl(m_objViewer.m_txtREMARK_VCHR_INSPLAN);
                m_ephHandler.m_mthShowControlsErrorProvider();
                m_ephHandler.m_mthClearControl();
                m_objViewer.m_txtREMARK_VCHR_INSPLAN.Focus();
                m_objViewer.m_txtREMARK_VCHR_INSPLAN.SelectAll();
                return;
            }
            if (m_objViewer.m_cboCOMPANYID_CHR.Text == "" || m_objViewer.m_cboCOMPANYID_CHR.Text == null)
            {
                MessageBox.Show("请选择保险公司!", "提示");
                m_objViewer.m_cboCOMPANYID_CHR.Focus();
                return;
            }
            long          lngRes    = 0;
            string        strID     = "";
            clsInsPlan_VO objResult = new clsInsPlan_VO();

            objResult.m_strPLANNAME_CHR    = m_objViewer.m_txtPLANNAME_CHR_INSPLAN.Text.Trim();
            objResult.m_strUSERCODE_CHR    = m_objViewer.m_txtUSERCODE_CHR_INSPLAN.Text.Trim();
            objResult.m_strREMARK_VCHR     = m_objViewer.m_txtREMARK_VCHR_INSPLAN.Text.Trim();
            objResult.m_strCOMPANYNAME_CHR = m_objViewer.m_cboCOMPANYID_CHR.Text.Trim();
            objResult.m_strCOMPANYID_CHR   = m_objViewer.m_lsvINSCOMPANY.Items[m_objViewer.m_cboCOMPANYID_CHR.SelectedIndex].SubItems[1].Text.Trim();

            if (m_objViewer.m_txtPLANNAME_CHR_INSPLAN.Tag == null)          //新增
            {
                for (int i = 0; i < m_objViewer.m_lsvINSPLAN.Items.Count; i++)
                {
                    if (m_objViewer.m_lsvINSPLAN.Items[i].SubItems[2].Text.Trim() == m_objViewer.m_txtUSERCODE_CHR_INSPLAN.Text.Trim())
                    {
                        MessageBox.Show("该助记码已存在!", "提示");
                        m_ephHandler.m_mthAddControl(m_objViewer.m_txtUSERCODE_CHR_INSPLAN);
                        m_ephHandler.m_mthShowControlsErrorProvider();
                        m_ephHandler.m_mthClearControl();

                        m_objViewer.m_txtUSERCODE_CHR_INSPLAN.Focus();
                        m_objViewer.m_txtUSERCODE_CHR_INSPLAN.SelectAll();

                        return;
                    }
                }

                lngRes = clsDomain.m_lngAddNewINSPLAN(objResult, out strID);
                int index = m_objViewer.m_lsvINSPLAN.Items.Count;
                if (lngRes > 0)
                {
                    ListViewItem lvw = new ListViewItem();
                    lvw.SubItems.Add(strID);
                    lvw.SubItems.Add(objResult.m_strUSERCODE_CHR);
                    lvw.SubItems.Add(objResult.m_strPLANNAME_CHR);
                    lvw.SubItems.Add(objResult.m_strREMARK_VCHR);
                    lvw.SubItems.Add(objResult.m_strCOMPANYID_CHR);
                    lvw.SubItems.Add(objResult.m_strCOMPANYNAME_CHR);
                    lvw.Tag = strID;
                    m_objViewer.m_lsvINSPLAN.Items.Add(lvw);

                    m_objViewer.m_lsvINSPLAN.Items[index].Selected = true;
                }
                else
                {
                    MessageBox.Show("保存失败!", "提示");
                }
            }
            else
            {
                if (m_objViewer.m_lsvINSPLAN.SelectedItems.Count <= 0)
                {
                    return;
                }
                for (int i = 0; i < m_objViewer.m_lsvINSPLAN.Items.Count; i++)
                {
                    if (i == m_objViewer.m_lsvINSPLAN.SelectedItems[0].Index)
                    {
                        continue;
                    }
                    if (m_objViewer.m_lsvINSPLAN.Items[i].SubItems[2].Text.Trim() == m_objViewer.m_txtUSERCODE_CHR_INSPLAN.Text.Trim())
                    {
                        MessageBox.Show("该助记码已存在!", "提示");
                        m_ephHandler.m_mthAddControl(m_objViewer.m_txtUSERCODE_CHR_INSPLAN);
                        m_ephHandler.m_mthShowControlsErrorProvider();
                        m_ephHandler.m_mthClearControl();
                        m_objViewer.m_txtUSERCODE_CHR_INSPLAN.Focus();
                        m_objViewer.m_txtUSERCODE_CHR_INSPLAN.SelectAll();

                        return;
                    }
                }

                objResult.m_strPLANID_CHR = m_objViewer.m_lsvINSPLAN.SelectedItems[0].SubItems[1].Text.Trim();
                lngRes = clsDomain.m_lngModifyINSPLAN(objResult);

                if (lngRes > 0)
                {
                    MessageBox.Show("修改成功!", "提示");
                    m_objViewer.m_lsvINSPLAN.SelectedItems[0].SubItems[2].Text = objResult.m_strUSERCODE_CHR;
                    m_objViewer.m_lsvINSPLAN.SelectedItems[0].SubItems[3].Text = objResult.m_strPLANNAME_CHR;
                    m_objViewer.m_lsvINSPLAN.SelectedItems[0].SubItems[4].Text = objResult.m_strREMARK_VCHR;
                    m_objViewer.m_lsvINSPLAN.SelectedItems[0].SubItems[5].Text = objResult.m_strCOMPANYID_CHR;
                    m_objViewer.m_lsvINSPLAN.SelectedItems[0].SubItems[6].Text = objResult.m_strCOMPANYNAME_CHR;
                }
                else
                {
                    MessageBox.Show("修改失败!", "提示");
                }
            }

            m_objViewer.m_txtPLANNAME_CHR_INSPLAN.Text = "";
            m_objViewer.m_txtUSERCODE_CHR_INSPLAN.Text = "";
            m_objViewer.m_txtREMARK_VCHR_INSPLAN.Text  = "";
            m_objViewer.m_txtPLANNAME_CHR_INSPLAN.Tag  = null;
            m_objViewer.m_txtPLANNAME_CHR_INSPLAN.Focus();
        }