Esempio n. 1
0
        private void LoadGroups(int id)
        {
            ArrayList al = DBLayer.ClientTypes.GetList();

            for (int i = 0; i < al.Count; i++)
            {
                DBLayer.ClientTypes.Details det = (DBLayer.ClientTypes.Details)al[i];

                Lib.ServiceFunctions.ListItem li = new FitnessProject.Lib.ServiceFunctions.ListItem();

                li.ID   = det.Id;
                li.Name = det.Name;

                cbClientType.Items.Add(li);
            }

            for (int i = 0; i < cbClientType.Items.Count; i++)
            {
                Lib.ServiceFunctions.ListItem li = (Lib.ServiceFunctions.ListItem)cbClientType.Items[i];

                if (li.ID == id)
                {
                    cbClientType.SelectedIndex = i;
                    break;
                }
            }
        }
        public FrmEditClientType(int id)
        {
            InitializeComponent();

            this.Id = id;

            this.Details = DBLayer.ClientTypes.GetDetails(id);

            tbName.Text = this.Details.Name;
        }
Esempio n. 3
0
        private void LoadData()
        {
            ArrayList al = DBLayer.ClientTypes.GetList();

            DataTable dt = new DataTable();

            dt.Columns.Add("Id", typeof(int));
            dt.Columns.Add("Name");

            for (int i = 0; i < al.Count; i++)
            {
                DBLayer.ClientTypes.Details det = (DBLayer.ClientTypes.Details)al[i];

                DataRow dr = dt.Rows.Add();

                dr["Id"]   = det.Id;
                dr["Name"] = det.Name;
            }

            grSources.DataSource = dt;
        }
Esempio n. 4
0
        public static ArrayList GetList()
        {
            DataTable dt = ZFort.DB.Execute.ExecuteString_DataTable("SELECT * FROM ClientTypes");

            ArrayList al = new ArrayList();

            foreach (DataRow dr in dt.Rows)
            {
                DBLayer.ClientTypes.Details det = new DBLayer.ClientTypes.Details();

                if (!dr.IsNull("Id"))
                {
                    det.Id = Convert.ToInt32(dr["Id"]);
                }

                det.Name = dr["Name"].ToString();

                al.Add(det);
            }

            return(al);
        }
Esempio n. 5
0
 public static void Update(DBLayer.ClientTypes.Details det)
 {
     ZFort.DB.Execute.ExecuteString_void("UPDATE ClientTypes SET [Name] = '" + det.Name + "' WHERE [Id] = " + det.Id.ToString());
 }
Esempio n. 6
0
        /*#region Check
         *
         * public static bool Check(string name, int id)
         * {
         *
         *  Database.Service serv = new Management.Database.Service();
         *
         *  return serv.AdvertisingSource_Check(name, id);
         * }
         *
         #endregion*/

        #region Insert

        public static void Insert(DBLayer.ClientTypes.Details det)
        {
            ZFort.DB.Execute.ExecuteString_void("INSERT INTO ClientTypes ([Name]) VALUES ('" + det.Name + "')");
        }