public bool InsertLog(string logdata, decimal logtype, Token t) { try { using (LidyaEntities db = new LidyaEntities()) { TINTLOG l = new TINTLOG(); l.DLOGDATE = DateTime.Now; l.USRID = t.UserId.ToString(); l.TNAME = t.UserName; l.TLOGDATA = logdata; l.CTYPELOG = logtype; db.TINTLOG.Add(l); db.SaveChanges(); return true; } } catch (Exception ex) { //string hata = ""; //foreach (var item in ((DbEntityValidationException)ex).EntityValidationErrors) //{ // hata += item.ValidationErrors.ToString(); //} return false; } }
public static decimal GetNextSequence(Enumarations.Sequence sequence) { using (LidyaEntities db = new LidyaEntities()) { string sql = String.Format("select {0}.nextval from dual", sequence.ToString()); var testId = db.Database.SqlQuery <decimal>(sql).FirstOrDefault(); return(decimal.Parse(testId.ToString())); } }
public ProductOutputDVO GetProductByID(string productID, Token t) { using (LidyaEntities db = new LidyaEntities()) { TITEMLIST item = db.TITEMLIST.Where(x => x.TPRODUCTID == productID && x.SUPID == t.UserId).FirstOrDefault(); if (item == null) return null; else { return new ProductOutputDVO { ProductID = item.TPRODUCTID, ProductName = item.TDESCTUR, ProductNameEn = item.TDESCENG, ProductCode = item.TPRODCODE, ProductStatus = item.CSTATITM, ColorGroupCode = item.TCOLGRP, MarketPrice = item.NINIPITM, SalePrice = item.NMAXPITM, //Sales Price Price = item.NCOGSITM, Brand = item.TBRANDNAME, ModelGroupCode = item.TMODELID, OrginalSize = item.TMODELSIZE, Color = item.TSPEC1, OrginalColor = item.TMODELCOLOR, Size = item.TSPEC2, ExtraProperty = item.TSPEC3, Description = item.TDESC, DeliveryDays = item.NDLVDAYS, NoteSize = item.NNOTESIZE, CargoPrice = 0, Quantity = item.NADETITM, TaxRate = item.NVAT, FixedPrice = (item.BFIXPITM == 1) ? true : false }; } } }
public RepositoryBase() { Context = new LidyaEntities(); }