当前位置: 首页>>代码示例>>C#>>正文


C# TugDataEntities.proc_approved方法代码示例

本文整理汇总了C#中TugDataModel.TugDataEntities.proc_approved方法的典型用法代码示例。如果您正苦于以下问题:C# TugDataEntities.proc_approved方法的具体用法?C# TugDataEntities.proc_approved怎么用?C# TugDataEntities.proc_approved使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TugDataModel.TugDataEntities的用法示例。


在下文中一共展示了TugDataEntities.proc_approved方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetCheckedData

        public ActionResult GetCheckedData(bool _search, string sidx, string sord, int page, int rows)
        {
            this.Internationalization();
            int curUserId = 0;
             curUserId = Session.GetDataFromSession<int>("userid");
             if (_search == true)
             {
                 string s = Request.QueryString["filters"];
                 return Json(new { code = Resources.Common.ERROR_CODE, message = Resources.Common.ERROR_MESSAGE }, JsonRequestBehavior.AllowGet);
             }
             else
             {
                 try
                 {
                    TugDataEntities db = new TugDataEntities();
                    var objs = db.proc_approved(curUserId).OrderByDescending(u=>u.CreateDate).ToList();
                    int totalRecordNum = objs.Count;
                    if (page != 0 && totalRecordNum % rows == 0) page -= 1;
                    int pageSize = rows;
                    int totalPageNum = (int)Math.Ceiling((double)totalRecordNum / pageSize);
                    //var page_objs = objs.Skip((page - 1) * rows).Take(rows).ToList();
                    var jsonData = new { page = page, records = totalRecordNum, total = totalPageNum, rows = objs };
                    return Json(jsonData, JsonRequestBehavior.AllowGet);
                 }
                 catch (Exception)
                 {
                     throw;
                 }

             }

            //try
            //{
            //    int curUserId = 0;
            //    TugDataEntities db = new TugDataEntities();
            //    //System.Linq.Expressions.Expression<Func<UserInfor, bool>> exp = u => u.UserName == User.Identity.Name;
            //    //UserInfor curUser = db.UserInfor.Where(exp).FirstOrDefault();

            //    curUserId = Session.GetDataFromSession<int>("userid");   //當前用戶ID
            //        List<Approve> ApproveList = db.Approve.Where(u => u.PersonID == curUserId).Select(u => u).ToList<Approve>();
            //        if (ApproveList.Count != 0)
            //        {
            //            //List<Billing> BillList = db.Billing.Where(u => u.IDX == -1).Select(u => u).ToList<Billing>();
            //            List<V_OrderBilling> BillList = db.V_OrderBilling.Where(u => u.BillingID == -1).Select(u => u).ToList<V_OrderBilling>();

            //            foreach (Approve obj in ApproveList)
            //            {
            //                if (Convert.ToInt32(obj.Accept) > 2) continue;
            //                //System.Linq.Expressions.Expression<Func<Billing, bool>> expB = u => u.IDX == obj.BillingID;
            //                //Billing billData = db.Billing.Where(expB).FirstOrDefault();
            //                System.Linq.Expressions.Expression<Func<V_OrderBilling, bool>> expB = u => u.BillingID == obj.BillingID;
            //                V_OrderBilling billData = db.V_OrderBilling.Where(expB).FirstOrDefault();

            //                if (billData != null)
            //                {
            //                    //撤销提交的为待提交任务
            //                    if (Convert.ToInt32(billData.Phase) == 0 && billData.Status == "已撤销提交") continue;
            //                    //驳回或撤销通过的为待完成任务
            //                    if (Convert.ToInt32(billData.Phase) == 0 && billData.Status.ToString().Length >= 3) continue;
            //                    //BillList.Add(billData);
            //                    BillList.Add(billData);
            //                }

            //            }
            //            int totalRecordNum = BillList.Count;
            //            if (page != 0 && totalRecordNum % rows == 0) page -= 1;
            //            int pageSize = rows;
            //            int totalPageNum = (int)Math.Ceiling((double)totalRecordNum / pageSize);
            //            //List<V_OrderBilling> page_objs = BillList.Skip((page - 1) * rows).Take(rows).ToList<V_OrderBilling>();
            //            var jsonData = new { page = page, records = totalRecordNum, total = totalPageNum, rows = BillList };
            //            return Json(jsonData, JsonRequestBehavior.AllowGet);
            //        }
            //        else
            //        {
            //            List<V_OrderBilling> BillList = db.V_OrderBilling.Where(u => u.BillingID == -1).Select(u => u).ToList<V_OrderBilling>();
            //            int totalRecordNum = BillList.Count;
            //            if (page != 0 && totalRecordNum % rows == 0) page -= 1;
            //            int pageSize = rows;
            //            int totalPageNum = (int)Math.Ceiling((double)totalRecordNum / pageSize);
            //            //List<V_OrderBilling> page_objs = BillList.Skip((page - 1) * rows).Take(rows).ToList<V_OrderBilling>();
            //            var jsonData = new { page = page, records = totalRecordNum, total = totalPageNum, rows = BillList };
            //            return Json(jsonData, JsonRequestBehavior.AllowGet);
            //        }
            //        //List<V_NeedApproveBilling> objs = db.V_NeedApproveBilling.Where(u => u.FlowUserID == curUserId).OrderByDescending(u => u.IDX).ToList<V_NeedApproveBilling>();

            //        //int totalRecordNum1 = objs.Count;
            //        //if (page != 0 && totalRecordNum1 % rows == 0) page -= 1;
            //        //int pageSize1 = rows;
            //        //int totalPageNum1 = (int)Math.Ceiling((double)totalRecordNum1 / pageSize1);
            //        //List<V_NeedApproveBilling> page_objs1 = objs.Skip((page - 1) * rows).Take(rows).ToList<V_NeedApproveBilling>();
            //        //var jsonData1 = new { page = page, records = totalRecordNum1, total = totalPageNum1, rows = page_objs1 };
            //        //return Json(jsonData1, JsonRequestBehavior.AllowGet);

            //}
            //catch (Exception)
            //{
            //    return Json(new { code = Resources.Common.EXCEPTION_CODE, message = Resources.Common.EXCEPTION_MESSAGE });
            //}
        }
开发者ID:,项目名称:,代码行数:99,代码来源:


注:本文中的TugDataModel.TugDataEntities.proc_approved方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。