예제 #1
0
        //
        // GET: /Settings/CaseSetting/

        public ActionResult Index()
        {
            using (FATContainer dataContainer = new FATContainer())
            {
                return(View("T1RoutineList", dataContainer.TemplateRoutine.Where(routine => routine.RoutineType == ConstDefine.RoutineType_Teaching1).ToList()));
            }
        }
예제 #2
0
        public ActionResult StartRoutine(int teachingRoutineID)
        {
            DateTime currDate   = DateTime.Now.Date;
            int      currUserID = CurrentUser.GetUserID();

            using (FATContainer dataContainer = new FATContainer())
            {
                TeachingRoutine tchRoutine = SharedCasePool.GetCasePool().GetRoutine(teachingRoutineID);
                TeachingNode    firstNode  = tchRoutine.NodeList[tchRoutine.NodeList.Keys[0]];
                StudentActivity activity   = dataContainer.StudentActivity.FirstOrDefault(act => (act.UserID == currUserID) && (act.TimeMark >= currDate) && (act.TchRoutineID == teachingRoutineID));
                if (activity == null)
                {
                    activity = dataContainer.StudentActivity.Create();
                }
                activity.TchNodeID    = firstNode.Row_ID;
                activity.IsFinished   = 0;
                activity.TchRoutineID = teachingRoutineID;
                activity.UserID       = CurrentUser.GetUserID();
                activity.TimeMark     = DateTime.Now.Date;
                if (activity.Row_ID == 0)
                {
                    dataContainer.StudentActivity.Add(activity);
                    dataContainer.SaveChanges();
                }
                else
                {
                    dataContainer.Entry <StudentActivity>(activity).CurrentValues.SetValues(activity);
                    dataContainer.SaveChanges();
                }

                JsonResult result = new JsonResult();
                result.Data = string.Format("{0}/{1}/{2}", firstNode.NodeType, firstNode.NodeTag, firstNode.Row_ID);
                return(result);
            }
        }
예제 #3
0
        public ActionResult InitIndividualSavingData()
        {
            using (FATContainer dataContainer = new FATContainer())
            {
                int             tchRoutineID = Convert.ToInt32(RouteData.Values["tchRoutineID"]);
                TeachingRoutine routine      = SharedCasePool.GetCasePool().GetRoutine(tchRoutineID);

                //all tags: DWHQ_Deposit DWHQ_Withdraw DWHQ_Interest DWHQ_Clear DWZZ_Deposit DWZZ_Withdraw DWLZ_Deposit DWLZ_Withdraw DWZL_Deposit DWZL_Withdraw DWZL_Interest DWTI_Deposit DWTI_Interest DWTI_Withdraw
                //Section controls which section should be displayed and filled
                ViewBag.Section = routine.RelTmpRoutine.RoutineTag.Split('_')[1];

                IndividualSaving info = dataContainer.IndividualSaving.FirstOrDefault(item => (item.TchRoutineID == tchRoutineID));
                if (info == null)
                {
                    info = dataContainer.IndividualSaving.Create();
                    info.TchRoutineID      = tchRoutineID;
                    info.AccountCreateTime = DateTime.Now;
                    info.DepositTime       = DateTime.Now;
                    info.WithdrawTime      = DateTime.Now;
                    info.InterestTime      = DateTime.Now;
                    dataContainer.IndividualSaving.Add(info);
                    dataContainer.SaveChanges();
                }
                return(View("IndividualSaving", info));
            }
        }
예제 #4
0
        public ActionResult ListStudiedRoutine()
        {
            using (FATContainer dataContainer = new FATContainer())
            {
                JsonResult             result       = new JsonResult();
                DateTime               currDate     = DateTime.Now.Date;
                List <StudentActivity> activityList = dataContainer.StudentActivity.Where(act => act.TimeMark >= currDate).OrderBy(act => act.IsFinished).ToList();
                SharedCasePool         casePool     = SharedCasePool.GetCasePool();
                foreach (StudentActivity activity in activityList)
                {
                    TeachingRoutine routine = casePool.GetRoutine(activity.TchRoutineID);
                    if (routine == null)
                    {
                        result.Data = CommFunctions.WrapClientGridData(new List <StudentActivity>());
                        return(result);
                    }
                    activity.CaseName       = routine.CaseName;
                    activity.TmpRoutineName = routine.RelTmpRoutine.RoutineName;

                    if (activity.TchNodeID == -1)
                    {
                        activity.TmpNodeName = "(已完成)";
                    }
                    else
                    {
                        activity.TmpNodeName = routine.NodeList[activity.TchNodeID].RelTmpNode.NodeName;
                        activity.NodeType    = routine.NodeList[activity.TchNodeID].RelTmpNode.NodeType;
                        activity.NodeTag     = routine.NodeList[activity.TchNodeID].RelTmpNode.Tag;
                    }
                }
                activityList.Clear();
                result.Data = CommFunctions.WrapClientGridData(activityList);
                return(result);
            }
        }
예제 #5
0
 //
 // GET: /Teaching1/Teaching1Init/
 #region T1
 public ActionResult T1Init()
 {
     using (FATContainer dataContainer = new FATContainer())
     {
         return(View("SelectT1Case", dataContainer.TemplateRoutine.Where(routine => routine.RoutineType == ConstDefine.RoutineType_Teaching1).ToList()));
     }
 }
예제 #6
0
 public ActionResult ListSubjectItem(int tchRoutineID, int tchNodeID)
 {
     using (FATContainer dbContainer = new FATContainer())
     {
         JsonResult result = new JsonResult();
         result.Data = CommFunctions.WrapClientGridData(dbContainer.SubjectItem.Where(subject => subject.TchNodeID == tchNodeID && subject.TchRoutineID == tchRoutineID).OrderBy(subject => subject.SubjectOrient).ToList());
         return(result);
     }
 }
예제 #7
0
 public ActionResult OuterSubject_List(int tRoutineID)
 {
     using (FATContainer dataContainer = new FATContainer())
     {
         JsonResult result = new JsonResult();
         result.Data = CommFunctions.WrapClientGridData(dataContainer.OuterSubject.Where(item => item.TchRoutineID == tRoutineID).OrderBy(item => item.RoutineDesc).ToList());
         return(result);
     }
 }
예제 #8
0
 public ActionResult OuterSubject_GetTemplate()
 {
     using (FATContainer dataContainer = new FATContainer())
     {
         JsonResult   result = new JsonResult();
         OuterSubject osInfo = dataContainer.OuterSubject.Create();
         osInfo.TimeMark = DateTime.Now;
         result.Data     = osInfo;
         return(result);
     }
 }
예제 #9
0
 public ActionResult OuterSubject_Init()
 {
     using (FATContainer dataContainer = new FATContainer())
     {
         OuterSubject osInfo = dataContainer.OuterSubject.Create();
         osInfo.TchNodeID = Convert.ToInt32(RouteData.Values["id"]);
         TeachingNode tchNode = dataContainer.TeachingNode.FirstOrDefault(node => node.Row_ID == osInfo.TchNodeID);
         osInfo.TchRoutineID = tchNode.RoutineID;
         return(View(osInfo));
     }
 }
예제 #10
0
 public ActionResult CashJournal_GetTemplate()
 {
     using (FATContainer dataContainer = new FATContainer())
     {
         JsonResult  result = new JsonResult();
         CashJournal cjInfo = dataContainer.CashJournal.Create();
         cjInfo.TimeMark = DateTime.Now;
         result.Data     = cjInfo;
         return(result);
     }
 }
예제 #11
0
 public ActionResult CashJournal_Init()
 {
     using (FATContainer dataContainer = new FATContainer())
     {
         CashJournal cjInfo = dataContainer.CashJournal.Create();
         cjInfo.TchNodeID = Convert.ToInt32(RouteData.Values["id"]);
         TeachingNode tchNode = dataContainer.TeachingNode.FirstOrDefault(node => node.Row_ID == cjInfo.TchNodeID);
         cjInfo.TchRoutineID = tchNode.RoutineID;
         return(View(cjInfo));
     }
 }
예제 #12
0
 public ActionResult DetailedLedger_GetTemplate()
 {
     using (FATContainer dataContainer = new FATContainer())
     {
         JsonResult     result = new JsonResult();
         DetailedLedger dlInfo = dataContainer.DetailedLedger.Create();
         dlInfo.TimeMark = DateTime.Now;
         result.Data     = dlInfo;
         return(result);
     }
 }
예제 #13
0
 public ActionResult GeneralLedger_GetTemplate()
 {
     using (FATContainer dataContainer = new FATContainer())
     {
         JsonResult    result = new JsonResult();
         GeneralLedger glInfo = dataContainer.GeneralLedger.Create();
         glInfo.TimeMark = DateTime.Now;
         result.Data     = glInfo;
         return(result);
     }
 }
예제 #14
0
 public ActionResult DetailedLedger_Init()
 {
     using (FATContainer dataContainer = new FATContainer())
     {
         DetailedLedger dlInfo = dataContainer.DetailedLedger.Create();
         dlInfo.TchNodeID = Convert.ToInt32(RouteData.Values["id"]);
         TeachingNode tchNode = dataContainer.TeachingNode.FirstOrDefault(node => node.Row_ID == dlInfo.TchNodeID);
         dlInfo.TchRoutineID = tchNode.RoutineID;
         return(View(dlInfo));
     }
 }
예제 #15
0
        public ActionResult AppendCase(TeachingRoutine routine)
        {
            using (FATContainer dataContainer = new FATContainer())
            {
                dataContainer.TeachingRoutine.Add(routine);
                dataContainer.SaveChanges();
            }
            JsonResult result = new JsonResult();

            result.Data = routine;
            return(result);
        }
예제 #16
0
        public ActionResult OuterSubject_Insert(OuterSubject info)
        {
            using (FATContainer dataContainer = new FATContainer())
            {
                dataContainer.OuterSubject.Add(info);
                dataContainer.SaveChanges();

                JsonResult result = new JsonResult();
                result.Data = info;
                return(result);
            }
        }
예제 #17
0
        public ActionResult CashJournal_Insert(CashJournal info)
        {
            using (FATContainer dataContainer = new FATContainer())
            {
                dataContainer.CashJournal.Add(info);
                dataContainer.SaveChanges();

                JsonResult result = new JsonResult();
                result.Data = info;
                return(result);
            }
        }
예제 #18
0
        public ActionResult DetailedLedger_Insert(DetailedLedger info)
        {
            using (FATContainer dataContainer = new FATContainer())
            {
                dataContainer.DetailedLedger.Add(info);
                dataContainer.SaveChanges();

                JsonResult result = new JsonResult();
                result.Data = info;
                return(result);
            }
        }
예제 #19
0
        public ActionResult AppendSubjectItem(SubjectItem subject)
        {
            using (FATContainer dbContainer = new FATContainer())
            {
                dbContainer.SubjectItem.Add(subject);
                dbContainer.SaveChanges();

                JsonResult result = new JsonResult();
                result.Data = subject;
                return(result);
            }
        }
예제 #20
0
 public ActionResult CustomerLedger_GetTemplate()
 {
     using (FATContainer dataContainer = new FATContainer())
     {
         JsonResult     result = new JsonResult();
         CustomerLedger clInfo = dataContainer.CustomerLedger.Create();
         clInfo.TimeMark    = DateTime.Now;
         clInfo.BalanceTime = DateTime.Now;
         result.Data        = clInfo;
         return(result);
     }
 }
예제 #21
0
        public ActionResult SaveMoneyRemittanceData(MoneyRemittance info)
        {
            using (FATContainer dataContainer = new FATContainer())
            {
                MoneyRemittance orgInfo = dataContainer.MoneyRemittance.Find(info.Row_ID);
                dataContainer.Entry <MoneyRemittance>(orgInfo).CurrentValues.SetValues(info);
                dataContainer.SaveChanges();

                JsonResult result = new JsonResult();
                result.Data = string.Empty;
                return(result);
            }
        }
예제 #22
0
        public ActionResult SaveDebitTransferCheckData(TransferCheck info)
        {
            using (FATContainer dataContainer = new FATContainer())
            {
                TransferCheck orgInfo = dataContainer.TransferCheck.Find(info.Row_ID);
                dataContainer.Entry <TransferCheck>(orgInfo).CurrentValues.SetValues(info);
                dataContainer.SaveChanges();

                JsonResult result = new JsonResult();
                result.Data = string.Empty;
                return(result);
            }
        }
예제 #23
0
        public ActionResult SaveIndividualSavingData(IndividualSaving info)
        {
            using (FATContainer dataContainer = new FATContainer())
            {
                IndividualSaving orgInfo = dataContainer.IndividualSaving.Find(info.Row_ID);
                dataContainer.Entry <IndividualSaving>(orgInfo).CurrentValues.SetValues(info);
                dataContainer.SaveChanges();

                JsonResult result = new JsonResult();
                result.Data = string.Empty;
                return(result);
            }
        }
예제 #24
0
        public ActionResult SaveCollectAcceptData(CollectAccept info)
        {
            using (FATContainer dataContainer = new FATContainer())
            {
                CollectAccept orgInfo = dataContainer.CollectAccept.Find(info.Row_ID);
                dataContainer.Entry <CollectAccept>(orgInfo).CurrentValues.SetValues(info);
                dataContainer.SaveChanges();

                JsonResult result = new JsonResult();
                result.Data = string.Empty;
                return(result);
            }
        }
예제 #25
0
        public ActionResult SaveBankDraftData(BankDraft info)
        {
            using (FATContainer dataContainer = new FATContainer())
            {
                BankDraft orgInfo = dataContainer.BankDraft.Find(info.Row_ID);
                dataContainer.Entry <BankDraft>(orgInfo).CurrentValues.SetValues(info);
                dataContainer.SaveChanges();

                JsonResult result = new JsonResult();
                result.Data = string.Empty;
                return(result);
            }
        }
예제 #26
0
        public ActionResult SaveEntrustCorpPaymentData(EntrustCorpPayment info)
        {
            using (FATContainer dataContainer = new FATContainer())
            {
                EntrustCorpPayment orgInfo = dataContainer.EntrustCorpPayment.Find(info.Row_ID);
                dataContainer.Entry <EntrustCorpPayment>(orgInfo).CurrentValues.SetValues(info);
                dataContainer.SaveChanges();

                JsonResult result = new JsonResult();
                result.Data = string.Empty;
                return(result);
            }
        }
예제 #27
0
        public ActionResult DetailedLedger_Update(DetailedLedger info)
        {
            using (FATContainer dataContainer = new FATContainer())
            {
                DetailedLedger existedInfo = dataContainer.DetailedLedger.FirstOrDefault(item => item.Row_ID == info.Row_ID);
                dataContainer.Entry <DetailedLedger>(existedInfo).CurrentValues.SetValues(info);
                dataContainer.SaveChanges();

                JsonResult result = new JsonResult();
                result.Data = info;
                return(result);
            }
        }
예제 #28
0
        public ActionResult SubjectFiller()
        {
            int             tchRoutineID = Convert.ToInt32(RouteData.Values["rid"]);
            int             tchNodeID    = Convert.ToInt32(RouteData.Values["nid"]);
            TeachingRoutine routine      = SharedCasePool.GetCasePool().GetRoutine(tchRoutineID);

            using (FATContainer dataContainer = new FATContainer())
            {
                List <SubjectItem> subjectList = dataContainer.SubjectItem.Where(s => s.TchNodeID == tchNodeID && s.TchRoutineID == tchRoutineID).OrderBy(s => s.SubjectOrient).ToList();
                ViewBag.ResourceFile = "T1_DebitTransferCheck_S12";
                return(View(subjectList));
            }
        }
예제 #29
0
 public ActionResult Guide()
 {
     using (FATContainer dataContainer = new FATContainer())
     {
         TeachingNode    node       = dataContainer.TeachingNode.Find(Convert.ToInt32(RouteData.Values["id"]));
         TeachingRoutine tchRoutine = SharedCasePool.GetCasePool().GetRoutine(node.RoutineID);
         ViewBag.CurrGroup    = tchRoutine.NodeList[node.Row_ID].GroupIdx;
         ViewBag.TchNodeID    = node.Row_ID;
         ViewBag.CaseName     = tchRoutine.CaseName;
         ViewBag.RoutineIntro = tchRoutine.GroupList[tchRoutine.NodeList[node.Row_ID].GroupIdx].RoutineIntro;
         return(View("RoutineStepProgress", tchRoutine));
     }
 }
예제 #30
0
 public ActionResult EditSubjectItem()
 {
     using (FATContainer dataContainer = new FATContainer())
     {
         TeachingNode tchNode = dataContainer.TeachingNode.Find(Convert.ToInt32(RouteData.Values["id"]));
         ViewBag.TchRoutineID = tchNode.RoutineID;
         ViewBag.TchNodeID    = tchNode.Row_ID;
         TemplateNode    tmpNode    = dataContainer.TemplateNode.FirstOrDefault(n => n.Row_ID == tchNode.TmpNodeID);
         TemplateRoutine tmpRoutine = dataContainer.TemplateRoutine.FirstOrDefault(n => n.Row_ID == tmpNode.RoutineID);
         ViewBag.NodeTitle = tmpRoutine.RoutineName + " " + tmpNode.NodeName + "记账科目设置";
     }
     return(View("EditSubjectItem1", new SubjectItem()));
 }