Beispiel #1
0
        private void btnSupprimer_Click(object sender, EventArgs e)
        {
            if (gridClient.SelectedRows.Count == 0)
            {
                MessageBox.Show("Selectionner la ligne entiere." + "\n" + "Cliquer sur le curseur à gauche du datagid", "Erreur de selection", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (MessageBox.Show("Voulez vous supprimer ce client?", "Confirmation de la suppression", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
            {
                bl = new BALClient();
                bc = new BALCommande();

                bc.deleteCommande(gridClient.SelectedRows[0].Cells[0].Value.ToString());
                bl.deleteClient(gridClient.SelectedRows[0].Cells[0].Value.ToString());

                remplirDatagrdview();
            }
        }
Beispiel #2
0
 public static DAL.ClientDetails ViewClient(String ClientID)
 {
     try
     {
     Icontext objinter = new BALClient();
     DAL.ClientDetails Client = (DAL.ClientDetails)objinter.ViewRecord(Convert.ToInt64(ClientID));
     return Client;
     }
     catch (Exception ex)
     {
     throw;
     }
 }
Beispiel #3
0
 public static Boolean UpdateUserInClient(UserInClientClass map)
 {
     Boolean flag = false;
     try
     {
     IMapping objtext = new BALClient();
     flag = objtext.UpdateMapping(map);
     }
     catch (Exception ex)
     {
     throw;
     }
     return flag;
 }
Beispiel #4
0
 public static bool UpdateClient(Client client)
 {
     Boolean flag = false;
     try
     {
     Icontext objinter = new BALClient();
     flag = objinter.UpdateRecord(client);
     }
     catch (Exception ex)
     {
     throw;
     }
     return flag;
 }
Beispiel #5
0
 public static List<SelectListItem> SearchFieldDDList()
 {
     ISearchField sobj = new BALClient();
     List<SelectListItem> lstsearchField = sobj.SearchField();
     return lstsearchField;
 }
Beispiel #6
0
 public static UserInClientList EditUserInclient(String mapinID)
 {
     UserInClientList mapp = new UserInClientList();
     try
     {
     IMapping objtext = new BALClient();
     mapp = (UserInClientList)objtext.EditMapping(Convert.ToInt64(mapinID));
     }
     catch (Exception ex)
     {
     throw;
     }
     return mapp;
 }
Beispiel #7
0
 public static Client EditClient(String clientID)
 {
     try
     {
         Icontext objinter = new BALClient();
         Client client = (Client)objinter.EditRecord(Convert.ToInt64(clientID));
         return client;
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Beispiel #8
0
        public static Boolean CreateClient(Client client)
        {
            Boolean flag = false;
            try
            {
                Icontext objtext = new BALClient();
                flag = objtext.CreateRecord(client);
            }
            catch (Exception ex)
            {
                throw;
            }

            return flag;
        }
Beispiel #9
0
 public static IEnumerable<DAL.ClientList> ClientList(String Field, String value)
 {
     try
     {
         ISearchResult objtext = new BALClient();
         IEnumerable<DAL.ClientList> listRecord = (IEnumerable<DAL.ClientList>)objtext.SearchResultList(Field, value);
         return listRecord;
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Beispiel #10
0
 public static IEnumerable<DAL.ClientList> ClientList()
 {
     try
     {
         Icontext objtext = new BALClient();
         IEnumerable<DAL.ClientList> listRecord = (IEnumerable<DAL.ClientList>)objtext.RecordList();
         return listRecord;
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Beispiel #11
0
        public static String AddClient(Client client)
        {
            String user_id = String.Empty;
            try
            {
                IRecordSave objtext = new BALClient();
                user_id = objtext.AddRecord(client);
            }
            catch (Exception ex)
            {
                throw;
            }

            return user_id;
        }
Beispiel #12
0
        public static void rechercheCmd(DataGridView dgv, TextBox[] infos, DateTimePicker[] dates)
        {
            dgv.Rows.Clear();
            OleDbConnection cn = new OleDbConnection();

            cn = Global.seConnecter(Global.cs);
            try
            {
                string sql = "numcmd like '%" + infos[0].Text + "%' and numclient = " + BALClient.getIDByNom(infos[1].Text);
                //+ " and datecmd between '" + dates[0].Value.ToString() +"' and '" + dates[0].Value.ToString()+"'"
                OleDbDataReader reader = Global.ExecuterOleDBSelect(@"select * from commande where " + sql, cn);
                while (reader.Read())
                {
                    dgv.Rows.Add(reader.GetValue(0), reader.GetValue(1), getClientById(reader.GetValue(2).ToString()), reader.GetValue(2));
                }
                reader.Close();
            }
            catch (Exception)
            {
            }
            Global.seDeconnecter(cn);
        }