public ActionResult DEdit(int id)
        {
            DeliveryService objService = new DeliveryService();
            DeliveryModel   objModel   = new DeliveryModel();

            objModel = objService.getByID(id);

            QuotationService       objService1 = new QuotationService();
            List <DataCenterModel> ListDC      = new List <DataCenterModel>();

            ListDC          = objService1.getDataCenter();
            objModel.ListDC = new List <DataCenterModel>();
            objModel.ListDC.AddRange(ListDC);


            QuotationService    objCompUSerService = new QuotationService();
            List <CompanyModel> objCompList        = new List <CompanyModel>();

            objCompList       = objCompUSerService.getActiveComp();
            objModel.ListComp = new List <CompanyModel>();
            objModel.ListComp.AddRange(objCompList);

            List <UserModel> objUserList = new List <UserModel>();

            objUserList       = objCompUSerService.getActiveUser();
            objModel.UserList = new List <UserModel>();
            objModel.UserList.AddRange(objUserList);

            var comp = Dbcontext.UserMasters.Where(m => m.UID == objModel.CreatedBy).SingleOrDefault();
            int?cid  = comp.CompID;

            objModel.comp = cid;

            return(View(objModel));
        }
        public ActionResult QuotationList(FormCollection form)
        {
            SelectList_PageSize();
            SetPager(form);
            int CompID = LogonCompID;

            var svQuotation = new QuotationService();

            SqlSelect = "QuotationID,QuotationCode,FromCompID,ToCompID,CompanyName,ReqFirstName,ReqLastName,ReqEmail,SendDate,RowFlag,RowVersion,IsDelete,IsRead,IsOutbox,IsReject,IsImportance,QuotationStatus,FromCompName,ToCompName,CategoryType,WebID,FromWebID";
            SQLWhere  = svQuotation.CreateWhereAction(QuotationAction.Admin, 0);
            if (form["QuoStatus"] != "Q")
            {
                //Require Price
                SQLWhere += RSqlWhereQuotationSearchBy(int.Parse(form["SearchBy"]), form["SearchText"]);
            }
            else
            {
                //Quotation
                SQLWhere += QSqlWhereQuotationSearchBy(int.Parse(form["SearchBy"]), form["SearchText"]);
            }
            if (!string.IsNullOrEmpty(form["Period"]))
            {
                SQLWhere += SQLWhereDateTimeFromPeriod(form["Period"], "SendDate");
            }

            ViewBag.Quotations = svQuotation.SelectData <view_Quotation>(SqlSelect, SQLWhere, "CreatedDate DESC", (int)ViewBag.PageIndex, (int)ViewBag.PageSize);
            ViewBag.TotalPage  = svQuotation.TotalPage;
            ViewBag.TotalRow   = svQuotation.TotalRow;

            return(PartialView("UC/QuotationList"));
        }
        public ActionResult TicketLog()
        {
            TicketModel objModel = new TicketModel();

            QuotationService    objCompUSerService = new QuotationService();
            List <CompanyModel> objCompList        = new List <CompanyModel>();

            objCompList       = objCompUSerService.getActiveComp();
            objModel.ListComp = new List <CompanyModel>();
            objModel.ListComp.AddRange(objCompList);

            List <UserModel> objUserList = new List <UserModel>();

            objUserList       = objCompUSerService.getActiveUser();
            objModel.UserList = new List <UserModel>();
            objModel.UserList.AddRange(objUserList);

            DashboardService objService   = new DashboardService();
            List <UserModel> objUserList1 = new List <UserModel>();

            objUserList1       = objService.getActiveStaff();
            objModel.StaffList = new List <UserModel>();
            objModel.StaffList.AddRange(objUserList1);
            return(View(objModel));
        }
        public ActionResult QuotationTrade(FormCollection form)
        {
            SelectList_PageSize();
            SetPager(form);

            var svQuotation = new QuotationService();

            SqlSelect = "QuotationID,QuotationCode,FromCompID,ToCompID,CompanyName,ReqFirstName,ReqLastName,ReqEmail,SendDate,RowFlag,RowVersion,IsDelete,IsRead,IsReject,IsImportance,ToCompName";

            int CompID = int.Parse(form["CompID"]);

            SQLWhere = svQuotation.CreateWhereAction(QuotationAction.Admin, CompID);

            if (!string.IsNullOrEmpty(form["Period"]))
            {
                SQLWhere += SQLWhereDateTimeFromPeriod(form["Period"], "SendDate");
            }

            var Quotations = svQuotation.SelectData <view_Quotation>(SqlSelect, SQLWhere, "CreatedDate DESC", (int)ViewBag.PageIndex, (int)ViewBag.PageSize);

            ViewBag.TotalPage = svQuotation.TotalPage;
            ViewBag.TotalRow  = svQuotation.TotalRow;

            return(Json(new { Quotations = Quotations, PageIndex = (int)ViewBag.PageIndex, TotalRow = svQuotation.TotalRow, TotalPage = svQuotation.TotalPage, PageSize = (int)ViewBag.PageSize, }, JsonRequestBehavior.AllowGet));
        }
Exemple #5
0
        public void GetOneByCompanyName_WhenExistingCompanyName_ReturnQuotation()
        {
            // Arrange
            var companyName = "company name";
            var quotation   = new Quotation
                              (
                companyName,
                123.45m,
                "USD"
                              );

            var nasdaqRepository = new Mock <INasdaqRepository>();

            nasdaqRepository.Setup(rep => rep.ReadQuotations(It.IsAny <string>()))
            .Returns(new[] { quotation });

            var sut = new QuotationService(nasdaqRepository.Object);

            // Act
            var actual = sut.GetOneByCompanyName(companyName);

            // Assert
            actual.Should().NotBeNull();
            actual.Should().BeEquivalentTo(quotation);
        }
Exemple #6
0
        public void GetOneByCompanyName_WhenCompanyNameNotFound_ThrowCompanyNotFoundException()
        {
            // Arrange
            var companyName            = "company name";
            var notExistingCompanyName = "not a company name";
            var quotation = new Quotation
                            (
                companyName,
                123.45m,
                "USD"
                            );

            var nasdaqRepository = new Mock <INasdaqRepository>();

            nasdaqRepository.Setup(rep => rep.ReadQuotations(It.IsAny <string>()))
            .Returns(new[] { quotation });

            var sut = new QuotationService(nasdaqRepository.Object);

            // Act
            Action action = () => sut.GetOneByCompanyName(notExistingCompanyName);

            // Assert
            action.Should().Throw <CompanyNotFoundException>()
            .And.NotFoundCompanyName.Should().Be(notExistingCompanyName);
        }
        public ActionResult Index(TicketModel model)
        {
            ReportService      objService = new ReportService();
            TicketModel        objModel   = new TicketModel();
            List <TicketModel> lstTickets = new List <TicketModel>();
            DateTime           todt       = Convert.ToDateTime(model.ToDate);
            DateTime           frmdt      = Convert.ToDateTime(model.FromDate);
            int uid = Convert.ToInt32(model.CreatedBy);
            int cid = Convert.ToInt32(model.comp);

            lstTickets          = objService.getTicketData(todt, frmdt, uid, cid);
            objModel.ListTicket = new List <TicketModel>();
            objModel.ListTicket.AddRange(lstTickets);

            QuotationService    objCompUSerService = new QuotationService();
            List <CompanyModel> objCompList        = new List <CompanyModel>();

            objCompList       = objCompUSerService.getActiveComp();
            objModel.ListComp = new List <CompanyModel>();
            objModel.ListComp.AddRange(objCompList);

            List <UserModel> objUserList = new List <UserModel>();

            objUserList       = objCompUSerService.getActiveUser();
            objModel.UserList = new List <UserModel>();
            objModel.UserList.AddRange(objUserList);
            return(View(objModel));
        }
Exemple #8
0
        public ActionResult QuotationTrade(FormCollection form)
        {
            SelectList_PageSize();
            SetPager(form);

            var svQuotation = new QuotationService();

            SqlSelect = " * ";

            int CompID = int.Parse(form["CompID"]);

            SQLWhere = svQuotation.CreateWhereAction(QuotationAction.Admin, CompID);

            var a = form["Period"];

            if (!string.IsNullOrEmpty(form["Period"]))
            {
                SQLWhere += SQLWhereDateTimeFromPeriod(form["Period"], "SendDate");
            }

            var Quotations = svQuotation.SelectData <view_Quotation>(SqlSelect, SQLWhere, "CreatedDate DESC", (int)ViewBag.PageIndex, (int)ViewBag.PageSize);

            ViewBag.TotalPage = svQuotation.TotalPage;
            ViewBag.TotalRow  = svQuotation.TotalRow;

            return(Json(new { Quotations = Quotations, PageIndex = (int)ViewBag.PageIndex, TotalRow = svQuotation.TotalRow, TotalPage = svQuotation.TotalPage, PageSize = (int)ViewBag.PageSize, }, JsonRequestBehavior.AllowGet));
        }
        public ActionResult Quotation()
        {
            QuotationService      objService = new QuotationService();
            QuotationModel        objModel   = new QuotationModel();
            List <QuotationModel> ListQ      = new List <QuotationModel>();
            int uid = 0;

            if (Session["UID"] != null)
            {
                uid = Convert.ToInt32(Session["UID"].ToString());
            }
            ListQ            = objService.getQuotation(uid);
            objModel.ListQuo = new List <QuotationModel>();
            objModel.ListQuo.AddRange(ListQ);

            List <DataCenterModel> ListDC = new List <DataCenterModel>();

            ListDC          = objService.getDataCenter();
            objModel.ListDC = new List <DataCenterModel>();
            objModel.ListDC.AddRange(ListDC);

            List <CompanyModel> objCompList = new List <CompanyModel>();

            objCompList       = objService.getActiveComp();
            objModel.ListComp = new List <CompanyModel>();
            objModel.ListComp.AddRange(objCompList);

            List <UserModel> objUserList = new List <UserModel>();

            objUserList       = objService.getActiveUser();
            objModel.UserList = new List <UserModel>();
            objModel.UserList.AddRange(objUserList);

            return(View(objModel));
        }
Exemple #10
0
        public ActionResult Index()
        {
            InvoiceModel        objModel    = new InvoiceModel();
            InvoiceService      objService  = new InvoiceService();
            List <InvoiceModel> ListInvoice = new List <InvoiceModel>();
            int cid = 0;
            int rid = 0;

            if (Session["CompID"] != null)
            {
                cid = Convert.ToInt32(Session["CompID"].ToString());
                rid = Convert.ToInt32(Session["Role"].ToString());

                ListInvoice          = objService.getInvoice(cid, rid);
                objModel.ListInvoice = new List <InvoiceModel>();
                objModel.ListInvoice.AddRange(ListInvoice);

                QuotationService    objCompUSerService = new QuotationService();
                List <CompanyModel> objCompList        = new List <CompanyModel>();
                objCompList       = objCompUSerService.getActiveComp();
                objModel.ListComp = new List <CompanyModel>();
                objModel.ListComp.AddRange(objCompList);
            }
            else
            {
                Response.Redirect("/Login/Index");
            }

            return(View(objModel));
        }
        public void CountQuotation()
        {
            var svQuotation = new QuotationService();

            ViewBag.Inbox      = svQuotation.CountData <b2bQuotation>("*", "( IsDelete = 0 ) AND (IsRead = 'False') AND (IsOutBox = 'False')  AND (IsRead = 0) AND (ToCompID = " + LogonCompID + ")");
            ViewBag.Importance = svQuotation.CountData <b2bQuotation>("*", "( ToCompID = " + LogonCompID + " AND IsOutBox = 0 AND IsDelete = 0 AND  IsImportance = 1 ) OR (FromCompID = " + LogonCompID + " AND IsOutBox = 1 AND IsDelete = 0 AND  IsImportance = 1 )");
            ViewBag.Sentbox    = svQuotation.CountData <b2bQuotation>("*", "( IsDelete = 0 AND  IsOutbox = 1 AND FromCompID = " + LogonCompID + " )");
        }
Exemple #12
0
        //
        // GET: /APIQuatation/

        public IEnumerable <QuotationModel> Get(int id)
        {
            QuotationModel        objModel   = new QuotationModel();
            QuotationService      objService = new QuotationService();
            List <QuotationModel> lstuser    = new List <QuotationModel>();

            lstuser = objService.getQuotation(id);
            return(lstuser);
        }
        public ActionResult deleterequest(int[] messageid)
        {
            var svQuota  = new QuotationService();
            var sqlwhere = CreateWhereIN(messageid, "QuotationID");
            var sql      = " IsDelete =  1";

            svQuota.UpdateByCondition <b2bQuotation>(sql, sqlwhere);
            return(Json(new { status = svQuota.IsResult }, JsonRequestBehavior.AllowGet));
        }
Exemple #14
0
        public IActionResult Post([FromBody] PurchaseRequest purchaseRequest)
        {
            try
            {
                var units = configuration["Units"].Split(',');
                if (!units.Contains(purchaseRequest.Unit.ToLower()))
                {
                    return(BadRequest());
                }
                QuotationService call  = new QuotationService(configuration);
                Quotation        quote = call.GetCotizacion(purchaseRequest.Unit.ToLower()).Result;

                Purchase purchase = new Purchase();
                purchase.IdUser       = purchaseRequest.IdUser;
                purchase.Unit         = purchaseRequest.Unit.ToLower();
                purchase.Amount       = Convert.ToDecimal(purchaseRequest.Amount);
                purchase.CurrencyRate = quote.Buy;
                purchase.AmountTo     = Math.Round(purchase.Amount / quote.Buy, 3);
                purchase.PurchaseDate = DateTime.Now;

                DateTime from = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
                DateTime to   = new DateTime(DateTime.Now.Year, DateTime.Now.Month + 1, 1);


                List <Purchase> purchaseDataDB = dataContext.Purchase
                                                 .Where(p => p.IdUser == purchase.IdUser &&
                                                        p.Unit == purchase.Unit &&
                                                        p.PurchaseDate >= from &&
                                                        p.PurchaseDate < to)
                                                 .ToList();

                decimal compraMensual = 0;
                foreach (Purchase p in purchaseDataDB)
                {
                    compraMensual += p.AmountTo.Value;
                }

                if (compraMensual + purchase.AmountTo >= Convert.ToDecimal(configuration["BuyLimit:" + purchase.Unit]))
                {
                    return(BadRequest("Se sobrepaso el limete maximo de compra." + Environment.NewLine + "Usted ya compro: " + compraMensual + ", el maximo mensual es: " + configuration["BuyLimit:" + purchaseRequest.Unit]));
                }
                else
                {
                    dataContext.Purchase.Add(purchase);
                    dataContext.SaveChanges();
                }


                return(Ok(purchase));
            }
            catch (Exception)
            {
                return(StatusCode((int)HttpStatusCode.InternalServerError));
            }
        }
Exemple #15
0
        public void GetOneByCompanyName_WhenCompanyNameIsEmpty_ThrowArgumentNullException()
        {
            // Arrange
            var sut = new QuotationService(null);

            // Act
            Action action = () => sut.GetOneByCompanyName(string.Empty);

            // Assert
            action.Should().Throw <ArgumentNullException>();
        }
        public ActionResult sentboxrequest(int compid)
        {
            var svQuota  = new QuotationService();
            var sqlwhere = svQuota.CreateWhereAction(QuotationAction.Sentbox, compid);

            sqlwhere += " AND IsMatching = 0";
            var quotation  = new List <QuotationModel>();
            var quotations = svQuota.SelectData <view_Quotation>(" * ", sqlwhere);

            quotation = SetMappingQuotation(quotations);
            return(Json(new { quotation = quotation }, JsonRequestBehavior.AllowGet));
        }
Exemple #17
0
        public void MyB2BStatus(int CompID)
        {
            var    svProduct   = new ProductService();
            var    svBuylead   = new BuyleadService();
            var    svMessage   = new MessageService();
            var    svQuotation = new QuotationService();
            var    svOrderPur  = new OrderPurchaseService();
            string sqlwhere    = string.Empty;
            //string sqlwhere = svProduct.CreateWhereAction(ProductAction.All, CompID);
            var count = 0;

            //var sqlwherein = "";
            //    switch (res.Common.lblWebsite)
            //    {
            //        case "B2BThai": sqlwherein = " AND CategoryType IN (1,2)"; break;
            //        case "AntCart": sqlwherein = " AND CategoryType IN (3)"; break;
            //        case "myOtopThai": sqlwherein = " AND CategoryType IN (5)"; break;
            //        case "AppstoreThai": sqlwherein = " AND CategoryType IN (6)"; break;
            //        default: sqlwherein = ""; break;
            //    }sqlwhere += sqlwherein;
            sqlwhere = svProduct.CreateWhereAction(ProductAction.All, CompID);

            count = svProduct.CountData <view_SearchProduct>("ProductID", sqlwhere);
            ViewBag.CountProduct = count;

            sqlwhere = svProduct.CreateWhereAction(ProductAction.All, CompID) + " AND RowFlag = 3";
            count    = svProduct.CountData <view_SearchProduct>("ProductID", sqlwhere);
            ViewBag.CountProductReject = count;

            sqlwhere = svProduct.CreateWhereAction(ProductAction.All, CompID) + " AND RowFlag IN (2)";
            count    = svProduct.CountData <view_SearchProduct>("ProductID", sqlwhere);
            ViewBag.CountProductWait = count;

            sqlwhere = svProduct.CreateWhereAction(ProductAction.All, CompID) + " AND RowFlag IN (4,5)";
            count    = svProduct.CountData <view_SearchProduct>("ProductID", sqlwhere);
            ViewBag.CountProductApprove = count;
            //sqlwhere = svBuylead.CreateWhereAction(BuyleadAction.All, CompID);
            //count = svProduct.CountData<b2bBuylead>("BuyleadID", sqlwhere);
            //ViewBag.CountBuylead = count;

            //sqlwhere = svBuylead.CreateWhereAction(BuyleadAction.All, CompID) + " AND RowFlag = 3 ";
            //count = svBuylead.CountData<b2bBuylead>("BuyleadID", sqlwhere);
            //ViewBag.CountBuyleadReject = count;

            //sqlwhere = svMessage.CreateWhereAction(MessageStatus.Inbox, CompID);
            //count = svMessage.CountData<emMessage>("MessageID", sqlwhere);
            //ViewBag.Inbox = count;

            sqlwhere       = svMessage.CreateWhereAction(MessageStatus.UnRead, CompID);
            count          = svMessage.CountData <emMessage>("MessageID", sqlwhere);
            ViewBag.UnRead = count;
        }
Exemple #18
0
        public ActionResult OpenQuotation(string code, string password)
        {
            var svQuo = new QuotationService();

            if (CheckIsAdmin())
            {
                if (password == "12344")
                {
                    svQuo.CloseBidProductByCode(code, false);
                }
            }
            return(Json(new { result = svQuo.IsResult }, JsonRequestBehavior.AllowGet));
        }
        public ActionResult TicketLog(TicketModel model)
        {
            ReportService      objService = new ReportService();
            TicketModel        objModel   = new TicketModel();
            List <TicketModel> lstTickets = new List <TicketModel>();
            DateTime           todt       = Convert.ToDateTime(model.ToDate);
            DateTime           frmdt      = Convert.ToDateTime(model.FromDate);
            int uid = Convert.ToInt32(model.CreatedBy);
            int cid = Convert.ToInt32(model.comp);

            lstTickets          = objService.getTicketData(todt, frmdt, uid, cid);
            objModel.ListTicket = new List <TicketModel>();
            objModel.ListTicket.AddRange(lstTickets);

            QuotationService    objCompUSerService = new QuotationService();
            List <CompanyModel> objCompList        = new List <CompanyModel>();

            objCompList       = objCompUSerService.getActiveComp();
            objModel.ListComp = new List <CompanyModel>();
            objModel.ListComp.AddRange(objCompList);

            List <UserModel> objUserList = new List <UserModel>();

            objUserList       = objCompUSerService.getActiveUser();
            objModel.UserList = new List <UserModel>();
            objModel.UserList.AddRange(objUserList);

            var lstOpen    = lstTickets.Where(m => m.TicketStatusID == 1);
            var lstTicketO = from e in lstOpen
                             select new
            {
                label = e.CompDetails.Name,
                y     = lstOpen.Count(),
            };
            var rowsO = lstTicketO;

            ViewBag.TicketOpen = JsonConvert.SerializeObject(rowsO);

            var lstResolved = lstTickets.Where(m => m.TicketStatusID == 2).ToList();
            var lstTicketR  = from e in lstResolved
                              select new
            {
                label = e.CompDetails.Name,
                y     = lstResolved.Count(),
            };
            var rowsR = lstTicketR.ToArray();

            ViewBag.TicketResolved = JsonConvert.SerializeObject(rowsR);

            return(View(objModel));
        }
        public ActionResult favrequest(int messageid, bool fav)
        {
            var svQuota = new QuotationService();
            var sql     = " IsImportance =  0";

            if (fav)
            {
                sql = " IsImportance =  1";
            }

            var quotations = svQuota.UpdateByCondition <b2bQuotation>(sql, "QuotationID = " + messageid + " "); //ใส่ '' ครอบ เนื่องจาก Quotationcode เป็น String

            return(Json(new { status = svQuota.IsResult }, JsonRequestBehavior.AllowGet));
        }
        public bool Update_IsPublic(string QuotationCode)
        {
            var svQuotation = new QuotationService();

            svQuotation.UpdateByCondition <b2bQuotation>("IsClosed = 1", "QuotationCode = '" + QuotationCode + "'");
            if (svQuotation.IsResult)
            {
                return(svQuotation.IsResult);
            }
            else
            {
                return(svQuotation.IsResult);
            }
        }
        public ActionResult <string> Get(string unit)
        {
            unit = unit.ToLower();
            var units = configuration["Units"].Split(',');

            if (unit == null || !units.Contains(unit))
            {
                return(BadRequest("La moneda que desea cotizar no fue reconocida"));
            }

            QuotationService call  = new QuotationService(configuration);
            Quotation        quote = call.GetCotizacion(unit).Result;

            return(Ok(quote));
        }
        public IHttpActionResult GetQuotation(string currency)
        {
            var quotation = new QuotationResult();

            try
            {
                quotation = new QuotationService().GetQuotation(currency);
            }
            catch (Exception e)
            {
                return(new ResponseMessageResult(Request.CreateResponse(HttpStatusCode.InternalServerError, e.Message)));
            }

            return(new ResponseMessageResult(Request.CreateResponse(quotation.Result, quotation.Message)));
        }
Exemple #24
0
        public ActionResult FillSubCat(int cid)
        {
            List <TicketTypeModel> lstModel = new List <TicketTypeModel>();
            UserModel        objModel       = new UserModel();
            QuotationService objService     = new QuotationService();

            lstModel            = objService.getSubCatByCatID(cid);
            objModel.ListSubCat = new List <TicketTypeModel>();
            objModel.ListSubCat.AddRange(lstModel);
            System.Threading.Thread.Sleep(5000);
            return(Json(objModel.ListSubCat, JsonRequestBehavior.AllowGet));
            //var jsonResult = Json(objModel.ListUser, JsonRequestBehavior.AllowGet);
            //jsonResult.MaxJsonLength = int.MaxValue;
            //return jsonResult;
        }
Exemple #25
0
        public ActionResult Edit(int id)
        {
            InvoiceService objService = new InvoiceService();
            InvoiceModel   objModel   = new InvoiceModel();

            objModel = objService.getByID(id);

            QuotationService    objCompUSerService = new QuotationService();
            List <CompanyModel> objCompList        = new List <CompanyModel>();

            objCompList       = objCompUSerService.getActiveComp();
            objModel.ListComp = new List <CompanyModel>();
            objModel.ListComp.AddRange(objCompList);
            return(View(objModel));
        }
        public ActionResult UserLog(UserModel model)
        {
            UserModel        objModel   = new UserModel();
            UserService      objService = new UserService();
            List <UserModel> lstUserLog = new List <UserModel>();

            int uid = 0;
            int cid = 0;

            if (model.UID != null && model.UID != 0)
            {
                uid = model.UID;
            }
            else
            {
                uid = model.sid;
            }

            DateTime frmDt = Convert.ToDateTime(model.FromDate);
            DateTime toDt  = Convert.ToDateTime(model.ToDate);

            lstUserLog        = objService.getUserLog(uid, frmDt, toDt);
            objModel.ListUser = new List <UserModel>();
            objModel.ListUser.AddRange(lstUserLog);


            QuotationService    objCompUSerService = new QuotationService();
            List <CompanyModel> objCompList        = new List <CompanyModel>();

            objCompList       = objCompUSerService.getActiveComp();
            objModel.ListComp = new List <CompanyModel>();
            objModel.ListComp.AddRange(objCompList);

            List <UserModel> objUserList = new List <UserModel>();

            objUserList       = objCompUSerService.getActiveUser();
            objModel.UserList = new List <UserModel>();
            objModel.UserList.AddRange(objUserList);

            DashboardService objService1  = new DashboardService();
            List <UserModel> objUserList1 = new List <UserModel>();

            objUserList1       = objService1.getActiveStaff();
            objModel.StaffList = new List <UserModel>();
            objModel.StaffList.AddRange(objUserList1);

            return(View(objModel));
        }
Exemple #27
0
        public ActionResult AddEdit(QuotationModel model)
        {
            //model.AddedBy = HttpContext.Session.GetString("UserName");
            bool EmployeeStatus = QuotationService.AddQuotation(model);

            if (EmployeeStatus)
            {
                TempData["Success"] = "Quotation Added Successfully.";
            }
            else
            {
                TempData["Error"] = "Error, Please Try Again.";
            }

            return(RedirectToAction("Index"));
        }
Exemple #28
0
        public void CountQuotation()
        {
            string SQLWhere    = "";
            var    svQuotation = new QuotationService();
            var    svOrderPur  = new OrderPurchaseService();

            SQLWhere         = svQuotation.CreateWhereAction(QuotationAction.CountQuotation, LogonCompID);
            SQLWhere        += " AND (IsRead = 0)";
            ViewBag.QuoCount = svQuotation.SelectData <b2bQuotation>("QuotationID", SQLWhere, "QuotationID", 1, 0).Count;

            var SQLWhereList = svQuotation.CreateWhereAction(QuotationAction.BackEnd, LogonCompID);

            ViewBag.QuoCountList = svQuotation.SelectData <b2bQuotation>("QuotationID", SQLWhereList, "QuotationID", 1, 0).Count;

            SQLWhere         = svOrderPur.CreateWhereAction(OrderPurchaseAction.CountOrderPurchase, LogonCompID);
            ViewBag.CountOrP = svOrderPur.SelectData <OuikumOrderDetail>("OrDetailID", SQLWhere, "OrDetailID", 1, 0).Count;
        }
        public ActionResult QEdit(QuotationModel model)
        {
            QuotationService objService = new QuotationService();
            int uid = 0;

            if (Session["UID"] != null)
            {
                uid = Convert.ToInt32(Session["UID"].ToString());


                model.UpdatedBy   = uid;
                model.UpdatedDate = System.DateTime.Now;
                objService.Update(model);
                TempData["Msg"] = "Updated successfully.";
            }
            return(RedirectToAction("Quotation"));
        }
Exemple #30
0
        public ActionResult Index()
        {
            //if (RedirectToProduction())
            //    return Redirect(UrlProduction);

            LoadProductShowcase();
            LoadHotProduct();
            LoadRecently();
            LoadCategory();
            LoadFeatureProduct();
            LoadRandomCompany();
            LoadRandomBanner();
            GetStatusUser();
            LoadDataBidProduct();
            LoadSuccessStory();
            GetEnumServiceType();
            //search
            LoadProvinces();
            LoadBiztype();

            #region CheckIsLogin
            if (CheckIsLogin())
            {
                MessageService       svMessage   = new MessageService();
                QuotationService     svQuotation = new QuotationService();
                OrderPurchaseService svOrderPur  = new OrderPurchaseService();
                string SQLWhere = "";

                string sqlwhere = svMessage.CreateWhereAction(MessageStatus.UnRead, LogonCompID);
                int    count    = svMessage.CountData <emMessage>("MessageID", sqlwhere);
                ViewBag.UnRead = count;

                SQLWhere         = svQuotation.CreateWhereAction(QuotationAction.CountQuotation, LogonCompID);
                ViewBag.CountQuo = svQuotation.SelectData <b2bQuotation>("QuotationID", SQLWhere, "QuotationID", 1, 0).Count;

                SQLWhere         = svOrderPur.CreateWhereAction(OrderPurchaseAction.CountOrderPurchase, LogonCompID);
                ViewBag.CountOrP = svOrderPur.SelectData <OuikumOrderDetail>("OrDetailID", SQLWhere, "OrDetailID", 1, 0).Count;
            }
            #endregion

            ViewBag.FBAccessToken = GetAppSetting("FBPageAccessToken");
            ViewBag.Page          = "Home";

            return(View());
        }