Beispiel #1
0
 /// <summary>
 /// get bill nubmer
 /// </summary>
 public static void LBN()
 {
     try
     {
         MySqlCommand cmd = new MySqlCommand(MySqlCommandType.SELECT).Select("bills").Order("ID", true);
         MySqlReader  r   = new MySqlReader(cmd);
         BillNO = r.Read() ? r.ReadUInt32("ID") : 0;
         r.Close();
     }
     catch (Exception ee)
     {
         Program.SaveException(ee);
     }
 }
Beispiel #2
0
        /// <summary>
        /// login check code
        /// </summary>
        public static bool UserLogin()
        {
            try
            {
                MySqlCommand cmd = new MySqlCommand(MySqlCommandType.SELECT);
                cmd.Select("accounts").Where("Username", UserName).And("Password", UserPassword);
                MySqlReader r = new MySqlReader(cmd);
                if (r.Read())
                {
                    State = (States.AccountState)r.ReadByte("State");
                    switch (State)
                    {
                    case States.AccountState.Manager:
                    {
                        Manager ma = new Manager();
                        ma.Show();
                        SaveLogin();
                        return(true);
                    }

                    case States.AccountState.Employee:
                    {
                        CPanal gui = new CPanal();
                        gui.Show();
                        SaveLogin();
                        return(true);
                    }

                    default:
                        MessageBox.Show("من انت؟ هل تعمل فى هذه الصيدليه؟");
                        return(false);
                    }
                }
                else
                {
                    MessageBox.Show("أسم المستخدم و/او كلمه المرور خطأ");
                    return(false);
                }
            }
            catch (Exception ll)
            {
                Program.SaveException(ll);
                return(false);
            }
        }
Beispiel #3
0
 /// <summary>
 /// load a bell for user
 /// </summary>
 private static void LoadBill()
 {
     try
     {
         MySqlCommand cmd =
             new MySqlCommand(MySqlCommandType.SELECT).Select("bills").Where("Name", Client).And("ID", BillNO);
         MySqlReader r = new MySqlReader(cmd);
         if (r.Read())
         {
             MList = r.ReadString("Medic");
         }
         r.Close();
     }
     catch (Exception ee)
     {
         Program.SaveException(ee);
     }
 }