private void EditData() { try { SupportImpl obj = new SupportImpl(); SupportInfo item = obj.GetInfo(int.Parse(Request.QueryString["ID"])); if (item == null) { Response.Redirect(Utility.UrlRoot + Config.PathError, false); return; } else { txtName.Text = item.s_Name; txtEmail.Text = item.s_Email; txtMobile.Text = item.s_Mobile; txtSkype.Text = item.s_Skype; txtYahoo.Text = item.s_Yahoo; } } catch { Response.Redirect(Utility.UrlRoot + Config.PathError, false); return; } }
// FUnction , Action Method public IActionResult Index() { var supportInfo = new SupportInfo { Address = "New Delhi , India", PhoneNumber = "999999999", Email = "*****@*****.**" }; return(View(supportInfo)); }
/// <summary> /// Generates the support information for the calling application. /// </summary> // Revision History // MM/DD/YY who Version Issue# Description // -------- --- ------- ------ --------------------------------------- // 10/13/08 RCG 2.00.00 N/A Created private void GenerateSupportInfo() { m_LicenseSupportInfo = new SupportInfo(); m_LicenseSupportInfo.Company = Application.CompanyName; m_LicenseSupportInfo.Product = m_ApplicationName; m_LicenseSupportInfo.ProductVersion = Application.ProductVersion; m_LicenseSupportInfo.Email = "*****@*****.**"; m_LicenseSupportInfo.Phone = "(864)718-8300"; m_LicenseSupportInfo.Website = @"http://www.itron.com/pages/resources_support.asp"; }
public void AddSupport(string fname, string lname, string school, string city, string comment) { SupportInfo si = new SupportInfo(); si.firstName = fname; si.lastName = lname; si.school = school; si.city = city; si.comment = comment; supportsList.Add(si); }
private void EditData(int Id) { SupportInfo obj = SupportManager.Select((int)Id); txtTitle.Text = obj.Title; txtNicknam.Text = obj.Yahoo; txtPhone.Text = obj.Phone; DropDownList1.SelectedValue = obj.Type.ToString(); vID = obj.ID; EditPanel.Enabled = true; }
public ActionResult Contact() { SupportInfo supportinfo = new SupportInfo(); long uid = Convert.ToInt64(Session["UserID"]); var objuser = db.UserProfiles.Where(usr => usr.UserId == uid).FirstOrDefault(); if (objuser != null) { ViewBag.UserName = objuser.FirstName + ' ' + objuser.LastName; ViewBag.UserEmail = objuser.EmailAddress; } return(View(supportinfo)); }
public int Insert(SupportInfo support) { var param = new[] { new SqlParameter("@s_Name", support.s_Name), new SqlParameter("@s_Email", support.s_Email), new SqlParameter("@s_Mobile", support.s_Mobile), new SqlParameter("@s_Yahoo", support.s_Yahoo), new SqlParameter("@s_Skype", support.s_Skype) }; var result = DataHelper.ExecuteNonQuery(Config.ConnectionString, "usp_Support_INSERT", param); return(result); }
/// <summary> /// 标签分类 /// </summary> /// <param name="tag"></param> /// <returns></returns> public ActionResult TagPages() { string tag = Request.Params[0] ?? null; Session["SupportInfo"] = new SupportInfo { Navindex = 0, TagIndex = tag }; //CUR_SupportInfo.TagIndex = tag; //CUR_SupportInfo.Navindex = 0;//置为0 int total = 0; var list = _IArticleService.TagPages(tag, 1, 10, out total); ViewBag.Total = total; ViewBag.Loaded = (total <= 10 ? total : 10); return View(list); }
public ActionResult Create(SupportInfo model) { try { if (ModelState.IsValid) { this.supportInfoRepo.Insert(model); ViewBag.Message = "Record addded successfully."; } return(View(model)); } catch (Exception ex) { ViewBag.Message = ex.Message; return(View(model)); } }
/// <summary> /// 网站首页 /// </summary> /// <returns></returns> public ActionResult Index(int index = 0) { var supportInfo = new SupportInfo() { Navindex = 0, TagIndex = "" }; Session["SupportInfo"] = supportInfo; CUR_SupportInfo.Navindex = index;//导航 int total = 0; var list = _IArticleService.CategoryPage(1, 10, index.ToString(), out total); ViewBag.Total = total; ViewBag.Loaded = (total <= 10 ? total : 10); ViewBag.Index = index; return View(list); }
/// <summary> /// Updates application context /// </summary> public override void UpdateContext() { base.UpdateContext(); TesterInfo testerInfo = new TesterInfo(); testerInfo.Operator = View.OperatorName; testerInfo.Organization = View.OrganizationName; testerInfo.Address = View.OrganizationAddress; DeviceInfo deviceInfo = new DeviceInfo(); deviceInfo.Manufacturer = View.Brand; deviceInfo.Model = View.Model; deviceInfo.ProductName = View.OnvifProductName; deviceInfo.ProductTypesAll = View.ProductTypesAll; deviceInfo.ProductTypes = View.ProductTypes; deviceInfo.ProductTypesOther = View.ProductTypesOther; MemberInfo memberInfo = new MemberInfo(); memberInfo.Address = View.MemberAddress; memberInfo.Name = View.MemberName; SupportInfo supportInfo = new SupportInfo(); supportInfo.InternationalAddress = View.InternationalAddress; supportInfo.RegionalAddress = View.RegionalAddress; supportInfo.SupportUrl = View.SupportUrl; supportInfo.SupportEmail = View.SupportEmail; supportInfo.SupportPhone = View.SupportPhone; SetupInfo setupInfo = new SetupInfo(); setupInfo.DevInfo = deviceInfo; setupInfo.OtherInfo = View.OtherInformation; setupInfo.TesterInfo = testerInfo; setupInfo.MemberInfo = memberInfo; setupInfo.SupportInfo = supportInfo; ContextController.UpdateSetupInfo(setupInfo); }
public SupportInfo GetInfo(int pk_ID) { var param = new[] { new SqlParameter("@pk_ID", pk_ID) }; SupportInfo support = null; var r = DataHelper.ExecuteReader(Config.ConnectionString, "usp_Support_GetDetail", param); while (r.Read()) { support = new SupportInfo { pk_Id = (int)r["pk_ID"], s_Mobile = r["s_Mobile"].ToString(), s_Email = r["s_Email"].ToString(), s_Skype = r["s_Skype"].ToString(), s_Name = r["s_Name"].ToString(), s_Yahoo = r["s_Yahoo"].ToString() }; } r.Close(); r.Dispose(); return(support); }
protected void SaveData() { try { if (vID != null) { //Edit on the object. int Id; if (int.TryParse(vID.ToString(), out Id)) { SupportInfo obj = SupportManager.Select(Id); obj.Title = txtTitle.Text; obj.Yahoo = txtNicknam.Text; obj.Phone = txtPhone.Text; obj.Type = int.Parse(DropDownList1.SelectedValue); SupportManager.Update(obj); } } else { //this is a new object. SupportInfo obj = new SupportInfo(); obj.Title = txtTitle.Text; obj.Yahoo = txtNicknam.Text; obj.Phone = txtPhone.Text; obj.Type = int.Parse(DropDownList1.SelectedValue);; SupportManager.Insert(obj); } lblMessage.Text = "Đã lưu dữ liệu thành công!"; EditPanel.Enabled = false; BindData(); vID = null; } catch (Exception ex) { lblMessage.Text = ex.Message; } }
private void GenerateSupport() { for (int i = 0; i < supportIndexs.Count; i++) { GameObject obj = null; obj = Common.Generate(DataController.prefabPath_Character + supportIndexs[i], transSupport); Vector3 pos = new Vector3(DataController.instance.supportPosX, 0, 0); obj.transform.position = pos; obj.transform.DOMove(new Vector3(DataController.instance.supportPosX, 0, DataController.instance.supportPosZ[i]), 0.5f); // SupportInfo info = obj.GetComponent <SupportInfo>(); info.Init(supportIndexs[i], true); // CardInfo cardInfo = info.cardInfo; cardInfo.myTag = Tag.Support; cardInfo.isEnemy = false; cardInfo.Hp = GameManager.BackCardHp(info.myIndex); cardInfo.Atk = GameManager.BackCardAtk(info.myIndex); cardInfo.myName = "支援->" + (int)info.myIndex; cardInfo.SetInit(); // showSupport.Add(info); } }
public void OnTriggerEnter(Collider other) { if (isHit) { return; } string info = ""; GameObject obj = other.gameObject; switch (obj.tag) { case nameof(Tag.Player): isHit = true; info = "船只撞击->" + other.gameObject.name; CharacterInfo cInfo = obj.GetComponent <CharacterInfo>(); cInfo.BeShoot(cardInfo.Atk); break; case nameof(Tag.Support): isHit = true; info = "船只撞击->" + other.gameObject.name; SupportInfo sInfo = obj.GetComponent <SupportInfo>(); sInfo.BeShoot(cardInfo.Atk); break; } if (info != "") { Debug.LogError(info); } if (isHit) { PoolDestroy(); } }
public void TrrigerLogic(Collider coll) { if (isHit) { return; } string info = ""; GameObject obj = coll.gameObject; switch (obj.tag) { case nameof(Tag.Enemy): if (myTag != Tag.Player) { return; } else { targetTag = Tag.Enemy; isHit = true; //info += obj.tag + "/" + obj.name; CharacterInfo cInfo = obj.GetComponent <CharacterInfo>(); cInfo.BeShoot(Atk); } break; case nameof(Tag.Player): if (myTag != Tag.Player) { targetTag = Tag.Player; isHit = true; //info += obj.tag + "/" + obj.name; CharacterInfo cInfo = obj.GetComponent <CharacterInfo>(); cInfo.BeShoot(Atk); } else { return; } break; case nameof(Tag.Support): if (myTag != Tag.Player) { targetTag = Tag.Player; isHit = true; //info += obj.tag + "/" + obj.name; SupportInfo sInfo = obj.GetComponent <SupportInfo>(); sInfo.BeShoot(Atk); } else { return; } //info += myTag + "子弹射中Support"; break; case nameof(Tag.Bullet): //info += " 子弹都能射中?"; break; case nameof(Tag.Boat): if (myTag != Tag.Player) { return; } else { targetTag = Tag.Boat; isHit = true; BoatInfo bInfo = obj.GetComponent <BoatInfo>(); bInfo.BeShoot(Atk); } break; default: info += "未判断的Tag->" + obj.tag + "/" + obj.name; break; } if (info != "") { Debug.LogError(info); } if (isHit) { PoolDestroy(); } }
public ActionResult Contact(SupportInfo supportinfo) { bool SupportFileExist = false; string attachfilepath = ""; string fPath = ""; if (Request.Files.Count > 0) { foreach (string file in Request.Files) { if (file.ToLower() == "supportfilepath") { HttpPostedFileBase hpf = Request.Files[file]; if (hpf.FileName != "") { string extension = System.IO.Path.GetExtension(hpf.FileName); string fname = ""; do { fname = Guid.NewGuid().ToString(); } while (!Common.IsValidFileName(Guid.NewGuid().ToString(), true)); string path1 = string.Format("{0}/{1}", Server.MapPath("~/Content/Uploads/Contents/Support"), fname + extension); hpf.SaveAs(path1); attachfilepath = path1; fPath = "/Content/Uploads/Contents/Support/" + fname + extension; SupportFileExist = true; } } } } // save the SupportInfo object in database. SupportInfo ObjSupport = new SupportInfo(); // create object of SupportInfo table to save the record ObjSupport.Summary = supportinfo.Summary; ObjSupport.Description = supportinfo.Description; if (SupportFileExist == true) { ObjSupport.FilePath = fPath; } ObjSupport.UserID = Convert.ToInt64(Session["UserID"]); ObjSupport.SupportDate = DateTime.Now; db.SupportInfoes.Add(ObjSupport); db.SaveChanges(); // save data in SupportInfo table in database string useremail = ""; long uid = Convert.ToInt64(Session["UserID"]); var objuser = db.UserProfiles.Where(usr => usr.UserId == uid).FirstOrDefault(); if (objuser != null) { useremail = objuser.EmailAddress; } var objInstance = (from o in db.InstanceInfoes where o.InstanceID == 1 select new { o.InstanceTitle, o.HostEmail, o.URL, o.SmtpIPv4 }).FirstOrDefault(); if (objInstance != null && useremail != "") { string fromEmail = useremail; string subject = supportinfo.Summary; string body = "<div style='font-family: Arial; font-size: 10pt'>Date sumbitted: " + String.Format("{0:d/M/yyyy}", DateTime.Now) + "<br />Subject: " + supportinfo.Summary + "<br /> Detail: " + supportinfo.Description + "</div>"; //body = body.Replace("{InstanceTitle}", objInstance.InstanceTitle).Replace("{InstanceURL}", objInstance.URL).Replace("{FirstName}", HttpUtility.HtmlEncode(objUser.FirstName)).Replace("{UserName}", HttpUtility.HtmlEncode(objUser.EmailAddress)).Replace("{Password}", Password).Replace("{Password}", Password); //edit it try { if (SupportFileExist == true) { MailEngine.SendWithAttachment(fromEmail, objInstance.HostEmail, subject, body, objInstance.SmtpIPv4, attachfilepath); } else { MailEngine.Send(fromEmail, objInstance.HostEmail, subject, body, objInstance.SmtpIPv4); } //MailEngine oLog = new MailEngine(); //oLog.LogEmail(fromEmail, objEmail.ID, objUser.UserId); //db.SaveChanges(); } catch (Exception ex) { } } //string urlref = Request.UrlReferrer.AbsolutePath; //if (urlref.Contains("/") == true) //{ // string cont = urlref.Substring(urlref.LastIndexOf("/") + 1); // if (cont.ToLower() == "edituserprofile") // return RedirectToAction(cont, "User"); // else // return RedirectToAction("Index", cont); //} return(RedirectToAction("Index", "User")); }
public void AddSupportInfo(SupportInfo support) { support.index = index; supports.Add(support); }
protected void btSubmit_Click(object sender, EventArgs e) { if (!UserRightImpl.CheckRightAdminnistrator().UserEdit) { Response.Redirect(Utility.UrlRoot + Config.PathNotRight, false); return; } try { int userID = 0; SupportImpl obj = new SupportImpl(); if (Request.QueryString["ID"] != null && Request.QueryString["ID"] != string.Empty) { try { userID = int.Parse(Request.QueryString["ID"]); SupportInfo item = obj.GetInfo(userID); if (item == null) { Response.Redirect(Utility.UrlRoot + Config.PathError, false); return; } else { item.s_Name = txtName.Text; item.s_Email = txtEmail.Text; item.s_Mobile = txtMobile.Text; item.s_Skype = txtSkype.Text; item.s_Yahoo = txtYahoo.Text; obj.Update(item); //Delete cache CacheController.GetListSupport_Delete(); } } catch { Response.Redirect(Utility.UrlRoot + Config.PathError, false); return; } } else { SupportInfo item = new SupportInfo(); item.s_Name = txtName.Text; item.s_Email = txtEmail.Text; item.s_Mobile = txtMobile.Text; item.s_Skype = txtSkype.Text; item.s_Yahoo = txtYahoo.Text; obj.Insert(item); //Delete cache CacheController.GetListSupport_Delete(); } Response.Redirect("support_manager.aspx", false); } catch { lblMsg.Text = "Tên người hỗ trợ đã tồn tại. Bạn chạy chọn một tên khác"; } }