Пример #1
0
        /// <summary>
        ///   Retrieves an existing  object from the data store.
        /// </summary>
        /// <param name = "key">Parameter identifier.</param>
        public ParameterInfo GetParameter(ParameterInfo.UniqueKey key)
        {
            ParameterInfo objParam;

            using (var objReader = DataProvider.Instance().ExecuteReader("Xml_Parameter_Get", key.Id))
            {
                objParam = objReader.Read() ? FillParameterInfo(objReader) : new ParameterInfo();
            }
            return(objParam);
        }
Пример #2
0
        protected void GrdParams_DeleteCommand(object source, DataGridCommandEventArgs e)
        {
            try
            {
                // init vars
                var objController = new ParameterController(Purpose);
                var objParamKey   = new ParameterInfo.UniqueKey
                {
                    Id = Convert.ToInt32(grdParams.DataKeys[e.Item.ItemIndex])
                };

                // delete parameter
                objController.DeleteParameter(objParamKey);

                // reset edit row
                grdParams.EditItemIndex = -1;
                BindParameters();
                //Module failed to load
            }
            catch (Exception exc)
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
Пример #3
0
 /// <summary>
 ///   Removes an existing  object from the data store.
 /// </summary>
 /// <param name = "key">Parameter identifier.</param>
 public void DeleteParameter(ParameterInfo.UniqueKey key)
 {
     DataProvider.Instance().ExecuteNonQuery("Xml_Parameter_Delete", key.Id);
 }
Пример #4
0
        protected void GrdParams_DeleteCommand(object source, DataGridCommandEventArgs e)
        {
            try
            {
                // init vars
                var objController = new ParameterController(Purpose);
                var objParamKey = new ParameterInfo.UniqueKey
                                      {
                                          Id = Convert.ToInt32(grdParams.DataKeys[e.Item.ItemIndex])
                                      };

                // delete parameter
                objController.DeleteParameter(objParamKey);

                // reset edit row
                grdParams.EditItemIndex = -1;
                BindParameters();
                //Module failed to load
            }
            catch (Exception exc)
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }