Exemple #1
0
        protected override void populateInputFields()
        {
            CounterAddress obj = new CounterAddress(selectedRowID());

            itxt_Name.ValueText            = obj.Name;
            itxt_IPAddress.ValueText       = obj.IPAddress;
            iddl_DefaultForms.SelectedItem = obj.DefaultForms_enum;
        }
Exemple #2
0
        public static void update(Guid Id, string name, string ipAddress, DefaultForms defaultForm)
        {
            CounterAddress objOld = new CounterAddress(Id);
            string         log    = "";

            log = Util.appendChange(log, objOld.Name, name, "Name: '{0}' to '{1}'");
            log = Util.appendChange(log, objOld.IPAddress, ipAddress, "IP Address: '{0}' to '{1}'");
            log = Util.appendChange(log, objOld.DefaultForms_description, Util.GetEnumDescription(defaultForm), "Default Form: '{0}' to '{1}'");

            if (!string.IsNullOrEmpty(log))
            {
                SqlQueryResult result = DBConnection.query(
                    false,
                    DBConnection.ActiveSqlConnection,
                    QueryTypes.ExecuteNonQuery,
                    "CounterAddresses_update",
                    new SqlQueryParameter(COL_DB_Id, SqlDbType.UniqueIdentifier, Id),
                    new SqlQueryParameter(COL_DB_Name, SqlDbType.NVarChar, Util.wrapNullable(name)),
                    new SqlQueryParameter(COL_DB_IPAddress, SqlDbType.NVarChar, Util.wrapNullable(ipAddress)),
                    new SqlQueryParameter(COL_DB_DefaultForms_enumid, SqlDbType.TinyInt, defaultForm)
                    );
            }
        }
Exemple #3
0
 protected override void add()
 {
     CounterAddress.add(itxt_Name.ValueText, itxt_IPAddress.ValueText, Util.parseEnum <DefaultForms>(iddl_DefaultForms.SelectedValue));
 }
Exemple #4
0
 protected override void update()
 {
     CounterAddress.update(selectedRowID(), itxt_Name.ValueText, itxt_IPAddress.ValueText, Util.parseEnum <DefaultForms>(iddl_DefaultForms.SelectedValue));
 }
Exemple #5
0
 protected override System.Data.DataView loadGridviewDataSource()
 {
     return(CounterAddress.get(null, itxt_Name.ValueText, itxt_IPAddress.ValueText).DefaultView);
 }
Exemple #6
0
        /*******************************************************************************************************/
        #region EVENT HANDLERS

        private void btnDelete_Click(object sender, EventArgs e)
        {
            CounterAddress.delete(selectedRowID());
            populateGridViewDataSource(true);
        }