Example #1
0
        public APIResponse UpdatePrice(PriceMaster priceMaster)
        {
            APIResponse response = new APIResponse();

            try
            {
                response.Data = priceManager.UpdatePrice(priceMaster);
                if (response.Data != 0)
                {
                    response.Success = true;
                    response.Error   = null;
                }
                else
                {
                    response.Success = false;
                    response.Error   = "Record not Updated";
                }
            }
            catch (Exception ex)
            {
                response.Data    = null;
                response.Success = false;
                response.Error   = ex.Message;
            }
            return(response);
        }
Example #2
0
        public void EditPrice_Master(PriceMaster priceMaster, string username, string password)
        {
            PriceMaster prce_Mstr = context.PriceMaster.FirstOrDefault(a => a.PriceMasterCode == priceMaster.PriceMasterCode);

            prce_Mstr.ConversitionRate = priceMaster.ConversitionRate;
            prce_Mstr.CurrencyType     = priceMaster.CurrencyType;
            prce_Mstr.UnitPrice        = priceMaster.UnitPrice;
            prce_Mstr.ModifiedBy       = username;
            prce_Mstr.ModifiedDate     = DateTime.Now;

            context.SaveChanges();
        }
Example #3
0
        public int UpdatePrice(PriceMaster priceMaster)
        {
            int result = 0;

            try
            {
                string query = string.Format("update PriceMaster set ItemId={0},Price={1} where PriceId={2}", priceMaster.ItemId, priceMaster.Price, priceMaster.PriceId);
                result = _db.Execute(query);
            }
            catch (Exception EX)
            {
                throw EX;
            }
            return(result);
        }
Example #4
0
        public PriceMaster SinglePriceMaster(int priceid)
        {
            PriceMaster priceMaster = new PriceMaster();

            try
            {
                string query = string.Format("select * from PriceMaster where PriceId={0}", priceid);
                priceMaster = _db.Query <PriceMaster>(query).FirstOrDefault();
            }
            catch (Exception)
            {
                throw;
            }
            return(priceMaster);
        }
Example #5
0
        public int InsertPrice(PriceMaster priceMaster)
        {
            int result = 0;

            try
            {
                string query = string.Format("insert into PriceMaster (ItemId,Price,Date) values({0},{1})", priceMaster.ItemId, priceMaster.Price);
                result = _db.Execute(query);
            }
            catch (Exception EX)
            {
                throw EX;
            }
            return(result);
        }
Example #6
0
 public int UpdatePrice(PriceMaster priceMaster)
 {
     return(priceRepository.UpdatePrice(priceMaster));
 }
Example #7
0
 public int InsertPrice(PriceMaster priceMaster)
 {
     return(priceRepository.InsertPrice(priceMaster));
 }
Example #8
0
 public void EditPrice_Master(PriceMaster priceMaster, string username, string password)
 {
     masterReports.EditPrice_Master(priceMaster, username, password);
 }