Exemplo n.º 1
0
        public ActionResult People_Update([DataSourceRequest]DataSourceRequest request, HRM.Models.Person person)
        {
            if (ModelState.IsValid)
            {
                var entity = new HRM.Models.Person
                {
                    BusinessEntityID = person.BusinessEntityID,
                    PersonType = person.PersonType,
                    NameStyle = person.NameStyle,
                    Title = person.Title,
                    FirstName = person.FirstName,
                    MiddleName = person.MiddleName,
                    LastName = person.LastName,
                    Suffix = person.Suffix,
                    EmailPromotion = person.EmailPromotion,
                    AdditionalContactInfo = person.AdditionalContactInfo,
                    Demographics = person.Demographics,
                    rowguid = person.rowguid,
                    ModifiedDate = DateTime.Now
                };

                db.People.Attach(entity);
                db.Entry(entity).State = System.Data.Entity.EntityState.Modified;
                db.SaveChanges();
            }

            return Json(new[] { person }.ToDataSourceResult(request, ModelState));
        }
Exemplo n.º 2
0
        public ActionResult People_Create([DataSourceRequest]DataSourceRequest request, HRM.Models.Person person)
        {
            if (ModelState.IsValid)
            {
                var entity = new HRM.Models.Person
                {
                    BusinessEntityID = person.BusinessEntityID,
                    PersonType = person.PersonType,
                    NameStyle = person.NameStyle,
                    Title = person.Title,
                    FirstName = person.FirstName,
                    MiddleName = person.MiddleName,
                    LastName = person.LastName,
                    Suffix = person.Suffix,
                    EmailPromotion = person.EmailPromotion, 
                    rowguid = person.rowguid,
                    ModifiedDate = DateTime.Now
                };

                db.People.Add(entity);
                db.SaveChanges();
                person.BusinessEntityID = entity.BusinessEntityID;
            }

            return Json(new[] { person }.ToDataSourceResult(request, ModelState));
        }
Exemplo n.º 3
0
        private void PrivilegeResponseHandler(object sender, RequestResponseEventArgs e)
        {
            if (e.cause == CallCause.Error)
            {
                return;
            }

            switch (e.result)
            {
            case RequestResult.AllowForever:
                CreateHRM();
                HRM.Start();
                break;

            case RequestResult.DenyForever:
            case RequestResult.DenyOnce:
                break;
            }
        }
Exemplo n.º 4
0
        public async Task <HttpResponseMessage> PostExternalAsnc()
        {
            //http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", myAuthService.getToken());
            MailBabyPost M = new MailBabyPost();

            M.to.Add(new MailBabyEmail("*****@*****.**", "Josh"));
            M.subject = "Website test";
            M.body    = "This is the body of the email.";
            M.from    = new MailBabyEmail("*****@*****.**", "APON");
            HttpRequestMessage request = new HttpRequestMessage
            {
                Method     = HttpMethod.Post,
                RequestUri = new Uri("https://api.mailbaby.net/mail/send"),
                Headers    =
                {
                    { "X-API-KEY", "2duk7aOz97hBoAIjiXOPU8yT1N4wIMB8Xe9EvJGguwLrJJnF5neDhN4W7OYuAiBGlBMYcMzXdC5IoQNsh3tEDm7kPaL2fbsSNiR1bgVRKHrYyfGRXz2QG4fBda8w8oI3" },
                },
                Content = new FormUrlEncodedContent(new Dictionary <string, string>
                {
                    { "to", M.to[0].email },
                    { "from", M.from.email },
                    { "subject", M.subject },
                    { "body", M.body },
                }),
            };
            HttpResponseMessage HRM;

            using (HRM = await http.SendAsync(request))
            {
                HRM.EnsureSuccessStatusCode();
                var body = await HRM.Content.ReadAsStringAsync();

                Console.WriteLine(body);
            }



            return(HRM);
        }
Exemplo n.º 5
0
        public UI.Controls.Menu.SiteMapNode CreateMenuForCustomReport(HRM.Presentation.UI.Controls.Menu.XmlSiteMap sitemap, List<Rep_MasterModel> ListMaster, ModuleName module, string alias)
        {
            List<Rep_MasterModel> item = ListMaster.Where(m => m.ReportStoreModule == module.ToString()).ToList();
            if (item != null && item.Count > 0)
            {
                //Add menu cha
                HRM.Presentation.UI.Controls.Menu.SiteMapNode node = new UI.Controls.Menu.SiteMapNode();
                node.ControllerName = "Sys_CustomReport";
                node.ActionName = "GeneralCustomReport";
                node.HrmWebSite = "Hrm_Sys_Web";
                //node.Alias = ConstantPathWeb.Hrm_Main_Web;
                node.RouteValues = sitemap.RootNode.ChildNodes.LastOrDefault().RouteValues;
                node.ImageUrl = "/Content/images/icons/submenu/menu/Att_ShiftTimeSheet.png";
                node.Title = "Báo Cáo Động";
                node.Visible = true;
                node.ChildNodes = new List<UI.Controls.Menu.SiteMapNode>();

                foreach (var t in item)
                {
                    HRM.Presentation.UI.Controls.Menu.SiteMapNode nodeitem = new UI.Controls.Menu.SiteMapNode();
                    nodeitem.ControllerName = "Sys_CustomReport";
                    nodeitem.ActionName = "GeneralCustomReport?id=" + t.ID;
                    nodeitem.HrmWebSite = "Hrm_Sys_Web";
                    nodeitem.Alias = alias;
                    //nodeitem.Alias = ConstantPathWeb.Hrm_Main_Web;
                    nodeitem.Url = "#" + nodeitem.HrmWebSite + "/" + nodeitem.ControllerName + "/" + nodeitem.ActionName;
                    nodeitem.RouteValues = sitemap.RootNode.ChildNodes.LastOrDefault().RouteValues;
                    nodeitem.ImageUrl = "/Content/images/icons/submenu/menu/Att_ShiftTimeSheet.png";
                    nodeitem.Title = t.ReportName;
                    nodeitem.Visible = true;
                    node.ChildNodes.Add(nodeitem);
                }
                return node;
            }
            return null;
        }
Exemplo n.º 6
0
 protected override void OnDisappearing()
 {
     base.OnDisappearing();
     HRM?.Stop();
 }
Exemplo n.º 7
0
 protected override void OnAppearing()
 {
     base.OnAppearing();
     SetupPrivilegeHandler();
     HRM?.Start();
 }