コード例 #1
0
        //public JsonResult BindSupplierByJobCode(string ID)
        //{
        //    //  List<SP_GetAllSupplierByJobCode_Result> Suppliers = new List<SP_GetAllSupplierByJobCode_Result>();

        //var Suppliers = CU.GetSupplierByJobCode(ID);

        //    //ViewBag.Suppliers = new SelectList(Suppliers, "SupplierID", "SupplierName");
        //    return Json(Suppliers, JsonRequestBehavior.AllowGet);
        //}


        public JsonResult BindJobCodeBySupplier(int supplierID)
        {
            DateTime frmdate = Convert.ToDateTime(Session["FyearFrom"].ToString());
            DateTime tdate   = Convert.ToDateTime(Session["FyearTo"].ToString());
            //var query = (from t in entity.JInvoices
            //             join j in entity.JobGenerations on t.JobID equals j.JobID
            //             where t.SupplierID == supplierID && (j.JobDate >= frmdate) &&
            //              (j.JobDate <= tdate)
            //             select j).Distinct().ToList();

            var query1 = entity.GetJobDetailsBySupplieRID(supplierID, frmdate, tdate).ToList();

            //var query1 = (from p in entity.JobGenerations
            //              where  &&
            //              query.Contains(p.JobID) select p).ToList();



            //ViewBag.Suppliers = new SelectList(Suppliers, "SupplierID", "SupplierName");
            return(Json(query1, JsonRequestBehavior.AllowGet));
        }