Exemplo n.º 1
0
        public override int?Save(string action)
        {
            var data = new ProductivityAreaFeatureDataModel();

            data.ProductivityAreaFeatureId = SystemKeyId;
            data.Name        = Name;
            data.Description = Description;
            data.SortOrder   = SortOrder;

            if (action == "Insert")
            {
                var dtProductivityAreaFeature = ProductivityAreaFeatureDataManager.DoesExist(data, SessionVariables.RequestProfile);

                if (dtProductivityAreaFeature.Rows.Count == 0)
                {
                    ProductivityAreaFeatureDataManager.Create(data, SessionVariables.RequestProfile);
                }
                else
                {
                    throw new Exception("Record with given ID already exists.");
                }
            }
            else
            {
                ProductivityAreaFeatureDataManager.Update(data, SessionVariables.RequestProfile);
            }

            return(data.ProductivityAreaFeatureId);
        }
Exemplo n.º 2
0
        private void UpdateData(ArrayList values)
        {
            var data = new ProductivityAreaFeatureDataModel();

            data.ProductivityAreaFeatureId = int.Parse(values[0].ToString());
            data.Name        = values[1].ToString();
            data.Description = values[2].ToString();
            data.SortOrder   = int.Parse(values[3].ToString());
            ProductivityAreaFeatureDataManager.Update(data, SessionVariables.RequestProfile);
            ReBindEditableGrid();
        }