Exemplo n.º 1
0
        //public ActionResult DOTManagementSubmit(DOTManagementViewDataModel DOTM)
        //{
        //    try
        //    {

        //    }
        //    catch (Exception ex)
        //    {
        //        ViewBag.StrError = "Error " + ex.ToString().Replace('\n', '_');
        //        return View("Error");
        //    }
        //    return RedirectToAction(null);
        //}
        public JsonResult GetAllDriverList(string _search, long?UserId, long?LocationId, string status, int?rows = 20, int?page = 1, int?TotalRecords = 10, string sord = null, string txtSearch = null, string sidx = null, string UserType = null)
        {
            eTracLoginModel ObjLoginModel = null;
            long            UserTypeId    = 0;

            if (Session != null && Session["eTrac"] != null)
            {
                ObjLoginModel = (eTracLoginModel)(Session["eTrac"]);
                if (ObjLoginModel != null)
                {
                    LocationId = ObjLoginModel.LocationID;
                }
                UserId     = ObjLoginModel.UserId;
                UserTypeId = ObjLoginModel.UserType;
            }
            sord = string.IsNullOrEmpty(sord) ? "desc" : sord;
            sidx = string.IsNullOrEmpty(sidx) ? "UserEmail" : sidx;

            try
            {
                if (txtSearch != null && txtSearch != "")
                {
                    var AllPOList1 = _IPOTypeDetails.GetAllPOList(UserId, LocationId, status, UserTypeId, rows, TotalRecords, sidx, sord).Where(n => n.DisplayLogPOId == txtSearch).ToList();
                    return(Json(AllPOList1, JsonRequestBehavior.AllowGet));
                }
                else
                {
                    var AllPOList = _IPOTypeDetails.GetAllPOList(UserId, LocationId, status, UserTypeId, rows, TotalRecords, sidx, sord);
                    return(Json(AllPOList, JsonRequestBehavior.AllowGet));
                }
            }
            catch (Exception ex)
            { return(Json(ex.Message, JsonRequestBehavior.AllowGet)); }
        }
Exemplo n.º 2
0
        public JsonResult GetAllPOList(string _search, long?UserId, long?LocationId, string status, int?rows = 20, int?page = 1, int?TotalRecords = 10, string sord = null, string txtSearch = null, string sidx = null, string UserType = null)
        {
            eTracLoginModel ObjLoginModel = null;
            long            UserTypeId    = 0;

            if (Session != null && Session["eTrac"] != null)
            {
                ObjLoginModel = (eTracLoginModel)(Session["eTrac"]);
                if (LocationId == null)
                {
                    LocationId = ObjLoginModel.LocationID;
                }
                UserId     = ObjLoginModel.UserId;
                UserTypeId = ObjLoginModel.UserType;
            }
            JQGridResults    result = new JQGridResults();
            List <JQGridRow> rowss  = new List <JQGridRow>();

            sord      = string.IsNullOrEmpty(sord) ? "desc" : sord;
            sidx      = string.IsNullOrEmpty(sidx) ? "UserEmail" : sidx;
            txtSearch = string.IsNullOrEmpty(txtSearch) ? "" : txtSearch; //UserType = Convert.ToInt64(Helper.UserType.ITAdministrator);
            try
            {
                var AllPOList = _IPOTypeDetails.GetAllPOList(UserId, LocationId, status, UserTypeId, rows, TotalRecords, sidx, sord);
                foreach (var poList in AllPOList.rows)
                {
                    JQGridRow row = new JQGridRow();
                    row.id       = Cryptography.GetEncryptedData(Convert.ToString(poList.LogPOId), true);
                    row.cell     = new string[11];
                    row.cell[0]  = "PO" + poList.LogPOId.ToString();
                    row.cell[1]  = poList.POType.ToString();
                    row.cell[2]  = (poList.CompanyName == null) ? "N/A" : poList.CompanyName.ToString();
                    row.cell[3]  = poList.LocationName.ToString();
                    row.cell[4]  = poList.PODate.ToString("MM/dd/yyyy");
                    row.cell[5]  = (poList.DeliveryDate == null)?"N/A": poList.DeliveryDate.ToString("MM/dd/yyyy");
                    row.cell[6]  = (poList.POStatus == null)?"Not Approved": poList.POStatus.ToString();
                    row.cell[7]  = (poList.POStatusToDisplay == "W") ? "Waiting" : (poList.POStatusToDisplay == "Y")? "Approved" : "Reject";
                    row.cell[8]  = poList.LogId.ToString();
                    row.cell[9]  = (poList.Total == null)?"N/A": poList.Total.ToString();
                    row.cell[10] = poList.CreatedBy.ToString();
                    rowss.Add(row);
                }
                result.rows    = rowss.ToArray();
                result.page    = Convert.ToInt32(page);
                result.total   = (int)Math.Ceiling((decimal)Convert.ToInt32(TotalRecords.Value) / rows.Value);
                result.records = Convert.ToInt32(TotalRecords.Value);
            }
            catch (Exception ex)
            { return(Json(ex.Message, JsonRequestBehavior.AllowGet)); }
            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 3
0
        // GET: DebitMemo
        /// <summary>
        /// Created By: Er.Ro.R
        /// Created Date : 8-OCT-2019
        /// Created For : To get Debit Memo List as per Vendor
        /// </summary>
        public ActionResult Index()
        {
            var model = new DebitMemoModel();

            try
            {
                eTracLoginModel ObjLoginModel = null;
                if (Session != null)
                {
                    if (Session["eTrac"] != null)
                    {
                        ObjLoginModel = (eTracLoginModel)(Session["eTrac"]);
                        if (Convert.ToInt64(Session["eTrac_SelectedDasboardLocationID"]) == 0)//eTrac_UserLocations
                        {
                            (Session["eTrac_SelectedDasboardLocationID"]) = ObjLoginModel.LocationID;
                        }
                    }
                }

                List <SelectListItem> listItems = new List <SelectListItem>();
                listItems.Add(new SelectListItem
                {
                    Text  = "---Select Vendor---",
                    Value = "0"
                });
                ViewBag.VendorList = listItems;//sending locationId 0 for all data
                //ViewBag.VendorList = _IPOTypeDetails.GetCompany_VendorList(0, false);//sending locationId 0 for all data

                model.ActionModeI        = "I";
                ViewBag.ProductOrderList = _IPOTypeDetails.GetAllPOList(0, 0, "", 0, 0, 0, "", "");//companyFacilityList
            }
            catch (Exception ex)
            {
            }
            return(View(model));
        }