예제 #1
0
        public void InsertUpdate(MLTipoAgua ML)
        {
            try
            {
                dbSmartSysDataContext dbContext = new dbSmartSysDataContext();

                var Ag = (from t in dbContext.TipoAguas where t.CodTipoAgua == ML.CodTipoAgua select t).SingleOrDefault();

                if (Ag == null)
                {
                    TipoAgua dbAg = new TipoAgua();

                    dbAg.CodTipoAgua = ML.CodTipoAgua;
                    dbAg.TipoAgua1 = ML.TipoAgua;

                    dbContext.TipoAguas.InsertOnSubmit(dbAg);
                    dbContext.TipoAguas.Context.SubmitChanges();
                }
                else
                {
                    Ag.TipoAgua1 = ML.TipoAgua;

                    dbContext.TipoAguas.Context.SubmitChanges();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
예제 #2
0
 partial void DeleteTipoAgua(TipoAgua instance);
예제 #3
0
 partial void UpdateTipoAgua(TipoAgua instance);
예제 #4
0
 partial void InsertTipoAgua(TipoAgua instance);