Exemplo n.º 1
0
        public int InsertCompanyTable(companyTable comp)
        {
            iwaywardDataContext db = new iwaywardDataContext();

            try
            {
                db.companyTable.InsertOnSubmit(comp);
                db.SubmitChanges();
                return(int.Parse(comp.companyID.ToString()));
            }
            catch
            {
                return(0);
            }
        }
Exemplo n.º 2
0
        public int UpdateCompanyTableByComId(companyTable post)
        {
            iwaywardDataContext db = new iwaywardDataContext();

            try
            {
                var result = (from item in db.companyTable where item.companyID == post.companyID select item).Single();
                result.companyID    = post.companyID;
                result.userID       = post.userID;
                result.companyName  = post.companyName;
                result.companyType  = post.companyType;
                result.companyCount = post.companyCount;
                result.describe     = post.describe;

                db.SubmitChanges();
                return(int.Parse(result.companyID.ToString()));
            }
            catch
            {
                return(0);
            }
        }