コード例 #1
0
        public CommonGroundsForm(LoginForm loginParent)
        {
            loginForm  = loginParent;
            Controller = loginForm.Controller;

            InitializeComponent();
            Initialize();
        }
コード例 #2
0
        private GetAllStateForMobileResponse getStates(GetAllStateForMobileRequest stateRequest, string token)
        {
            CommonController             stateController = new CommonController();
            GetAllStateForMobileResponse sResponse;

            sResponse = stateController.GetAllStateByCountryID(stateRequest, token);
            return(sResponse);
        }
コード例 #3
0
        private GetAllCountryForMobileResponse getAllCountry(string access_token)
        {
            CommonController commonControllerCountry = new CommonController();
            GetAllCountryForMobileResponse countryResponse;

            countryResponse = commonControllerCountry.GetAllCountry(access_token);
            return(countryResponse);
        }
コード例 #4
0
        public void TestGetDepartments()
        {
            CommonController c = new CommonController();
            //var getDeptsResult = c.GetDepartments() as JsonResult; // This line throwing errors due to non-referenced Microsoft ASP stuff

            //dynamic x = getDeptsResult.Value;

            //Assert.Equal(3, x.Length);
        }
コード例 #5
0
ファイル: RecDocument.cs プロジェクト: qq735818249/HXEPC_CS
        /// <summary>
        /// 收文流程设置通过回复并提交到下一流程
        /// </summary>
        /// <param name="sid"></param>
        /// <param name="DocKeyword"></param>
        /// <returns></returns>
        public static JObject RecWorflowPassReplyState(string sid, string DocKeyword)
        {
            ExReJObject reJo = new ExReJObject();

            try
            {
                User curUser = DBSourceController.GetCurrentUser(sid);
                if (curUser == null)
                {
                    reJo.msg = "登录验证失败!请尝试重新登录!";
                    return(reJo.Value);
                }

                DBSource dbsource = curUser.dBSource;
                if (dbsource == null)
                {
                    reJo.msg = "登录验证失败!请尝试重新登录!";
                    return(reJo.Value);
                }

                Doc m_Doc = dbsource.GetDocByKeyWord(DocKeyword);

                if (m_Doc == null)
                {
                    reJo.msg = "参数错误!文档不存在!";
                    return(reJo.Value);
                }

                WorkFlow flow = m_Doc.WorkFlow;
                flow.O_suser3 = "pass";
                flow.Modify();

                WorkStateBranch wsb = null;
                // m_Doc.WorkFlow.
                wsb = flow.CuWorkState.workStateBranchList.Find(w => w.defStateBrach.O_Description == "回复");
                if (wsb == null)
                {
                    reJo.msg = "流程分支不存在!";
                    return(reJo.Value);
                }

                ExReJObject GotoNextReJo = WebWorkFlowEvent.GotoNextStateAndSelectUser(wsb);// flow.CuWorkState.workStateBranchList[0]);

                if (!GotoNextReJo.success)
                {
                }
                reJo.success = true;
                return(reJo.Value);
            }
            catch (Exception e)
            {
                reJo.msg = e.Message;
                CommonController.WebWriteLog(reJo.msg);
            }
            return(reJo.Value);
        }
コード例 #6
0
        /// <summary>
        /// Get all books of the required category.
        /// </summary>
        /// <param name="category"></param>
        /// <returns></returns>
        public List <BookModel> Post([FromBody] String category)
        {
            CommonController            commonController = HttpContext.Current.Session["CommonController"] as CommonController;
            Dictionary <String, Object> data             = new Dictionary <String, Object>();

            data.Add("category", category);
            List <BookModel> returnData = commonController.ExecuteOperation(OperationType.ReadByCategory, data) as List <BookModel>;

            return(returnData);
        }
コード例 #7
0
        /// <summary>
        /// Get book by its id
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public List <BookModel> GetBookById(Int32 id)
        {
            CommonController            commonController = HttpContext.Current.Session["CommonController"] as CommonController;
            Dictionary <String, Object> data             = new Dictionary <String, Object>();

            data.Add("id", id);
            List <BookModel> returnData = commonController.ExecuteOperation(OperationType.ReadById, data) as List <BookModel>;

            return(returnData);
        }
コード例 #8
0
        public CommonGroundsForm()
        {
            Controller            = new CommonController();
            Controller.Permission = new Models.Permission();
            Controller.Permission.PermissionID = 5; // Admin
            this.FormClosed -= CommonGroundsForm_FormClosed;

            InitializeComponent();
            Initialize();
        }
コード例 #9
0
 public void Initialize(CommonController controller)
 {
     Controller = controller;
     activityDataSource.DataSource = new Activity();
     populateActivityTree();
     PopulateActivityTypeSelector();
     PopulateTripLeaderSelector();
     PopulateVehicleSelector();
     PopulateIndividualTypeFilter();
 }
コード例 #10
0
ファイル: Do.ashx.cs プロジェクト: wkxuan/code
 public void ProcessRequest(HttpContext context)
 {
     var res = new CommonController().Do(new RequestDTO()
     {
         SecretKey = HttpExtension.GetRequestParam("SecretKey"),
         ServiceName = HttpExtension.GetRequestParam("ServiceName"),
         Context = HttpExtension.GetRequestParam("Context")
     });
     context.Response.ContentType = "text/plain";
     context.Response.Write(res.ToJson());
 }
コード例 #11
0
        public void GetServicesAndChannels_ModelIsNull()
        {
            // Arrange
            var controller = new CommonController(commonService, codeService, userService, settings, logger);

            // Act
            Action act = () => controller.GetServicesAndChannels(null, null);

            // Assert
            act.ShouldThrow <Exception>();
        }
コード例 #12
0
        public void GetServicesAndChannels_OrganizationNotExists()
        {
            // Arrange
            commonServiceMockSetup.Setup(s => s.OrganizationExists(It.IsAny <Guid>(), PublishingStatus.Published)).Returns(false);
            var controller = new CommonController(commonServiceMockSetup.Object, codeService, userService, settings, logger);

            // Act
            var result = controller.GetServicesAndChannels(Guid.NewGuid().ToString(), null);

            // Assert
            result.Should().BeOfType <NotFoundObjectResult>();
        }
コード例 #13
0
        /// <summary>
        /// Helper method to get test controller
        /// </summary>
        /// <param name="url">Url</param>
        /// <param name="method">Http method</param>
        /// <returns>CommonController instance</returns>
        private CommonController GetTestController(string url, string method)
        {
            var controller = new CommonController
            {
                Request = new HttpRequestMessage {
                    RequestUri = new Uri(url), Method = new HttpMethod(method)
                },
                Configuration = new HttpConfiguration()
            };

            return(controller);
        }
コード例 #14
0
ファイル: UnitTest1.cs プロジェクト: liamzhou77/LMS
        public void TestGetDepartments()
        {
            CommonController c = new CommonController();

            c.UseLMSContext(MakeMockDB());

            var     allDepartmentsResult = c.GetDepartments() as JsonResult;
            dynamic values = allDepartmentsResult.Value;

            Assert.Equal(3, values.Length);
            var x = values[0];
        }
コード例 #15
0
        public void CanGetStudentUser()
        {
            CommonController common = new CommonController();
            Team55LMSContext db     = MakeStudentUser();

            common.UseLMSContext(db);

            var     studentUser = common.GetUser("u0000001") as JsonResult;
            dynamic result      = studentUser.Value;

            Assert.Equal("{ fname = Tony, lname = Diep, uid = u0000001, department = CS }", result.ToString());
        }
コード例 #16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            #region Initialize Controller

            CommonController commonController;
            if (Session.IsNewSession)
            {
                commonController = new CommonController();
                Session.Add("CommonController", commonController);
            }

            #endregion Initialize Controller
        }
コード例 #17
0
        public void GetBrands_ReturnsList(Type type)
        {
            // Arrange
            var controller = new CommonController();

            // Act
            var result = controller.GetBrands();

            // Assert
            var actionResult = Assert.IsType <ActionResult <IEnumerable <string> > >(result);

            Assert.IsType(type, actionResult.Result);
        }
コード例 #18
0
ファイル: login.ashx.cs プロジェクト: Belliy8899/CCDSolution
        public string checkingUserPas(string UserName, string PassWord)
        {
            string      count    = "0";
            List <User> listUser = CommonController.GetUserList().ToList();

            if (listUser != null)
            {
                if (listUser.Where(c => c.department == UserName && c.password == PassWord).Count() > 0)
                {
                    count = listUser.Where(c => c.department == UserName && c.password == PassWord).Count().ToString();
                }
            }
            return(count);
        }
コード例 #19
0
 public void Load_Session_Warning()
 {
     var routes = new RouteCollection();
     Console.WriteLine("Load Session Warning.\n");
     MRPEntities db = new MRPEntities();
     HttpContext.Current = DataHelper.SetUserAndPermission();
     CommonController objCommonController = new CommonController();
     objCommonController.ControllerContext = new ControllerContext(MockHelpers.FakeUrlHelper.FakeHttpContext(), new RouteData(), objCommonController);
     objCommonController.Url = MockHelpers.FakeUrlHelper.UrlHelper();
     var result = objCommonController.LoadSessionWarning() as PartialViewResult;
     Console.WriteLine(System.Reflection.MethodBase.GetCurrentMethod().Name + "\n The Assert Value result.ViewName:  " + result.ViewName);
     Assert.IsNotNull(result.ViewName);
    
 }
コード例 #20
0
 public HttpResponseMessage DoImport()
 {
     try
     {
         string LocalResourceFile = CommonController.ResolveUrl("App_LocalResources/MainControl", true);
         string Result            = CommonController.DoImport(this.PortalSettings, LocalResourceFile, this.UserInfo);
         return(Request.CreateResponse(HttpStatusCode.OK, Result));
     }
     catch (System.Exception ex)
     {
         DotNetNuke.Services.Exceptions.Exceptions.LogException(ex);
         return(Request.CreateResponse(HttpStatusCode.InternalServerError, ex.Message));
     }
 }
コード例 #21
0
        private async void SubmitBtn_Clicked(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(nameEntry.Text))
            {
                await PopupNavigation.Instance.PushAsync(new Error_popup("Please enter a name."));
            }
            else if (!new EmailAddressAttribute().IsValid(emailEntry.Text) || string.IsNullOrEmpty(emailEntry.Text))
            {
                await PopupNavigation.Instance.PushAsync(new Error_popup("Please enter a valid email address"));
            }
            else if (string.IsNullOrEmpty(phoneEntry.Text) || phoneEntry.Text.Length < 10 || phoneEntry.Text.Length > 20)
            {
                await PopupNavigation.Instance.PushAsync(new Error_popup("Please enter a valid contactNo."));
            }
            else if (string.IsNullOrEmpty(subjectEntry.Text))
            {
                await PopupNavigation.Instance.PushAsync(new Error_popup("Please enter a subject"));
            }
            else if (string.IsNullOrEmpty(messageEntry.Text))
            {
                await PopupNavigation.Instance.PushAsync(new Error_popup("Please enter your message"));
            }
            else
            {
                emailContactusReq.email       = emailEntry.Text;
                emailContactusReq.name        = nameEntry.Text;
                emailContactusReq.phonenumber = phoneEntry.Text;
                emailContactusReq.subject     = subjectEntry.Text;
                emailContactusReq.message     = messageEntry.Text;
                emailContactusReq.templatekey = "EmailTemplateCSD";

                CommonController controller = new CommonController();
                try
                {
                    emailContactusRes = controller.contactUs(emailContactusReq, token);
                }
                catch (Exception ex)
                {
                    await PopupNavigation.Instance.PushAsync(new ErrorWithClosePagePopup(ex.Message));
                }
                if (emailContactusRes != null)
                {
                    if (emailContactusRes.message.ErrorCode == "200")
                    {
                        await PopupNavigation.Instance.PushAsync(new SuccessWithClosePopup("Your information saved successfully"));
                    }
                }
            }
        }
コード例 #22
0
        public static void AssemblyInit(TestContext context)
        {
            AppFactory            factory = new AppFactory(true);
            CommonControllerModel model   = new CommonControllerModel()
            {
                AppFactory          = factory,
                AppRootFilePath     = factory.AppPath,
                SiteCommonFilePath  = factory.SiteCommonPath,
                ServiceRootFilePath = factory.SiteCommonPath + "../",
                Source = "TEST",
            };

            Controller = new CommonController(model);
            Credential.Load();
        }
コード例 #23
0
        public void GetServicesAndChannels_OrganizationExists()
        {
            // Arrange
            commonServiceMockSetup.Setup(s => s.OrganizationExists(It.IsAny <Guid>(), PublishingStatus.Published)).Returns(true);
            var page = 1; var pageSize = 10;

            commonServiceMockSetup.Setup(s => s.GetServicesAndChannelsByOrganization(It.IsAny <Guid>(), null, page, pageSize)).Returns(new VmOpenApiEntityGuidPage(page, pageSize));
            var controller = new CommonController(commonServiceMockSetup.Object, codeService, userService, settings, logger);

            // Act
            var result = controller.GetServicesAndChannels(Guid.NewGuid().ToString(), null, page);

            // Assert
            result.Should().BeOfType <OkObjectResult>();
        }
コード例 #24
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="elementSelect"></param>
        /// <param name="option"></param>
        public void SetSelectElement(IWebElement elementSelect, string option)
        {
            var inputProcess = CommonController.InputProcess(option);

            var finalOption = option.Trim();

            var select = new SelectElement(elementSelect);


            //select.SelectByText(finalOption);
            select.WrappedElement.Click();
            select.WrappedElement.SendKeys(finalOption);
            //select.WrappedElement.Click(); or select.WrappedElement.SendKeys(Keys.Enter); is the same.
            select.WrappedElement.SendKeys(Keys.Enter);
        }
コード例 #25
0
        private async void detailsEdit_btn_Click(object sender, RoutedEventArgs e)
        {
            CommonController controller = new CommonController();
            int status = controller.idCheck(incexp.Id);

            if (status == 1)
            {
                MessageDialog msg = new MessageDialog("You cannot edit this transaction here!");
                await msg.ShowAsync();
            }
            else
            {
                Frame.Navigate(typeof(AddIncExp), incexp);
            }
        }
コード例 #26
0
ファイル: Document.cs プロジェクト: qq735818249/HXEPC_CS
        public static ExReJObject OnAfterCreateNewObject(object obj)
        {
            ExReJObject reJo = new ExReJObject();

            reJo.success = true;
            try
            {
                //判断是否设置了主设
                //查找设计阶段
                //找设计阶段
                Doc     doc       = (Doc)obj;
                Project m_Project = doc.Project;


                //收文目录可以使用
                if (m_Project.TempDefn == null || m_Project.TempDefn.KeyWord != "COM_COMTYPE")
                {
                    //当success返回true,msg返回""时,继续上传文件
                    reJo.success = true;
                    return(reJo);
                }

                ////放置在函件单位下的分类目录下
                if (m_Project != null && m_Project.TempDefn != null && m_Project.TempDefn.KeyWord == "COM_COMTYPE" &&
                    (m_Project.ParentProject.Code == "收文" || m_Project.ParentProject.Description == "收文"))
                {
                    reJo.msg  = "RecDocument";
                    reJo.data = new JArray(new JObject(
                                               new JProperty("plugins", "HXEPC_Plugins"),
                                               new JProperty("FuncName", "recDocument"),
                                               new JProperty("DocKeyword", doc.KeyWord),
                                               new JProperty("ProjectKeyword", doc.Project.KeyWord)
                                               ));

                    //当返回false时,向客户端发送返回,返回为true时,就不向客户端返回
                    reJo.success = false;
                    return(reJo);
                }
                reJo.success = true;
                return(reJo);
            }
            catch (Exception e)
            {
                reJo.msg = e.Message;
                CommonController.WebWriteLog(reJo.msg);
            }
            return(reJo);
        }
コード例 #27
0
        private GetAllLocationForClientIDForMobileResponse getAllLocationsByClientId(GetAllLocationForClientIDForMobileRequest locationRequest, string _token)
        {
            CommonController commoncontroller = new CommonController();
            GetAllLocationForClientIDForMobileResponse locations = null;

            try

            {
                locations = commoncontroller.getAllLocationsByClientId(locationRequest, _token);
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(locations);
        }
コード例 #28
0
        public void CanGetDepartments()
        {
            CommonController common = new CommonController();
            Team55LMSContext db     = MakeDepartments();

            common.UseLMSContext(db);

            var     departments = common.GetDepartments() as JsonResult;
            dynamic result      = departments.Value;

            var departmentsQuery = from depart in db.Departments
                                   select depart;

            Assert.Equal("{ name = Psychology, subject = PSY }", result[0].ToString());
            Assert.Equal("{ name = Civil Engineering, subject = CVEN }", result[1].ToString());
            Assert.Equal(2, departmentsQuery.Count());
        }
コード例 #29
0
ファイル: Document.cs プロジェクト: qq735818249/HXEPC_CS
        public static JObject GetDepartmentSecUser(string sid, string DepartmentList)
        {
            ExReJObject reJo = new ExReJObject();

            try
            {
                User curUser = DBSourceController.GetCurrentUser(sid);
                if (curUser == null)
                {
                    reJo.msg = "登录验证失败!请尝试重新登录!";
                    return(reJo.Value);
                }

                DBSource dbsource = curUser.dBSource;
                if (dbsource == null)
                {
                    reJo.msg = "登录验证失败!请尝试重新登录!";
                    return(reJo.Value);
                }

                string[] strArry = DepartmentList.Split(new char[] { ',' });
                //bool isAdd = false;
                string resultUserList = "";
                foreach (string strDepartment in strArry)
                {
                    resultUserList = resultUserList + CommonFunction.GetSecUserByDepartmentCode(dbsource, strDepartment) + ";";
                }

                if (!string.IsNullOrEmpty(resultUserList))
                {
                    resultUserList = resultUserList.Substring(0, resultUserList.Length - 1);
                }

                reJo.data = new JArray(new JObject(new JProperty("userList", resultUserList)));

                reJo.success = true;
                return(reJo.Value);
            }
            catch (Exception e)
            {
                reJo.msg = e.Message;
                CommonController.WebWriteLog(reJo.msg);
            }

            return(reJo.Value);
        }
コード例 #30
0
        private async void dDeposit_btn_Click(object sender, RoutedEventArgs e)
        {
            double amount = Convert.ToDouble(dAmount_box.Text);
            String date   = dDate_box.Date.ToString();


            if (amount == 0)
            {
                MessageDialog msg = new MessageDialog("Amount cannot be 0!");
                await msg.ShowAsync();
            }
            else if (amount < 0)
            {
                MessageDialog msg = new MessageDialog("Amount cannot be less than 0!");
                await msg.ShowAsync();
            }
            else
            {
                CommonController        comCont = new CommonController();
                IncomeExpenseController ieCont  = new IncomeExpenseController();

                String ieID = comCont.idGenerator("ie");
                String stID = comCont.idGenerator("st");

                IncExp            incexp     = new IncExp(savings.Name + "[Transaction]", amount, "default_null", "default_null", "Saving transaction - depost", ieID, "default_null", false, "AC_ID123");
                SmallTransactions sTrans     = new SmallTransactions(amount, "", 'd', savings.Id, stID, date, "AC_ID123");
                SavingsController controller = new SavingsController();
                int status  = controller.addDepositWithdraw(sTrans);
                int status2 = ieCont.addTransaction(incexp);
                int status3 = comCont.insertMoreIDs(ieID, savings.Id, stID);

                if (status == 1 && status2 == 1 && status3 == 1)
                {
                    MessageDialog msg = new MessageDialog("Successfully deposited!");
                    await msg.ShowAsync();

                    Frame.Navigate(typeof(SavingsDetails), savings);
                }
                else
                {
                    MessageDialog msg = new MessageDialog("Failed to deposit!");
                    await msg.ShowAsync();
                }
            }
        }
コード例 #31
0
ファイル: ViewWankathon.cs プロジェクト: nofuture-git/31g
 public ViewWankathon()
 {
     _cc = new CommonController();
 }