HBM.GeneralManagement.Source.Save C# (CSharp) Method

Save() public method

public Save ( DataSet ds ) : bool
ds System.Data.DataSet
return bool
        public bool Save(DataSet ds)
        {
            bool result = false;
            try
            {

                result = (new SourceDAO()).InsertUpdateDelete(ds);

            }
            catch (System.Exception ex)
            {
                result = false;
                throw ex;
            }
            return result;
        }

Usage Example

        protected void gvSource_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
        {
            int i = gvSource.FindVisibleIndexByKeyValue(e.Keys[gvSource.KeyFieldName]);

            e.Cancel = true;
            dsData   = Session[Constants.SESSION_SOURCE] as DataSet;
            //dsData.Tables[0].Rows.Remove(dsData.Tables[0].Rows.Find(e.Keys[gvData.KeyFieldName]));

            dsData.Tables[0].DefaultView.Delete(dsData.Tables[0].Rows.IndexOf(dsData.Tables[0].Rows.Find(e.Keys[gvSource.KeyFieldName])));


            if (source.Save(dsData))
            {
                this.LoadSource();
            }
        }