Esempio n. 1
0
        public Int32 postTable()
        {
            try
            {
                Data.MstTable newTable = new Data.MstTable();
                newTable.TableCode    = "n/a";
                newTable.TableGroupId = TableGroupId();
                newTable.TopLocation  = 0;
                newTable.LeftLocation = 0;
                db.MstTables.InsertOnSubmit(newTable);
                db.SubmitChanges();

                return(newTable.Id);
            }
            catch (Exception e)
            {
                return(0);
            }
        }
Esempio n. 2
0
        public int Post(Models.MstTable table)
        {
            try
            {

                Data.MstTable newTable = new Data.MstTable();

                //
                newTable.TableCode = table.TableCode;
                newTable.TableGroupId = table.TableGroupId;
                newTable.TopLocation = table.TopLocation;
                newTable.LeftLocation = table.LeftLocation;
                //

                db.MstTables.InsertOnSubmit(newTable);
                db.SubmitChanges();

                return newTable.Id;
            }
            catch
            {
                return 0;
            }
        }