示例#1
0
        ///<summary>
        /// Returns a single repetition of Privileges(PRA-7).
        /// throws HL7Exception if the repetition number is invalid.
        /// <param name="rep">The repetition number (this is a repeating field)</param>
        ///</summary>
        public PIP GetPrivileges(int rep)
        {
            PIP ret = null;

            try
            {
                IType t = this.GetField(7, rep);
                ret = (PIP)t;
            } catch (System.Exception ex) {
                HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected problem obtaining field value.  This is a bug.", ex);
                throw new System.Exception("An unexpected error ocurred", ex);
            }
            return(ret);
        }
示例#2
0
        /// <summary> Returns a single repetition of Privileges (PRA-7).</summary>
        /// <param name="rep">the repetition number (this is a repeating field)
        /// </param>
        /// <throws>  HL7Exception if the repetition number is invalid. </throws>
        public virtual PIP getPrivileges(int rep)
        {
            PIP ret = null;

            try
            {
                Type t = this.getField(7, rep);
                ret = (PIP)t;
            }
            catch (System.InvalidCastException)
            {
                throw new Exception();
            }
            return(ret);
        }
示例#3
0
        private void MoreDetails_Click(object sender, EventArgs e)
        {
            dataGridView2.Visible = true;
            if (dataGridView1.SelectedCells.Count > 0)
            {
                dataGridView2.Rows.Clear();
                dataGridView2.Refresh();
                int selectedrowindex = dataGridView1.SelectedCells[0].RowIndex;

                Purchase P = Program.seekPurchase(Convert.ToInt32(dataGridView1.Rows[selectedrowindex].Cells[0].Value));

                foreach (ProductInPurchases PIP in P.Products_In_Purchase)
                {
                    dataGridView2.Rows.Add(PIP.get_ProductID(), PIP.get_Product().get_productName(), PIP.get_Quantity(), PIP.get_Quantity() * PIP.get_Product().getSalePrice());
                }
            }
        }
示例#4
0
        static void Main(string[] args)
        {
            string posh;

            PIP[] arr = new PIP[]
            {
                new PIP("Богдан", "Стицун", "Андрійович"),
                new PIP("Вадим", "Лебедюк", "Федорович"),
                new PIP(true),
            };

            Console.WriteLine("Вся база:");
            foreach (PIP n in arr)
            {
                n.Info();
            }

            Console.Write("Кого знайти: ");
            posh = Console.ReadLine();

            int index = -1;

            for (int i = 0; i < arr.Count(); i++)
            {
                if (arr[i].sname == posh)
                {
                    index = i;
                }
            }

            if (index == -1)
            {
                Console.WriteLine($"Нічого не знайдено на {posh}");
            }

            else
            {
                Console.WriteLine($"Ось що знайдено на {posh}:");
                arr[index].Info();
            }


            Console.ReadLine();
        }
示例#5
0
 ///<summary>
 /// Returns all repetitions of Privileges (PRA-7).
 ///</summary>
 public PIP[] GetPrivileges()
 {
     PIP[] ret = null;
     try {
         IType[] t = this.GetField(7);
         ret = new PIP[t.Length];
         for (int i = 0; i < ret.Length; i++)
         {
             ret[i] = (PIP)t[i];
         }
     } catch (HL7Exception he) {
         HapiLogFactory.GetHapiLog(this.GetType()).Error("Unexpected problem obtaining field value.  This is a bug.", he);
         throw new System.Exception("An unexpected error ocurred", he);
     } catch (System.Exception cce) {
         HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected problem obtaining field value.  This is a bug.", cce);
         throw new System.Exception("An unexpected error ocurred", cce);
     }
     return(ret);
 }
示例#6
0
 /// <summary> Returns all repetitions of Privileges (PRA-7).</summary>
 public virtual PIP[] getPrivileges()
 {
     PIP[] ret = null;
     try
     {
         Type[] t = this.getField(7);
         ret = new PIP[t.Length];
         for (int i = 0; i < ret.Length; i++)
         {
             ret[i] = (PIP)t[i];
         }
     }
     catch (System.InvalidCastException)
     {
         throw new Exception();
     }
     catch (NuGenHL7Exception)
     {
         throw new Exception();
     }
     return(ret);
 }