Пример #1
0
        public static string ProcessRfiInfo(RFQITEMViewModel model)
        {
            SOURCING_RFQ_ITEM _item = new SOURCING_RFQ_ITEM();

            try
            {
                var     TempId  = HttpContext.Current.Session["TempId"].ToString();
                decimal _tempId = Convert.ToDecimal(TempId);


                using (var context = new Entities())
                {
                    _item.TEMP_NO      = _tempId;
                    _item.DESCRIPTION  = model.DESCRIPTION;
                    _item.QUANTITY     = model.QUANTITY;
                    _item.UNIT_OF_MEAS = model.UNIT_OF_MEAS;
                    _item.RFI_INFO     = model.RFI_INFO;
                    context.SOURCING_RFQ_ITEM.Add(_item);
                    context.SaveChanges();
                }


                return(TempId);
            }
            catch (Exception ex)
            {
                Logger.Log("Error insert into RFQ-Item table. Error: " + ex.Message +
                           "------------------------------------------------" + ex.StackTrace,
                           "error");
                return(null);
            }
        }
Пример #2
0
        public ActionResult RFIInfo(RFQITEMViewModel item)
        {
            string process = ProcessRFQ.ProcessRfiInfo(item);

            if (process != null)
            {
                HttpContext.Session["TempId"] = process;
                return(RedirectToAction("RFIVendors"));
            }
            return(View());
        }
Пример #3
0
        public static void InsertNegPrice(RFQITEMViewModel item, decimal?tempId, decimal NegotiationNumber)
        {
            SOURCING_NEG_PRICE neg = new SOURCING_NEG_PRICE();

            using (var context = new Entities())
            {
                neg.ITEM_NO     = item.ITEM_NO;
                neg.NEG_NO      = NegotiationNumber;
                neg.UNIT_PRICE  = item.UNIT_PRICE;
                neg.TOTAL_PRICE = item.TOTAL_PRICE;
                context.SOURCING_NEG_PRICE.Add(neg);
                context.SaveChanges();
            }
        }
Пример #4
0
        public ActionResult UpdateRFIInfo(RFQITEMViewModel model)
        {
            decimal _TempId;
            string  TempId = HttpContext.Session["TempId"].ToString();

            _TempId = Convert.ToDecimal(TempId);
            UpdateRequestBLL _model = new UpdateRequestBLL();

            _model.TempId = _TempId;
            _model._item  = model;
            string output = _model.UpdateRFIInfor();

            if (output != null)
            {
                return(RedirectToAction("EditRFIVendor"));
            }
            else
            {
                TempData["ErrorMessage"] = "An Error Occurred";
                return(RedirectToAction("GetRFIInfo"));
            }
        }