예제 #1
0
        public bool UpdateVendorResolveII()
        {
            decimal?_vendorId = Convert.ToDecimal(VendorID);
            decimal?_tempId   = Convert.ToDecimal(TempID);
            decimal?ReqType;

            ReqType = NegotiateBLL.getRequestType((decimal)_tempId);
            try
            {
                using (var context = new Entities())
                {
                    var query = context.SOURCING_CONTACTEDVENDOR.Where(m => m.VENDOR_ID == _vendorId && m.TEMP_NO == _tempId).FirstOrDefault();
                    if (query != null)
                    {
                        query.STATUS             = Resolve;
                        query.VERDICT_ISSUE_DATE = DateTime.Now;
                        context.SaveChanges();
                    }

                    if (ReqType == 2)
                    {
                        var rfpReq = context.SOURCING_RFP_RFI_REQ.Where(m => m.TEMP_ID == _tempId).FirstOrDefault();
                        if (rfpReq != null)
                        {
                            rfpReq.STATUS = Resolution;
                            context.SaveChanges();
                            UpdateBranchAndDeptRequestTable((decimal)rfpReq.MAPPING);
                        }
                    }
                    else if (ReqType == 3)
                    {
                        var rfqReq = context.SOURCING_RFQ_REQ.Where(m => m.TEMP_NO == _tempId).FirstOrDefault();
                        if (rfqReq != null)
                        {
                            rfqReq.STATUS = Resolution;
                            context.SaveChanges();
                            UpdateBranchAndDeptRequestTable((decimal)rfqReq.MAPPING);
                        }
                    }

                    return(true);
                    //NotifyVendor((decimal)_vendorId, (decimal)_tempId, "a Authority to Proceed");
                }
            }
            catch (Exception ex)
            {
                Logger.Log("Error : " + ex.Message +
                           "------------------------------------------------" + ex.StackTrace,
                           "error");
                return(false);
            }
        }
예제 #2
0
        internal static object CloseRequest(string TempNo)
        {
            decimal _TempNo = Convert.ToDecimal(TempNo);
            decimal?ReqType = NegotiateBLL.getRequestType(_TempNo);

            using (var db = new Entities())
            {
                if (ReqType == 2 || ReqType == 1)
                {
                    var query = db.SOURCING_RFP_RFI_REQ.Where(m => m.TEMP_ID == _TempNo).FirstOrDefault();
                    query.STATUS = "CLOSED";
                    db.SaveChanges();
                }
                else if (ReqType == 3)
                {
                    var query = db.SOURCING_RFQ_REQ.Where(m => m.TEMP_NO == _TempNo).FirstOrDefault();
                    query.STATUS = "CLOSED";
                    db.SaveChanges();
                }
                return(true);
            }
        }