示例#1
0
        public clsEquipmentTypeInfo[] m_clsGetXMLTable(ref int returnrows)
        {
            string strRecievedXML = "";
            long   lngSucc        = 0;

            clsEquipmentTypeInfo[] EquipmentTypeInfo = null;

            com.digitalwave.EquipmentTypeService.clsEquipmentTypeService objETServ =
                (com.digitalwave.EquipmentTypeService.clsEquipmentTypeService)com.digitalwave.iCare.common.clsObjectGenerator.objCreatorObjectByType(typeof(com.digitalwave.EquipmentTypeService.clsEquipmentTypeService));

            try
            {
                lngSucc = objETServ.m_lngGetXMLTable(clsLoginContext.s_ObjLoginContext.m_ObjPrincial, ref strRecievedXML, ref returnrows);
                if (returnrows > 0)
                {
                    EquipmentTypeInfo = new clsEquipmentTypeInfo[returnrows];
                    System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
                    doc.LoadXml(strRecievedXML);
                    XmlNode root = doc.DocumentElement;

                    for (int i = 0; i < root.ChildNodes.Count; i++)
                    {
                        EquipmentTypeInfo[i] = new clsEquipmentTypeInfo();
                        EquipmentTypeInfo[i].strEquipmentTypeID   = root.ChildNodes[i].Attributes["EQUIPMENTTYPEID"].Value;
                        EquipmentTypeInfo[i].strEquipmentTypeName = root.ChildNodes[i].Attributes["EQUIPMENTTYPENAME"].Value;
                        EquipmentTypeInfo[i].strPYCode            = root.ChildNodes[i].Attributes["PYCODE"].Value;
                    }
                }
            }
            finally
            {
                //objETServ.Dispose();
            }
            return(EquipmentTypeInfo);
        }
示例#2
0
        public long m_lngModifyRecord(clsEquipmentTypeInfo obj)
        {
            long lngRes = 0;

            com.digitalwave.EquipmentTypeService.clsEquipmentTypeService objETServ =
                (com.digitalwave.EquipmentTypeService.clsEquipmentTypeService)com.digitalwave.iCare.common.clsObjectGenerator.objCreatorObjectByType(typeof(com.digitalwave.EquipmentTypeService.clsEquipmentTypeService));

            try
            {
                string strXML = "";

                strXML = "<Patient EquipmentTypeID ='" + obj.strEquipmentTypeID + "' "
                         + "Status='" + obj.strStatus + "' "
                         + "EquipmentTypeName='" + obj.strEquipmentTypeName + "' "
                         + "PYCode='" + obj.strPYCode + "' "
                         + "OperatorID='" + obj.strOperatorID + "' "
                         + "DeActivedDate='" + obj.strDeActivedDate + "' />";

                lngRes = objETServ.m_lngModifyRecord(clsLoginContext.s_ObjLoginContext.m_ObjPrincial, strXML, obj.strEquipmentTypeID);
            }
            finally
            {
                //objETServ.Dispose();
            }
            return(lngRes);
        }
示例#3
0
        private void Add_To_ListView(clsEquipmentTypeInfo objEtinfo)
        {
            clsEquipmentTypeInfo objETInfo1 = new clsEquipmentTypeInfo();

            try
            {
                ListViewItem tempItem;
                tempItem     = new ListViewItem(new string[] { objETInfo1.strEquipmentTypeID, this.txtEquimentName.Text });
                tempItem.Tag = (clsEquipmentTypeInfo)objETInfo1;
                lsvEquipmentType.Items.Add(tempItem);
            }
            catch {}
        }
示例#4
0
        private void cmdAdd_Click(object sender, System.EventArgs e)
        {
            clsEquipmentTypeInfo objETInfo = new clsEquipmentTypeInfo();

            try
            {
                if (this.txtEquimentName.Text == "" && this.lblEquipmentTypeIDText.Text == "")
                {
                    MessageBox.Show("对不起,该设备编号或设备名称不在右列!");
                }
                else
                {
                    objETInfo.strEquipmentTypeID   = ((int.Parse(objDomain.m_strGetRecordCount())) + 1).ToString().PadLeft(3, '0');
                    objETInfo.strEquipmentTypeName = this.txtEquimentName.Text;
                    objETInfo.strBegin_Type_Date   = System.DateTime.Now.ToString("yyyy-M-dd");
                    objETInfo.strPYCode            = this.txtPYCode.Text;
                    objETInfo.strStatus            = "0";
                    objETInfo.strDeActivedDate     = null;
                    objETInfo.strOperatorID        = MDIParent.strOperatorID;
//					bool exist = objETServ.m_lngRecordExist(this.lblEquipmentTypeIDText.Text);
                    if (this.lblEquipmentTypeIDText.Text != "")
                    {
//						objETInfo.strEquipmentTypeID = this.lblEquipmentTypeIDText.Text;
//						objETInfo.strEquipmentTypeName = this.txtEquimentName.Text ;
//						objETInfo.strStatus = "0";
//						objETInfo.strPYCode = this.txtPYCode.Text ;
//						objETInfo.strDeActivedDate = System.DateTime.Now.ToString("yyyy-M-dd");
//						objETInfo.strOperatorID = MDIParent.strOperatorID ;

                        long lngSuccess = objDomain.m_lngModifyRecord(objETInfo);
                        if (lngSuccess == 1)
                        {
                            RefreshData("Modify", objETInfo);
                        }
                    }
                    else
                    {
                        this.lblEquipmentTypeIDText.Text = objETInfo.strEquipmentTypeID;
                        long lngSucc = objDomain.m_lngAddNewRecord(objETInfo);
                        if (lngSucc == 1)
                        {
                            RefreshData("Add", objETInfo);
                        }
                    }
                }
            }
            catch
            {
            }
        }
示例#5
0
        private void cmdDel_Click(object sender, System.EventArgs e)
        {
            clsEquipmentTypeInfo objETInfo2 = new clsEquipmentTypeInfo();

            try
            {
                objETInfo2.strEquipmentTypeID   = this.lblEquipmentTypeIDText.Text;
                objETInfo2.strEquipmentTypeName = this.txtEquimentName.Text;
                objETInfo2.strStatus            = "1";
                objETInfo2.strDeActivedDate     = System.DateTime.Now.ToString("yyyy-M-dd");
                objETInfo2.strOperatorID        = MDIParent.strOperatorID;
                long lngSuccess = objDomain.m_lngModifyRecord(objETInfo2);
                if (lngSuccess == 1)
                {
                    RefreshData("Del", objETInfo2);
                    this.cmdAdd.Text = "添加";
                }
            }
            catch {}
        }
示例#6
0
        private void RefreshData(string flag, clsEquipmentTypeInfo objEtinfo)
        {
            clsEquipmentTypeInfo aa = new clsEquipmentTypeInfo();

            try
            {
                if (flag == "Del")
                {
                    for (int i = 0; i < lsvEquipmentType.Items.Count; i++)
                    {
                        if (lsvEquipmentType.Items[i].SubItems[0].Text == this.lblEquipmentTypeIDText.Text)
                        {
                            lsvEquipmentType.Items[i].Remove();
                            CleanUp();
                            break;
                        }
                    }
                }
                else if (flag == "Add")
                {
                    Add_To_ListView(objEtinfo);
                    CleanUp();
                }
                else if (flag == "Modify")
                {
                    for (int j = 0; j < lsvEquipmentType.Items.Count; j++)
                    {
                        if (lsvEquipmentType.Items[j].SubItems[0].Text == this.lblEquipmentTypeIDText.Text)
                        {
                            lsvEquipmentType.Items[j].SubItems[1].Text = this.txtEquimentName.Text;
                            lsvEquipmentType.Items[j].Tag = (clsEquipmentTypeInfo)objEtinfo;
                            CleanUp();
                            break;
                        }
                    }
                }
            }
            catch {}
        }