public void Fetch(string[] commandStrings) { MessageBox.Show(CommonCode.TranslateText(58), "Attention", MessageBoxButtons.OK, MessageBoxIcon.Information); Manager.manager.GfxObjList.Find(f => f.Name() == "ibValider").Visible(true); }
protected void Page_Load(object sender, EventArgs e) { if (EventId > 0) { var eventService = IoC.Resolve <IEventService>(); var eventData = eventService.GetById(EventId); EventNameLabel.Text = HttpUtility.HtmlEncode(eventData.OrganizationName); EventAddressLabel.Text = System.Web.Security.AntiXss.AntiXssEncoder.HtmlEncode(CommonCode.AddressMultiLine(eventData.StreetAddressLine1, eventData.StreetAddressLine2, eventData.City, eventData.State, eventData.Zip), true); EventType = (short)(RegistrationMode)Enum.Parse(typeof(RegistrationMode), eventData.EventType); EventDateLabel.Text = eventData.EventDate.ToString("dddd, MMMM dd, yyyy"); var hospitalPartnerRepository = IoC.Resolve <IHospitalPartnerRepository>(); var hospitalPartnerId = hospitalPartnerRepository.GetHospitalPartnerIdForEvent(EventId); if (hospitalPartnerId > 0) { var organizationRepository = IoC.Resolve <IOrganizationRepository>(); var hospitalPartner = organizationRepository.GetOrganizationbyId(hospitalPartnerId); HospitalPartnerLabel.Text = hospitalPartner.Name; SponsoredInfoDiv.Visible = true; } if (!SelectedPackageTests.IsNullOrEmpty() || !SelectedAddOnTests.IsNullOrEmpty()) { var javaScriptSerializer = new JavaScriptSerializer(); if (!SelectedPackageTests.IsNullOrEmpty()) { foreach (var packageTest in SelectedPackageTests) { Page.ClientScript.RegisterArrayDeclaration("selectedPackageTests", javaScriptSerializer.Serialize(packageTest)); } } else { Page.ClientScript.RegisterArrayDeclaration("selectedPackageTests", string.Empty); } if (!SelectedAddOnTests.IsNullOrEmpty()) { foreach (var addOnTest in SelectedAddOnTests) { Page.ClientScript.RegisterArrayDeclaration("selectedAddOnTests", javaScriptSerializer.Serialize(addOnTest)); } } else { Page.ClientScript.RegisterArrayDeclaration("selectedAddOnTests", string.Empty); } Page.ClientScript.RegisterArrayDeclaration("selectedPackages", SelectedPackage); } } }
public void Fetch(string[] commandStrings) { MessageBox.Show(CommonCode.TranslateText(61), "Information", MessageBoxButtons.OK, MessageBoxIcon.Warning); GameStateManager.ChangeState(new SelectPlayer()); GameStateManager.CheckState(); }
public bool Check() { Battle b = Battle.Battles.Find(f => f.IdBattle == _actor.idBattle); Actor actorBattleInstance = null; if (_actor.inBattle == 1) { actorBattleInstance = b.AllPlayersByOrder.Find(f => f.Pseudo == _actor.Pseudo); } if (CommandStrings.Length != 2) { return(false); } _locationString = CommandStrings[1].ToString(); // incrementation du timestamp contre le spam waypoint qui se libere apres 2seconds _actor.timeBeforeNextWaypoint = CommonCode.ReturnTimeStamp(); // verifier si le joueur a un wayPointList if ((_actor.inBattle == 0 && _actor.wayPoint.Count > 0) || (_actor.inBattle == 1 && actorBattleInstance.wayPoint.Count > 0)) { int x, y; if (!int.TryParse(_locationString.Split(',')[0], out x)) { Security.User_banne("client inject a non int 'waypoint past'", Nc); return(false); } if (!int.TryParse(_locationString.Split(',')[1], out y)) { Security.User_banne("client inject a non int 'waypoint past'", Nc); return(false); } _location = new Point(x, y); // arrondissement Point p = new Point(_location.X / 30 * 30, _location.Y / 30 * 30); // verification si c'est la derniere offset pour mettre a jour la position du joueur if ((_actor.inBattle == 0 && p.X == _actor.wayPoint[0].X && p.Y == _actor.wayPoint[0].Y) || (_actor.inBattle == 1 && p.X == actorBattleInstance.wayPoint[0].X && p.Y == actorBattleInstance.wayPoint[0].Y)) { // modification du way point sur la bd seulement si le joueur n'est pas dans un combat if (_actor.inBattle == 0) { ((List <mysql.connected>)DataBase.DataTables.connected).Find(f => f.pseudo == _actor.Pseudo).map_position = (_actor.wayPoint[0].X / 30) + "/" + (_actor.wayPoint[0].Y / 30); ((List <mysql.players>)DataBase.DataTables.players).Find(f => f.pseudo == _actor.Pseudo).map_position = (_actor.wayPoint[0].X / 30) + "/" + (_actor.wayPoint[0].Y / 30); } else { // sustraction de 1 du nombre des pm2 actorBattleInstance.currentPm--; } if (_actor.inBattle == 0) { _actor.map_position = new Point((_actor.wayPoint[0].X / 30), (_actor.wayPoint[0].Y / 30)); _actor.wayPoint.RemoveAt(0); } else { actorBattleInstance.map_position = new Point((actorBattleInstance.wayPoint[0].X / 30), (actorBattleInstance.wayPoint[0].Y / 30)); actorBattleInstance.wayPoint.RemoveAt(0); } // supression de la 1ere position depuis le way point // verification du temps passé apres le passage du waypoint if (_actor.inBattle == 0) { switch (_actor.wayPoint.Count) { case 0: if (_actor.wayPointCnt > 1) { int elapsedTime = CommonCode.ReturnTimeStamp() - _actor.wayPointTimeStamp; if (_actor.animatedAction == Enums.AnimatedActions.Name.walk) { //double trueTime = (im.SenderConnection.Tag as PlayerInfo).wayPointCnt * 0.8; int trueTime = (int)(Math.Round(_actor.wayPointCnt * 0.2)); if (elapsedTime - trueTime < -1) { // seuille de 5 seconds tolléré (1 = 0.2 * 5 seconds) // le joueur a triché en diminuons le temps de relance pour chaque tuile passé Security.User_banne("time too short between 2 tile", Nc); //Nc.Disconnect("0x17"); return(false); } } else if (_actor.animatedAction == Enums.AnimatedActions.Name.run) { //double trueTime = (im.SenderConnection.Tag as PlayerInfo).wayPointCnt * 0.8; int trueTime = (int)(Math.Round(_actor.wayPointCnt * 0.2)); if (elapsedTime - trueTime < ((_actor.wayPointCnt < 10) ? -1 : -3)) { // le joueur a triché en diminuons le temps de relance pour chaque tuille passé Security.User_banne("time too short between 2 tile", Nc); return(false); } } } _actor.wayPointTimeStamp = 0; _actor.animatedAction = Enums.AnimatedActions.Name.idle; _actor.wayPoint.Clear(); _actor.wayPointCnt = 0; break; } } else { switch (actorBattleInstance.wayPoint.Count) { case 0: if (actorBattleInstance.wayPointCnt > 1) { int elapsedTime = CommonCode.ReturnTimeStamp() - actorBattleInstance.wayPointTimeStamp; switch (actorBattleInstance.animatedAction) { case Enums.AnimatedActions.Name.walk: { //double trueTime = (im.SenderConnection.Tag as PlayerInfo).wayPointCnt * 0.8; int trueTime = (int)(Math.Round(actorBattleInstance.wayPointCnt * 0.2)); if (elapsedTime - trueTime < -1) { // seuille de 5 seconds toléré // le joueur a triché en diminuons le temps de relance pour chaque tuille passé Security.User_banne("too short time between 2 tiles, err2", Nc); return(false); } } break; case Enums.AnimatedActions.Name.run: { //double trueTime = (im.SenderConnection.Tag as PlayerInfo).wayPointCnt * 0.8; int trueTime = (int)(Math.Round(actorBattleInstance.wayPointCnt * 0.2)); if (elapsedTime - trueTime < ((actorBattleInstance.wayPointCnt < 10) ? -1 : -3)) { // le joueur a triché en diminuons le temps de relance pour chaque tuille passé Security.User_banne("too short time between 2 tiles, err3", Nc); return(false); } } break; } } actorBattleInstance.wayPointTimeStamp = 0; actorBattleInstance.animatedAction = Enums.AnimatedActions.Name.idle; actorBattleInstance.wayPoint.Clear(); actorBattleInstance.wayPointCnt = 0; break; } } } } else { // cette condition n'est pas possible vus que le client devera avoir un waypoint > 0 // mais pour des raisons de sécurité on le bloque si ce cas arrive return(false); } return(true); }
private void LoadData(string id) { DataTable dt = bll.GetContactDataByID(id.Trim()); if (dt != null && dt.Rows.Count > 0) { string workFlowStatus = dt.Rows[0]["WorkFlowStatus"].ToString().Trim(); if (workFlowStatus != "4")//供应商确认 { ShareCode.AlertMsg(this, "play", "确认信息出错,请重新选择。", "Distributor.aspx", false); return; } lbTime.Text = dt.Rows[0]["CreateTime"].ToString(); lbBuyOrg.Text = dt.Rows[0]["BuyOrg"].ToString(); string srmNo = dt.Rows[0]["SRM_Contract_NO"].ToString(); lbSrmNo.Text = srmNo; hdfid.Value = dt.Rows[0]["id"].ToString(); lbERPNo.Text = dt.Rows[0]["ERP_Contract_NO"].ToString(); lbGrantNo.Text = dt.Rows[0]["GrantNo"].ToString(); lbDistributorName.Text = dt.Rows[0]["DistributorName"].ToString(); lbDistributorAddr.Text = dt.Rows[0]["DistributorAddr"].ToString(); lbContactName.Text = dt.Rows[0]["ContactName"].ToString(); lbReceivingParty.Text = dt.Rows[0]["ReceivingParty"].ToString(); lbAcquiringParty.Text = dt.Rows[0]["AcquiringParty"].ToString(); lbCurrency.Text = dt.Rows[0]["Currency"].ToString(); lbCurrency2.Text = lbCurrency.Text; lbBuyerAccount.Text = dt.Rows[0]["BuyerAccount"].ToString(); lbWorkFlowStatus.Text = CommonCode.GetWorkFlowStatusText(workFlowStatus); lbPlay.Text = dt.Rows[0]["PlayType"].ToString();//付款方式 lbPlay2.Text = lbPlay.Text; lbTemple.Text = dt.Rows[0]["TemplateName"].ToString(); //合同模板TemplateId lbPriceClause.Text = dt.Rows[0]["PriceClause"].ToString(); //价格条款 txtRemark.Text = dt.Rows[0]["Remark"].ToString(); //摘要 string bDate = dt.Rows[0]["AgreementBDate"].ToString(); txtBeginDate.Text = bDate; bDate = dt.Rows[0]["AgreementEDate"].ToString(); txtEndDate.Text = bDate; DataTable dtp = null; dtp = bll.GetContactProductByCID(dt.Rows[0]["id"].ToString()); Repeater1.DataSource = dtp; Repeater1.DataBind(); //金额合计 double amount = 0; if (dtp != null && dtp.Rows.Count > 0) { foreach (DataRow r in dtp.Rows) { amount += string.IsNullOrEmpty(r["Amount"].ToString()) ? 0 : double.Parse(r["Amount"].ToString()); } } lbTotal.Text = amount.ToString(); } else { ShareCode.AlertMsg(this, "play", "确认信息出错,请重新选择。", "Distributor.aspx", false); } }
protected void imgEndCall_Click(object sender, ImageClickEventArgs e) { var objCommoncode = new CommonCode(); objCommoncode.EndCCRepCall(Page); }
private void FillMvUserData() { // format phone no. CommonCode objCommonCode = new CommonCode(); long physicianId = IoC.Resolve <ISessionContext>().UserSession.CurrentOrganizationRole.OrganizationRoleUserId; ITestRepository testRepository = new TestRepository(); IPhysicianRepository physicianRepository = new PhysicianRepository(); var medicalVendorDal = new MedicalVendorDAL(); bool allowAuthorizations; bool allowEvaluations; //TODO: To Repair medicalVendorDal.GetMVUserFunctionalities(physicianId, out allowAuthorizations, out allowEvaluations); decimal currentPayrate = 0.00M; if (allowEvaluations) { currentPayrate = physicianRepository.GetCurrentPayrate(physicianId); List <Test> tests = testRepository.GetPermittedTestsForaPhysician(physicianId); CurrentPayrateSpan.InnerHtml = string.Format("{0:c}", currentPayrate); PermittedTestsRepeater.DataSource = tests.OrderBy(t => t.Name); PermittedTestsRepeater.DataBind(); } List <EMVMVUser> medicalVendorUserProfile = medicalVendorDal.GetMedicalVendorMedicalVendorUserProfile(IoC.Resolve <ISessionContext>().UserSession.UserId.ToString(), 1); vendorname.InnerText = medicalVendorUserProfile[0].MedicalVendor.BusinessName; name.InnerText = medicalVendorUserProfile[0].MVUser.User.FirstName + " " + medicalVendorUserProfile[0].MVUser.User.MiddleName + " " + medicalVendorUserProfile[0].MVUser.User.LastName; fname.InnerText = medicalVendorUserProfile[0].MVUser.User.FirstName; mname.InnerText = medicalVendorUserProfile[0].MVUser.User.MiddleName; lname.InnerText = medicalVendorUserProfile[0].MVUser.User.LastName; if (medicalVendorUserProfile[0].MVUser.Resume != "") { aDwnResume.HRef = medicalVendorUserProfile[0].MVUser.Resume; aDwnResume.Disabled = false; } else { aDwnResume.Disabled = true; } if (medicalVendorUserProfile[0].MVUser.DigitalSignature != "") { aDwnSign.Disabled = false; aDwnSign.HRef = medicalVendorUserProfile[0].MVUser.DigitalSignature; } else { aDwnSign.Disabled = true; } specialization.InnerText = medicalVendorUserProfile[0].MVUser.MVUserSpecialization.Name; classification.InnerText = medicalVendorUserProfile[0].MVUser.MVUserClassification.Name; DateTime DOB = Convert.ToDateTime(medicalVendorUserProfile[0].MVUser.User.DOB); // DateTime DOA = Convert.ToDateTime(mvmvuser[0]reateDate); address1.InnerText = medicalVendorUserProfile[0].MVUser.User.HomeAddress.Address1; address2.InnerText = medicalVendorUserProfile[0].MVUser.User.HomeAddress.Address2; state.InnerText = medicalVendorUserProfile[0].MVUser.User.HomeAddress.State; country.InnerText = medicalVendorUserProfile[0].MVUser.User.HomeAddress.Country; city.InnerText = medicalVendorUserProfile[0].MVUser.User.HomeAddress.City; zip.InnerText = medicalVendorUserProfile[0].MVUser.User.HomeAddress.ZipID.ToString(); phonehome.InnerText = objCommonCode.FormatPhoneNumberGet(medicalVendorUserProfile[0].MVUser.User.PhoneHome); phonecell.InnerText = objCommonCode.FormatPhoneNumberGet(medicalVendorUserProfile[0].MVUser.User.PhoneCell); phoneother.InnerText = objCommonCode.FormatPhoneNumberGet(medicalVendorUserProfile[0].MVUser.User.PhoneOffice); email1.InnerText = medicalVendorUserProfile[0].MVUser.User.EMail1; email2.InnerText = medicalVendorUserProfile[0].MVUser.User.EMail2; dob.InnerText = DOB.ToString("MMMM dd, yyyy"); ssn.InnerText = medicalVendorUserProfile[0].MVUser.User.SSN; var objCCode = new CommonCode(); imgmyphto.ImageUrl = objCCode.GetPicture(Request.MapPath(medicalVendorUserProfile[0].MVUser.MyPicture), medicalVendorUserProfile[0].MVUser.MyPicture); if (medicalVendorUserProfile[0].MVUser.References.Count <= 0) { refname1.InnerText = ""; refemail1.InnerText = ""; refname2.InnerText = ""; refemail2.InnerText = ""; refname3.InnerText = ""; refemail3.InnerText = ""; } if (medicalVendorUserProfile[0].MVUser.References.Count == 1) { refname1.InnerText = medicalVendorUserProfile[0].MVUser.References[0] == null ? "" : medicalVendorUserProfile[0].MVUser.References[0].Name; refemail1.InnerText = medicalVendorUserProfile[0].MVUser.References[0] == null ? "" : medicalVendorUserProfile[0].MVUser.References[0].EMail; } if (medicalVendorUserProfile[0].MVUser.References.Count == 2) { refname2.InnerText = medicalVendorUserProfile[0].MVUser.References[1] == null ? "" : medicalVendorUserProfile[0].MVUser.References[1].Name; refemail2.InnerText = medicalVendorUserProfile[0].MVUser.References[1] == null ? "" : medicalVendorUserProfile[0].MVUser.References[1].EMail; } if (medicalVendorUserProfile[0].MVUser.References.Count == 3) { refname1.InnerText = medicalVendorUserProfile[0].MVUser.References[0] == null ? "" : medicalVendorUserProfile[0].MVUser.References[0].Name; refemail1.InnerText = medicalVendorUserProfile[0].MVUser.References[0] == null ? "" : medicalVendorUserProfile[0].MVUser.References[0].EMail; refname2.InnerText = medicalVendorUserProfile[0].MVUser.References[1] == null ? "" : medicalVendorUserProfile[0].MVUser.References[1].Name; refemail2.InnerText = medicalVendorUserProfile[0].MVUser.References[1] == null ? "" : medicalVendorUserProfile[0].MVUser.References[1].EMail; refname3.InnerText = medicalVendorUserProfile[0].MVUser.References[2] == null ? "" : medicalVendorUserProfile[0].MVUser.References[2].Name; refemail3.InnerText = medicalVendorUserProfile[0].MVUser.References[2] == null ? "" : medicalVendorUserProfile[0].MVUser.References[2].EMail; } //spdateApplied.InnerText = DOA.ToString("MMMM dd, yyyy"); Ucimagelist1.Images = medicalVendorUserProfile[0].MVUser.OtherPictures.ToList(); }
public string GetRegisterRecordNew(string MobileNo, string Fname, string Lname, string address, string pincode, string strDevId) { int i, smslength; string id = ""; DataSet ds = new DataSet(); try { UserRegistrationBLL balobj = new UserRegistrationBLL(); CommonCode cc = new CommonCode(); balobj.usrFirstName = Fname; balobj.usrLastName = Lname; balobj.usrMobileNo = MobileNo; balobj.usrAddress = address; balobj.usrPIN = pincode; balobj.StrDevId = strDevId; i = balobj.BLLIsExistUserRegistrationInitial(balobj);//check user is exist or not if i = 0 then already exist if (i > 0) { balobj.usrUserId = System.Guid.NewGuid().ToString(); Random rnd = new Random(); balobj.usrPassword = cc.DESEncrypt(Convert.ToString(rnd.Next(10001, 99999))); i = balobj.BLLInsertUserRegistrationInitial(balobj); if (i > 0) { id = balobj.usrUserId; string myMobileNo = balobj.usrMobileNo; string myPassword = cc.DESDecrypt(balobj.usrPassword); string myName = balobj.usrFirstName; string passwordMessage = "Welcome " + myName + ",for ur First Login Username="******" & Password is " + myPassword + " " + cc.AddSMS(myMobileNo); smslength = passwordMessage.Length; cc.TransactionalSMSCountry("OnlineExam", myMobileNo, passwordMessage, smslength, 22); //------------------------------ For Dublicate IMEI number.................... string sql3 = "select [usrMobileNo] from usermaster where strDevId = '" + strDevId + "'";//takes all mobile number who have same IMEI number ds = cc.ExecuteDataset(sql3); foreach (DataRow row in ds.Tables[0].Rows) { if (row[0].Equals(MobileNo)) { } else { string sql = "update usermaster set StrDevId = '0' where [usrMobileNo] ='" + row[0] + "' "; int j = cc.ExecuteNonQuery(sql); } } } } else { string sqlget = "select usrUserid from usermaster where usrMobileNo='" + MobileNo + "'";//geting userid of user id = cc.ExecuteScalar(sqlget); string sql2 = "select strDevId from usermaster where usrUserid='" + id + "' "; string str = cc.ExecuteScalar(sql2); if (str == "" || str == null || str == "0") // If IMEI no is null { string sql = "Update usermaster set StrDevId = '" + strDevId + "' where usrUserid ='" + id + "' "; //to add/update IMEI no's for old entries int j = cc.ExecuteNonQuery(sql); } string sql3 = "select [usrMobileNo] from usermaster where strDevId = '" + str + "'";//takes all mobile number who have same IMEI number ds = cc.ExecuteDataset(sql3); foreach (DataRow row in ds.Tables[0].Rows) { if (row[0].Equals(MobileNo)) { } else { string sql = "update usermaster set StrDevId = '0' where [usrMobileNo] ='" + row[0] + "' "; int j = cc.ExecuteNonQuery(sql); } } } } catch (Exception ex) { } return(id); }
/// <summary> /// Display customer information /// </summary> private void DisplayCustomer() { long customerId = IoC.Resolve <ISessionContext>().UserSession.CurrentOrganizationRole.OrganizationRoleUserId; ICustomerRepository customerRepository = new CustomerRepository(); var customer = customerRepository.GetCustomer(customerId); var commonCode = new CommonCode(); dynamic displayCustomerModel = new ExpandoObject(); displayCustomerModel.CustomerId = customerId; if (customer != null) { _txtFirstName.Text = customer.Name.FirstName; _txtMiddleName.Text = customer.Name.MiddleName; _txtLastName.Text = customer.Name.LastName; NameLabel.InnerText = displayCustomerModel.Name = customer.Name.FullName; if (customer.Height != null) { _ddlFeet.SelectedValue = displayCustomerModel.Feet = customer.Height.Feet.ToString(); _ddlInch.SelectedValue = displayCustomerModel.Inches = customer.Height.Inches.ToString(); } if (customer.Weight != null) { displayCustomerModel.Weight = _txtWeight.Text = customer.Weight.Pounds.ToString(); } if (customer.Waist.HasValue && customer.Waist.Value > 0) { displayCustomerModel.Waist = _txtWaist.Text = customer.Waist.Value.ToString("0.0"); } ListItem lstRace = _ddlRace.Items.FindByText(customer.Race.ToString()); if (lstRace != null) { lstRace.Selected = true; displayCustomerModel.Race = lstRace.Text; } displayCustomerModel.AddressLine = _txtAddress.Text = customer.Address.StreetAddressLine1; displayCustomerModel.Suit = _txtSuit.Text = customer.Address.StreetAddressLine2; displayCustomerModel.City = _txtCity.Text = customer.Address.City; displayCustomerModel.State = hfstate.Value = customer.Address.State; ddlCountry.SelectedValue = customer.Address.CountryId.ToString(); displayCustomerModel.AddressLine = ddlCountry.SelectedItem.Text; displayCustomerModel.Zip = _txtZip.Text = customer.Address.ZipCode.Zip; displayCustomerModel.PhoneHome = _txtPhoneHome.Text = commonCode.FormatPhoneNumberGet(customer.HomePhoneNumber.ToString()); displayCustomerModel.PhoneCell = _txtPhoneCell.Text = commonCode.FormatPhoneNumberGet(customer.MobilePhoneNumber.ToString()); displayCustomerModel.PhoneOffice = _txtPhoneOffice.Text = commonCode.FormatPhoneNumberGet(customer.OfficePhoneNumber.ToString()); displayCustomerModel.EnableTexting = customer.EnableTexting; rbtnEnableTexting.Checked = customer.EnableTexting; rbtnDisableTexting.Checked = !customer.EnableTexting; displayCustomerModel.EnableVoiceMail = customer.EnableVoiceMail; rbtnEnableVoiceMail.Checked = customer.EnableVoiceMail; rbtnDisableVoiceMail.Checked = !customer.EnableVoiceMail; if (customer.DateOfBirth.HasValue) { displayCustomerModel.DateOfBrith = _txtDateOfBrith.Text = customer.DateOfBirth.Value.ToString("MM/dd/yyyy"); DobLabel.InnerText = customer.DateOfBirth.Value.ToString("MM/dd/yyyy"); DobLabelSpan.Style.Add(HtmlTextWriterStyle.Display, "block"); DobTextboxSpan.Style.Add(HtmlTextWriterStyle.Display, "none"); } else { DobLabelSpan.Style.Add(HtmlTextWriterStyle.Display, "none"); DobTextboxSpan.Style.Add(HtmlTextWriterStyle.Display, "block"); } _ddlGender.SelectedValue = displayCustomerModel.Gender = customer.Gender.ToString(); displayCustomerModel.Email = _txtEmail.Text = customer.Email.ToString(); displayCustomerModel.PhoneOfficeExtension = PhoneOfficeExtension.Text = customer.PhoneOfficeExtension; displayCustomerModel.Ssn = _txtSsnNumber.Text = customer.Ssn; if (IsUpdateProfile) { MarketingSourceDropDown.SelectedValue = displayCustomerModel.MarketingSource = customer.MarketingSource; } LogAudit(ModelType.View, displayCustomerModel, customerId); } }
void SendBtn_MouseClic(Bmp bmp, MouseEventArgs e) { RichTextBoxEx ChatArea = MainForm.chatBox.Controls.Find("ChatArea", false)[0] as RichTextBoxEx; if (HudHandle.SelectedCanalTxt.Text == "P" && HudHandle.ChatTextBox.TextLength > CommonCode.MyPlayerInfo.instance.pseudo.Length && HudHandle.ChatTextBox.Text.Substring(0, CommonCode.MyPlayerInfo.instance.pseudo.Length) == CommonCode.MyPlayerInfo.instance.pseudo) { ChatArea.AppendText((ChatArea.Text == "") ? "" : "\n"); ChatArea.SelectionStart = ChatArea.TextLength; ChatArea.SelectionLength = 0; ChatArea.SelectionColor = Color.Red; ChatArea.AppendText(CommonCode.TranslateText(28)); ChatArea.SelectionColor = ChatArea.ForeColor; } else if (HudHandle.ChatTextBox.Text != "") { if (HudHandle.SelectedCanalTxt.Text == "P" && HudHandle.ChatTextBox.Text.Split('#').Count() == 2) { // affichage du texte envoyé en mp en chat general ChatArea.AppendText((ChatArea.Text == "") ? "" : "\n"); ChatArea.SelectionStart = ChatArea.TextLength; ChatArea.SelectionLength = 0; ChatArea.SelectionColor = Color.Green; // pour recuperer le reste du texte quand l'utilisateur ajoute un # qui s'ajoute a celui du pseudo#...# string tmpMsg = ""; if (HudHandle.ChatTextBox.Text.Split('#').Length >= 2) { for (int cnt = 1; cnt < HudHandle.ChatTextBox.Text.Split('#').Length; cnt++) { tmpMsg += HudHandle.ChatTextBox.Text.Split('#')[cnt] + "#"; } tmpMsg = tmpMsg.Substring(0, tmpMsg.Length - 1); } ///////////////////// l'heur ChatArea.SelectionStart = ChatArea.TextLength; ChatArea.SelectionLength = 0; ChatArea.SelectionColor = Color.Green; ChatArea.AppendText("[" + DateTime.Now.ToString("HH:mm:ss") + "] "); ////////////////////////////////////////////////////// ChatArea.AppendText(CommonCode.TranslateText(3) + " "); ChatArea.InsertLink(" " + HudHandle.ChatTextBox.Text.Split('#')[0]); ChatArea.AppendText(" : "); // recherche l'existance d'un lien dans le text if (tmpMsg.IndexOf("[l/]") != -1 && tmpMsg.IndexOf("[\\l]") != -1 && tmpMsg.Length > 12) { // le texte contiens un lien // affichage du texte qui precede la balise ouverture de lien ChatArea.AppendText(tmpMsg.Substring(0, tmpMsg.IndexOf("[l/]")) + " "); string tmpMsg2 = tmpMsg.Substring(tmpMsg.IndexOf("[l/]") + 4, tmpMsg.IndexOf("[\\l]") - tmpMsg.IndexOf("[l/]") - 4); ChatArea.InsertLink(tmpMsg2); int pos1 = tmpMsg.IndexOf("[\\l]") + 4; string str1 = tmpMsg.Substring(pos1, tmpMsg.Length - pos1); ChatArea.AppendText(str1); } else { ChatArea.AppendText(tmpMsg); } ChatArea.SelectionColor = ChatArea.ForeColor; } Network.SendMessage("cmd•ChatMessage•" + HudHandle.SelectedCanalTxt.Text + "•" + HudHandle.ChatTextBox.Text, true); // enregistrement des messages sur le chatlog MainForm.ChatLog.Add(HudHandle.ChatTextBox.Text + "•" + HudHandle.SelectedCanalTxt.Text); HudHandle.ChatTextBox.Text = ""; HudHandle.ChannelState("G"); } }
private void SearchEvent() { IConfigurationSettingRepository configurationSettingRepository = new ConfigurationSettingRepository(); string strDistance = configurationSettingRepository.GetConfigurationValue(ConfigurationSettingName.Eventdistance); string zipCode = string.Empty; int zip = 0; if (Int32.TryParse(txtZip.Text, out zip)) { zipCode = zip.ToString(); } var tag = string.Empty; var hasMammo = false; if (CustomerId > 0 && (EventSearchTypeDropdownList.SelectedValue == EventSearchFilterType.HealthPlan.ToString() || EventSearchTypeDropdownList.SelectedValue == EventSearchFilterType.Corporate.ToString() || EventSearchTypeDropdownList.SelectedValue == EventSearchFilterType.Mammo.ToString())) { tag = Customer.Tag; if (EventSearchTypeDropdownList.SelectedValue == EventSearchFilterType.Mammo.ToString()) { hasMammo = true; } } if (CustomerHasMammoTest && !IsRedirectNonMammoEvent) { hasMammo = true; } long?ProductTypeId = null; if (Customer != null && CustomerId > 0) { ProductTypeId = Customer.ProductTypeId; } if (CustomerType == CustomerType.Existing && ProductTypeId == null) { dbsearch.Visible = false; dbsearch.Style["display"] = ""; divNoRecord.Visible = true; divNoRecord.Style["display"] = ""; dgEvent.Visible = false; dvSearchResult1.InnerText = ""; dvSearchResult.InnerText = ""; return; } var eventService = IoC.Resolve <IEventService>(); var events = eventService.GetEventHostViewData(ViewType.Technician, txtState.Text, txtCity.Text, txtInvitationCodeSearch.Text, zipCode, Convert.ToInt32(strDistance), txtFrom.Text.Length > 0 ? (DateTime?)Convert.ToDateTime(txtFrom.Text) : null, txtTo.Text.Length > 0 ? (DateTime?)Convert.ToDateTime(txtTo.Text) : null, 0, CurrentRole == Roles.CallCenterRep, tag: tag, hasMammo: hasMammo, ProductType: ProductTypeId); var tbltemp = new DataTable(); tbltemp.Columns.Add("Id"); tbltemp.Columns.Add("Name"); tbltemp.Columns.Add("Date", typeof(DateTime)); tbltemp.Columns.Add("Host"); tbltemp.Columns.Add("Address"); tbltemp.Columns.Add("Distance", typeof(Decimal)); tbltemp.Columns.Add("Slots"); tbltemp.Columns.Add("GoogleMap"); tbltemp.Columns.Add("EventType"); tbltemp.Columns.Add("EventTypeImage"); tbltemp.Columns.Add("GoogleAddressVerified"); tbltemp.Columns.Add("HasBreastCancer", typeof(bool)); tbltemp.Columns.Add("AllowNonMammoPatients", typeof(bool)); if (events != null && events.Count > 0) { if (!string.IsNullOrEmpty(txtInvitationCodeSearch.Text)) { ViewState["InvitationCode"] = txtInvitationCodeSearch.Text; } else { ViewState["InvitationCode"] = null; } string googleAddressVerified = string.Empty; foreach (var eventHostViewData in events) { string strAddress = eventHostViewData.StreetAddressLine1 + "<br />" + eventHostViewData.City + "," + eventHostViewData.State + "," + eventHostViewData.Zip; googleAddressVerified = string.Empty; if (eventHostViewData.GoogleAddressVerifiedBy.HasValue) { googleAddressVerified = GetAddressVerifiedUser(eventHostViewData.GoogleAddressVerifiedBy.Value); if (string.IsNullOrEmpty(googleAddressVerified)) { googleAddressVerified = "Address Not Verified" + CommonCode.GetGoogleAddressNotVerifiedJtip(); } } //string strGoogleMap = eventHostViewData.StreetAddressLine1 + "," + eventHostViewData.City + "," + eventHostViewData.State + "," + eventHostViewData.Zip; string strGoogleMap = CommonCode.GetGoogleMapAddress(eventHostViewData.StreetAddressLine1, eventHostViewData.City, eventHostViewData.State, eventHostViewData.Zip, eventHostViewData.Latitude + "," + eventHostViewData.Longitude, eventHostViewData. UseLatitudeAndLongitudeForMapping); string strEventType = string.Empty; if (eventHostViewData.EventType != "") { strEventType = eventHostViewData.EventType.Trim().Equals("Public") ? "<img src='/App/Images/public-icon.gif' title='Public Event' />" : "<img src='/App/Images/private-icon.gif' title='Private Event' style='padding:0px 5px 0px 0px;' />"; } tbltemp.Rows.Add(new object[] { eventHostViewData.EventId, eventHostViewData.Name, eventHostViewData.EventDate.ToShortDateString(), eventHostViewData.OrganizationName, strAddress, eventHostViewData.DistanceFromZip, eventHostViewData.IsDynamicScheduling.HasValue && eventHostViewData.IsDynamicScheduling.Value ? "Dynamic Scheduling" : eventHostViewData.AvailableAppointmentSlots + "/" + eventHostViewData.TotalAppointmentSlots, strGoogleMap, eventHostViewData.EventType, strEventType, googleAddressVerified, eventHostViewData.HasBreastCancerTest.HasValue && eventHostViewData.HasBreastCancerTest.Value , eventHostViewData.AllowNonMammoPatients }); } } if (tbltemp.Rows.Count > 0) { ViewState["Event"] = tbltemp; dgEvent.DataSource = tbltemp; dgEvent.Visible = true; dgEvent.DataBind(); dvSearchResult1.InnerText = "Total: "; dvSearchResult.InnerText = tbltemp.Rows.Count + " Result found"; divNoRecord.Visible = false; divNoRecord.Style["display"] = ""; dbsearch.Visible = true; dbsearch.Style["display"] = ""; } else { dbsearch.Visible = false; dbsearch.Style["display"] = ""; divNoRecord.Visible = true; divNoRecord.Style["display"] = ""; dgEvent.Visible = false; dvSearchResult1.InnerText = ""; dvSearchResult.InnerText = ""; } }
/// allDirections, losange, rhombus /// [ ] /// [ ][ ][ ] /// [ ][ ][ ][ ][ ] /// [ ][ ][ ][x][ ][ ][ ] /// [ ][ ][ ][ ][ ] /// [ ][ ][ ] /// [ ] public static Enums.LDVChecker.Availability Apply(object[] parameters) { ///////////////// parames Actor spellCaster = parameters[0] as Actor; Point spellPoint = parameters[1] as Point; mysql.spells spell = parameters[2] as mysql.spells; //////////////////////////////// int pe = (Convert.ToBoolean(spell.peModifiable) ? spellCaster.pe + spell.pe : spell.pe) + spell.distanceFromMelee; Battle _battle = Battle.Battles.Find(f => f.IdBattle == spellCaster.idBattle); bool inEmptyTileOnly = false; List <Enums.spell_effect_target.targets> spell_Targets = CommonCode.SpellTarget(spell); if (spell_Targets.Exists(f => f == Enums.spell_effect_target.targets.none) && spell_Targets.Count == 1) { inEmptyTileOnly = true; } List <Point> allTuiles = new List <Point>(); // liste qui contiens tous les tuiles affecté par le sort y compris un obstacle ou pas List <SortTuileInfo> allTuilesInfo = CommonCode.RhombusShapeWithObtsacle(spellCaster, spellPoint, spell); /////////////// supression des tuiles a coté du joueur si le sort n'accepte pas le cac if (spell.distanceFromMelee > 0) { List <SortTuileInfo> meleeTileInfo = CommonCode.RhombusShapeWithoutObstacle(spellCaster, spell.distanceFromMelee); foreach (SortTuileInfo sti in meleeTileInfo) { allTuilesInfo.RemoveAll(f => f.TuilePoint.X == sti.TuilePoint.X && f.TuilePoint.Y == sti.TuilePoint.Y); } } SortTuileInfo focusedTile = allTuilesInfo.Find(f => f.TuilePoint.X == spellPoint.X && f.TuilePoint.Y == spellPoint.Y); if (focusedTile != null) { // les obstacle joueurs sont prise en compte par le sort if (!inEmptyTileOnly && !focusedTile.IsBlockingView && focusedTile.IsWalkable) { // traitement quand le sort est autorisé sur cette emplacement return(Enums.LDVChecker.Availability.allowed); } else { // traitement quand le sorts n'est pas autorisé, ou la case est un obstale qui est un joueur, walkable = true, blockingview = true if (!inEmptyTileOnly && focusedTile.IsWalkable && focusedTile.IsBlockingView && _battle.AllPlayersByOrder.Exists(f => f.map_position.X == spellPoint.X && f.map_position.Y == spellPoint.Y)) { return(Enums.LDVChecker.Availability.allowed); } else if (inEmptyTileOnly && !focusedTile.IsBlockingView && focusedTile.IsWalkable) { return(Enums.LDVChecker.Availability.allowed); } else { return(Enums.LDVChecker.Availability.notAllowed); } } } else { // le sort est lancé sur un emplacement en dehors de la zone, le joueur triche return(Enums.LDVChecker.Availability.outSide); } //////////////////// }
public void Apply() { string tmp = ((List <mysql.players>)DataBase.DataTables.players).FindAll(f => f.user == _actor.Username).Aggregate(string.Empty, (current, p) => current + (p.pseudo + "#" + p.level + "#" + p.spirit + "#" + p.classe + "#" + p.pvpEnabled + "#" + p.spiritLevel + "#" + p.hiddenVillage + "#" + p.maskColorString + "#null#null|")); // verification si le joueur a créée des personnages if (((List <mysql.players>)DataBase.DataTables.players).Exists(f => f.user == _actor.Username)) { // on check si l'utilisateur est en combat, si oui, verifier si le combat existe, si oui, verifier s'il reste plus d'1 joueur non invoc dans les 2 teams // un probleme arrive rarement qui fait qu'un client se deconnecte d'un combat, et apres il co et il bug sur l'état qu'il été en combat, alors qu'il s'est deconnecté mais le serveur garde la session de combat, donc il cloture pas if (_actor.inBattle == 1) { if (!Battle.Battles.Exists(f => f.IdBattle == _actor.idBattle)) { _actor.inBattle = 0; // mise a jours sur la bdd // mise du statut inBattle = 0, idBattle = -1 pour les joueurs mysql.players p = ((List <mysql.players>)DataBase.DataTables.players).Find(f => f.pseudo == _actor.Pseudo); p.inBattle = 0; p.inBattleID = 0; p.inBattleType = ""; } else { Battle battle = Battle.Battles.Find(f => f.IdBattle == _actor.idBattle); if (battle.SideA.FindAll(f => f.species == Species.Name.Human).Count + battle.SideB.FindAll(f => f.species == Species.Name.Human).Count < 2) { // le combat dois etre cloturé puisqu'il reste qu'un seul joueur dans l'une des 2 team if (CommonCode.IsClosedBattle(battle, false)) { // il faut cloturer le combat battle.State = battleState.state.closed; //Console.WriteLine ("1client qui été en combat alors qu'il viens just de co peux etre, peux etre que ca va faire beuguer le client avec les cmd de cloture"); _actor.inBattle = 0; } } } } // verification si le joueur été en combat avec un personnage mysql.players actorAlreadyConnectedInBattle = ((List <mysql.players>)DataBase.DataTables.players).Find(f => f.inBattle == 1 && f.user == _actor.Username); // check si un des joueurs est en combat // verifier si il faut utiliser la valeur "actor.inBattle == 1" ou bien "actorAlreadyConnectedInBattle != null" // un check si le jouer est en combat est deja fait en haut, mais celui d'en haut est pour réctifier un problème qui arrive // du coup on répare ce bug et dans cette 2eme condition on revérifie, il faut peux etre penser a réunir cette 2éme partie dans la 1ere "celle d'en haut" // au lieu de revérifier apres avoir déjà fait le control //if (actorAlreadyConnectedInBattle != null) if (_actor.inBattle == 1) { #region ///////// DECO RECO pas encore testé // l'un des joueur est en combat, recuperation du map Console.WriteLine("player " + actorAlreadyConnectedInBattle.pseudo + " inBattle-map: " + actorAlreadyConnectedInBattle.map); _actor.Pseudo = actorAlreadyConnectedInBattle.pseudo; CommonCode.RefreshStats(Nc); //////////////////////////////// string spells = ((List <mysql.players>)DataBase.DataTables.players).Find(f => f.pseudo == actorAlreadyConnectedInBattle.pseudo).sorts; // recuperer le totalXp du niveau en cours int maxXp; maxXp = ((List <mysql.xplevel>)DataBase.DataTables.xplevel).Count == _actor.level ? ((List <mysql.xplevel>)DataBase.DataTables.xplevel)[((List <mysql.xplevel>)DataBase.DataTables.xplevel).Count - 1].xp : ((List <mysql.xplevel>)DataBase.DataTables.xplevel).Find(f => f.level == (_actor.level + 1)).xp; // convertir la list de quete en string, ce code se trouve sur 2 endroit, quand le joueur selectionne un player et quand le joueur été déja dans un combat et que apres un co qui précédé une deco, le player se selectionne tous seul string quete = ""; foreach (Actor.QuestInformation t in _actor.Quests) { quete += t.QuestName + ":" + t.MaxSteps + ":" + t.CurrentStep + ":" + t.Submited + "/"; } if (quete != "") { quete = quete.Substring(0, quete.Length - 1); } // si une modification sur cette cmd a été faite, il faut vérifier tous les cmd avec cmd•SelectedPlayer et aussi checkandupdatestates string buffer = _actor.Pseudo + "#" + _actor.classeName + "#" + _actor.spirit + "#" + _actor.spiritLvl.ToString() + "#" + _actor.Pvp.ToString() + "#" + _actor.hiddenVillage + "#" + _actor.maskColorString + "#" + _actor.directionLook.ToString() + "#" + _actor.level.ToString() + "#" + _actor.map + "#" + _actor.officialRang.ToString() + "#" + _actor.currentHealth.ToString() + "#" + _actor.maxHealth.ToString() + "#" + _actor.xp.ToString() + "#" + maxXp + "#" + _actor.doton.ToString() + "#" + _actor.katon.ToString() + "#" + _actor.futon.ToString() + "#" + _actor.raiton.ToString() + "#" + _actor.suiton.ToString() + "#" + MainClass.chakralvl1 + "#" + MainClass.chakralvl2 + "#" + MainClass.chakralvl3 + "#" + MainClass.chakralvl4 + "#" + MainClass.chakralvl5 + "#" + _actor.usingDoton.ToString() + "#" + _actor.usingKaton.ToString() + "#" + _actor.usingFuton.ToString() + "#" + _actor.usingRaiton.ToString() + "#" + _actor.usingSuiton.ToString() + "#" + _actor.equipedDoton.ToString() + "#" + _actor.equipedKaton.ToString() + "#" + _actor.equipedFuton.ToString() + "#" + _actor.equipedRaiton.ToString() + "#" + _actor.equipedSuiton.ToString() + "#" + _actor.originalPc.ToString() + "#" + _actor.originalPm.ToString() + "#" + _actor.pe.ToString() + "#" + _actor.cd.ToString() + "#" + _actor.summons.ToString() + "#" + _actor.initiative.ToString() + "#" + _actor.job1 + "#" + _actor.job2 + "#" + _actor.specialty1 + "#" + _actor.specialty2 + "#" + _actor.maxWeight.ToString() + "#" + _actor.currentWeight.ToString() + "#" + _actor.ryo.ToString() + "#" + _actor.resiDotonPercent.ToString() + "#" + _actor.resiKatonPercent.ToString() + "#" + _actor.resiFutonPercent.ToString() + "#" + _actor.resiRaitonPercent.ToString() + "#" + _actor.resiSuitonPercent.ToString() + "#" + _actor.dodgePC.ToString() + "#" + _actor.dodgePM.ToString() + "#" + _actor.dodgePE.ToString() + "#" + _actor.dodgeCD.ToString() + "#" + _actor.removePC.ToString() + "#" + _actor.removePM.ToString() + "#" + _actor.removePE.ToString() + "#" + _actor.removeCD.ToString() + "#" + _actor.escape.ToString() + "#" + _actor.blocage.ToString() + "#" + spells + "#" + _actor.resiDotonFix + "#" + _actor.resiKatonFix + "#" + _actor.resiFutonFix + "#" + _actor.resiRaitonFix + "#" + _actor.resiSuitonFix + "#" + _actor.resiFix + "#" + _actor.domDotonFix + "#" + _actor.domKatonFix + "#" + _actor.domFutonFix + "#" + _actor.domRaitonFix + "#" + _actor.domSuitonFix + "#" + _actor.domFix + "#" + _actor.power + "#" + _actor.equipedPower + "•" + quete + "•inBattle•" + _actor.spellPointLeft; AutoSelectActorInBattleResponseMessage selectedActorGrantedResponseMessage = new AutoSelectActorInBattleResponseMessage(); selectedActorGrantedResponseMessage.Initialize(new[] { buffer }, Nc); selectedActorGrantedResponseMessage.Serialize(); selectedActorGrantedResponseMessage.Send(); mysql.connected newConnection = ((List <mysql.connected>)DataBase.DataTables.connected).Find(f => f.user == _actor.Username); newConnection.pseudo = _actor.Pseudo; newConnection.timestamp = CommonCode.ReturnTimeStamp(); newConnection.map = _actor.map; newConnection.map_position = _actor.map_position.X + "/" + _actor.map_position.Y; // mise en combat du joueur _actor.inBattle = 1; Battle battle = Battle.Battles.Find(f => f.IdBattle == _actor.idBattle); _actor.teamSide = battle.SideA.Exists(f => f.Pseudo == _actor.Pseudo) ? Team.Side.A : Team.Side.B; // envoie d'une cmd au client qui contiens tous les infos du combat // collecte des données des 2 joueurs /* * // envoie au client la confirmation du challenge * commun.SendMessage("cmd•challengeBegan•" + playersData + "•" + battleStartPositions.Map(pi.map) + "•" + MainClass.InitialisationBattleWaitTime + "•" + _battle.BattleType + "•" + team1 + "•" + team2 + "•" + _battle.State + "•" + battleStartPositions.Start().Split('|')[0] + "•" + battleStartPositions.Start().Split('|')[1], im, true);*/ // modification des position des joueurs selon les position valide du map aléatoirement /*string[] team1ValidePos = battleStartPositions.Map(_battle.Map, _battle.BattleType).Split('|')[0].Split('#'); * string[] team2ValidePos = battleStartPositions.Map(_battle.Map, _battle.BattleType).Split('|')[1].Split('#'); * * _battle.team1ValidePos = battleStartPositions.Map(_battle.Map, _battle.BattleType).Split('|')[0]; * _battle.team2ValidePos = battleStartPositions.Map(_battle.Map, _battle.BattleType).Split('|')[1]; * * string playersData = ""; * * for (int cnt = 0; cnt < _battle.Team1.Count; cnt++) * { * PlayerInfo pit1 = _battle.Team1[cnt]; * playersData += pit1.Pseudo + "#" + pit1.ClasseName + "#" + pit1.Level + "#" + pit1.village + "#" + pit1.MaskColors + "#" + pit1.totalPdv + "#" + pit1.CurrentPdv + "#" + pit1.rang + "#" + pit1.Initiative + "#" + pit1.doton + "#" + pit1.katon + "#" + pit1.futon + "#" + pit1.raiton + "#" + pit1.suiton + "#" + pit1.usingDoton + "#" + pit1.usingKaton + "#" + pit1.usingFuton + "#" + pit1.usingRaiton + "#" + pit1.usingSuiton + "#" + pit1.dotonEquiped + "#" + pit1.katonEquiped + "#" + pit1.futonEquiped + "#" + pit1.raitonEquiped + "#" + pit1.suitonEquiped + "#" + pit1.pc + "#" + pit1.pm + "#" + pit1.pe + "#" + pit1.cd + "#" + pit1.invoc + "#" + pit1.resiDoton + "#" + pit1.resiKaton + "#" + pit1.resiFuton + "#" + pit1.resiRaiton + "#" + pit1.resiSuiton + "#" + pit1.esquivePC + "#" + pit1.esquivePM + "#" + pit1.esquivePE + "#" + pit1.esquiveCD + "#" + pit1.retraitPC + "#" + pit1.retraitPM + "#" + pit1.retraitPE + "#" + pit1.retraitCD + "#" + pit1.evasion + "#" + pit1.blocage + "#" + pit1.genre.ToString() + "#" + pit1.Orientation + ":"; * * Random random = new Random(); * int rand = random.Next(team2ValidePos.Length); * pit1.map_position = new Point(Convert.ToInt32(team1ValidePos[rand].Split('/')[0]), Convert.ToInt32(team1ValidePos[rand].Split('/')[1])); * } * * if (playersData != "") * playersData = playersData.Substring(0, playersData.Length - 1); * * playersData += "|"; * * for (int cnt = 0; cnt < _battle.Team2.Count; cnt++) * { * PlayerInfo pit2 = _battle.Team2[cnt]; * playersData += pit2.Pseudo + "#" + pit2.ClasseName + "#" + pit2.Level + "#" + pit2.village + "#" + pit2.MaskColors + "#" + pit2.totalPdv + "#" + pit2.CurrentPdv + "#" + pit2.rang + "#" + pit2.Initiative + "#" + pit2.doton + "#" + pit2.katon + "#" + pit2.futon + "#" + pit2.raiton + "#" + pit2.suiton + "#" + pit2.usingDoton + "#" + pit2.usingKaton + "#" + pit2.usingFuton + "#" + pit2.usingRaiton + "#" + pit2.usingSuiton + "#" + pit2.dotonEquiped + "#" + pit2.katonEquiped + "#" + pit2.futonEquiped + "#" + pit2.raitonEquiped + "#" + pit2.suitonEquiped + "#" + pit2.pc + "#" + pit2.pm + "#" + pit2.pe + "#" + pit2.cd + "#" + pit2.invoc + "#" + pit2.resiDoton + "#" + pit2.resiKaton + "#" + pit2.resiFuton + "#" + pit2.resiRaiton + "#" + pit2.resiSuiton + "#" + pit2.esquivePC + "#" + pit2.esquivePM + "#" + pit2.esquivePE + "#" + pit2.esquiveCD + "#" + pit2.retraitPC + "#" + pit2.retraitPM + "#" + pit2.retraitPE + "#" + pit2.retraitCD + "#" + pit2.evasion + "#" + pit2.blocage + "#" + pit2.genre.ToString() + "#" + pit2.Orientation; * * Random random = new Random(); * int rand = random.Next(team2ValidePos.Length); * pit2.map_position = new Point(Convert.ToInt32(team2ValidePos[rand].Split('/')[0]), Convert.ToInt32(team2ValidePos[rand].Split('/')[1])); * } * //////////////////////////////////// * string team1 = ""; * string team2 = ""; * * foreach (PlayerInfo piib in _battle.Team1) * team1 += piib.Pseudo + "|" + piib.map_position.X + "/" + piib.map_position.Y + "#"; * team1 = team1.Substring(0, team1.Length - 1); * * foreach (PlayerInfo piib in _battle.Team2) * team2 += piib.Pseudo + "|" + piib.map_position.X + "/" + piib.map_position.Y + "#"; * team2 = team2.Substring(0, team2.Length - 1); * * commun.SendMessage("cmd•challengeBegan•" + playersData + "•" + battleStartPositions.Map(_battle.Map, _battle.BattleType) + "•" + MainClass.InitialisationBattleWaitTime + "•" + _battle.BattleType + "•" + team1 + "•" + team2 + "•" + _battle.State + "•" + battleStartPositions.Map(_battle.Map, _battle.BattleType).Split('|')[0] + "•" + battleStartPositions.Map(_battle.Map, _battle.BattleType).Split('|')[1], im, true); * Console.WriteLine("<--cmd•challengeBegan•" + playersData + "•" + battleStartPositions.Map(_battle.Map, _battle.BattleType) + "•" + MainClass.InitialisationBattleWaitTime + "•" + _battle.BattleType + "•" + team1 + "•" + team2 + "•" + _battle.State + "•" + battleStartPositions.Map(_battle.Map, _battle.BattleType).Split('|')[0] + "•" + battleStartPositions.Map(_battle.Map, _battle.BattleType).Split('|')[1] + " to " + pi.Pseudo);*/ #endregion } else { tmp = tmp.Substring(0, tmp.Length - 1); GrabingActorsInformationResponseMessage grabingPlayersInformationResponseMessage = new GrabingActorsInformationResponseMessage(); grabingPlayersInformationResponseMessage.Initialize(new [] { tmp }, Nc); grabingPlayersInformationResponseMessage.Serialize(); grabingPlayersInformationResponseMessage.Send(); } } else { // l'utilisateur na pas de joueurs, il faut le basculer vers le map CreatePlayer CreateNewActorResponseMessage createNewPlayerResponseMessage = new CreateNewActorResponseMessage(); createNewPlayerResponseMessage.Initialize(CommandStrings, Nc); createNewPlayerResponseMessage.Serialize(); createNewPlayerResponseMessage.Send(); } }
protected void _eventCustomerGrid_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { var eventCustomer = e.Row.DataItem as EventCustomerRegistrationViewData; if (eventCustomer != null) { // format phone no. CommonCode objCommonCode = new CommonCode(); var phoneSpan = e.Row.FindControl("spPhone") as HtmlContainerControl; if (objCommonCode.FormatPhoneNumberGet(eventCustomer.PhoneNumber).Length > 0) { phoneSpan.InnerText = "PH:" + objCommonCode.FormatPhoneNumberGet(eventCustomer.PhoneNumber); } string customerFullName = !string.IsNullOrEmpty(eventCustomer.MiddleName) ? eventCustomer.FirstName + " " + eventCustomer.MiddleName + " " + eventCustomer.LastName : eventCustomer.FirstName + " " + eventCustomer.LastName; string currentRowIndex = (e.Row.DataItemIndex + 2) < 10 ? "ctl0" + Convert.ToString(e.Row.DataItemIndex + 2) : "ctl" + Convert.ToString(e.Row.DataItemIndex + 2); var appointmentTime = e.Row.FindControl("_appointmentTimeLiteral") as Literal; var statusSpan = e.Row.FindControl("spStatus") as HtmlContainerControl; var checkInFilledSpan = e.Row.FindControl("spfiledcheckin") as HtmlContainerControl; var actionSpan = e.Row.FindControl("spAction") as HtmlContainerControl; if (appointmentTime != null) { var appointmentString = string.Format("{0:hh:mm tt}", eventCustomer.AppointmentStartTime); if (eventCustomer.RoomSlots != null && eventCustomer.RoomSlots.Any()) { var roomSlotString = "<hr />"; foreach (var roomSlot in eventCustomer.RoomSlots) { roomSlotString += roomSlot.FirstValue + " - " + roomSlot.SecondValue.ToShortTimeString() + "<br />"; } appointmentString += roomSlotString; } appointmentTime.Text = appointmentString; } var customerId = eventCustomer.CustomerId; var order = GetCurrentOrder(customerId); var packageNameLiteral = e.Row.FindControl("PackageNameLiteral") as Literal; if (packageNameLiteral != null) { if (!string.IsNullOrEmpty(eventCustomer.PackageName) && !string.IsNullOrEmpty(eventCustomer.AdditinalTest)) { packageNameLiteral.Text = eventCustomer.PackageName + ", " + eventCustomer.AdditinalTest; } else { packageNameLiteral.Text = !string.IsNullOrEmpty(eventCustomer.PackageName) ? eventCustomer.PackageName : eventCustomer.AdditinalTest; } } // TODO: Problem lies in DAL mapped to wrong field. long eventCustomerId = eventCustomer.EventCustomerId; long appiontmentId = eventCustomer.AppointmentId; /* When appointmentslot is not allocated to a customer ********* */ if (eventCustomerId == 0) { var customerDetailSpan = e.Row.FindControl("spcustomerdetail") as HtmlContainerControl; // Case added when a slot is blocked then link should be disable string prepareAction = "<span style=\"width:110px; float:left;\">"; if (statusSpan != null && eventCustomer.AppointmentSlotStatus == AppointmentSlotStatus.Blocked) { statusSpan.InnerText = "Blocked"; } else if (statusSpan != null) { statusSpan.InnerText = "Open"; prepareAction += " <a id='" + currentRowIndex + "_Block' href=\"javascript:OpenPopUp('/App/Common/BlockSlot.aspx?AppointmentID=" + appiontmentId + "&keepThis=true&TB_iframe=true&width=270&height=200&modal=true')\" class='thickbox'>Block</a> | "; } prepareAction += " <a id='" + currentRowIndex + "_Delete' href=\"javascript:DeleteAppointment('" + appiontmentId + "');\">Delete</a> "; if (actionSpan != null) { actionSpan.InnerHtml = prepareAction; } if (customerDetailSpan != null) { customerDetailSpan.InnerHtml = eventCustomer.AppointmentBlockReason; } if (checkInFilledSpan != null) { checkInFilledSpan.InnerText = "N/A"; } return; } var acceptanceDetailSpan = e.Row.FindControl("spAcctDetail") as HtmlContainerControl; var appointmentDetailsSpan = e.Row.FindControl("spApptDetail") as HtmlContainerControl; if (acceptanceDetailSpan != null) { acceptanceDetailSpan.Style[HtmlTextWriterStyle.Display] = "block"; } if (appointmentDetailsSpan != null) { appointmentDetailsSpan.Style[HtmlTextWriterStyle.Display] = "block"; } var customerDetailAnchor = e.Row.FindControl("aCustomerDetail") as HtmlAnchor; var customerEditAnchor = e.Row.FindControl("CustomerEdit") as HtmlAnchor; if (customerDetailAnchor != null && customerEditAnchor != null) { var currentOrgRole = IoC.Resolve <ISessionContext>().UserSession.CurrentOrganizationRole; if (currentOrgRole.CheckRole((long)Roles.FranchisorAdmin)) { customerEditAnchor.HRef = "~/App/Franchisor/FranchisorEditCustomer.aspx?CustomerID=" + eventCustomer.CustomerId + "&Master=EventCustomerList"; customerDetailAnchor.HRef = "/App/Franchisor/FranchisorCustomerDetails.aspx?CustomerID=" + eventCustomer.CustomerId; } else if (currentOrgRole.CheckRole((long)Roles.FranchiseeAdmin)) { customerEditAnchor.HRef = "~/App/Franchisee/FranchiseeEditCustomer.aspx?CustomerID=" + eventCustomer.CustomerId + "&Master=EventCustomerList"; customerDetailAnchor.HRef = "/App/Franchisee/FranchiseeCustomerDetails.aspx?CustomerID=" + eventCustomer.CustomerId; } else if (currentOrgRole.CheckRole((long)Roles.SalesRep)) { customerEditAnchor.HRef = "javascript:void(0);"; customerDetailAnchor.HRef = "javascript:void(0);"; } } var customerNameLiteral = e.Row.FindControl("_customerNameLiteral") as Literal; if (customerNameLiteral != null) { customerNameLiteral.Text = customerFullName; } var customerIdLiteral = e.Row.FindControl("_customerIdLiteral") as Literal; if (customerIdLiteral != null) { customerIdLiteral.Text = eventCustomer.CustomerId.ToString(); } string userDateApplied = (eventCustomer.UserCreatedOn != default(DateTime)) ? eventCustomer.UserCreatedOn.ToString("MM/dd/yyyy") : string.Empty; var userCreatedDateLiteral = e.Row.FindControl("_userCreatedDateLiteral") as Literal; if (userCreatedDateLiteral != null) { userCreatedDateLiteral.Text = userDateApplied; } var couponCodeLiteral = e.Row.FindControl("_couponCodeLiteral") as Literal; var couponCode = GetCouponCode(); if (couponCodeLiteral != null) { couponCodeLiteral.Text = couponCode == "(0.00)" ? "-N/A-" : couponCode; } var paymentDetailLiteral = e.Row.FindControl("_paymentDetailLiteral") as Literal; if (paymentDetailLiteral != null && order != null) { paymentDetailLiteral.Text = order.DiscountedTotal.ToString("C2"); } /* When appointment slot is allocated to a customer ************ */ var checkInTempSpan = e.Row.FindControl("spCheckInInsert") as HtmlContainerControl; var checkOutTempSpan = e.Row.FindControl("spCheckOutInsert") as HtmlContainerControl; if (order != null && order.DiscountedTotal > order.TotalAmountPaid) { statusSpan.InnerText = "Not Paid"; } else { statusSpan.InnerText = "Paid"; } bool isTimeSaved = eventCustomer.CheckInTime.HasValue && eventCustomer.CheckOutTime.HasValue; if (isTimeSaved) { checkInTempSpan.InnerText = eventCustomer.CheckInTime.HasValue ? eventCustomer.CheckInTime.Value.ToShortTimeString() : ""; checkOutTempSpan.InnerText = eventCustomer.CheckOutTime.HasValue ? eventCustomer.CheckOutTime.Value.ToShortTimeString() : ""; checkInFilledSpan.Style.Add(HtmlTextWriterStyle.Display, "block"); } else { checkInFilledSpan.Style.Add(HtmlTextWriterStyle.Display, "none"); } } } }
public string GetWorkFlowStatusText(string WorkFlowStatus) { return(CommonCode.GetWorkFlowStatusText(WorkFlowStatus)); }
private bool UpdateCustomerInfo() { long customerId = IoC.Resolve <ISessionContext>().UserSession.CurrentOrganizationRole.OrganizationRoleUserId; dynamic displayCustomerModel = new ExpandoObject(); ICustomerRepository customerRepository = new CustomerRepository(); displayCustomerModel.CustomerId = customerId; if (!customerRepository.UniqueEmail(customerId, _txtEmail.Text)) { Page.ClientScript.RegisterStartupScript(typeof(string), "jscode_UniqueEmail", "alert('This email address is already registered! Please use different email address.');", true); return(false); } var address = new Address(_txtAddress.Text, _txtSuit.Text, _txtCity.Text, hfstate.Value, _txtZip.Text, ddlCountry.SelectedItem.Text); var customer = customerRepository.GetCustomer(customerId); customer.Name = new Name { FirstName = _txtFirstName.Text, MiddleName = _txtMiddleName.Text, LastName = _txtLastName.Text }; displayCustomerModel.Name = customer.Name; address.Id = customer.Address.Id; displayCustomerModel.Address = customer.Address = address; var commonCode = new CommonCode(); customer.HomePhoneNumber = new PhoneNumber { PhoneNumberType = PhoneNumberType.Home, Number = commonCode.FormatPhoneNumber(_txtPhoneHome.Text) }; displayCustomerModel.HomePhone = _txtPhoneHome.Text; customer.OfficePhoneNumber = new PhoneNumber { PhoneNumberType = PhoneNumberType.Office, Number = commonCode.FormatPhoneNumber(_txtPhoneOffice.Text) }; displayCustomerModel.PhoneOffice = _txtPhoneOffice.Text; customer.PhoneOfficeExtension = PhoneOfficeExtension.Text; displayCustomerModel.PhoneOfficeExtension = PhoneOfficeExtension.Text; customer.MobilePhoneNumber = new PhoneNumber { PhoneNumberType = PhoneNumberType.Mobile, Number = commonCode.FormatPhoneNumber(_txtPhoneCell.Text) }; displayCustomerModel.MobilePhoneNumber = _txtPhoneCell.Text; displayCustomerModel.Email = _txtEmail.Text; string[] emailSplitUp = _txtEmail.Text.Split(new[] { '@' }); customer.Email = new Email { Address = emailSplitUp[0], DomainName = emailSplitUp[1] }; displayCustomerModel.Feet = _ddlFeet.SelectedValue; displayCustomerModel.Inch = _ddlInch.SelectedValue; customer.Height = new Height(Convert.ToInt64(_ddlFeet.SelectedValue), Convert.ToInt64(_ddlInch.SelectedValue)); customer.Race = (Race)Enum.Parse(typeof(Race), _ddlRace.SelectedValue); displayCustomerModel.Race = _ddlRace.SelectedValue; if (_txtDateOfBrith.Text.Trim().Length > 0) { displayCustomerModel.DateOfBirth = customer.DateOfBirth = Convert.ToDateTime(_txtDateOfBrith.Text); } double weight; if (_txtWeight.Text.Trim().Length > 0 && Double.TryParse(_txtWeight.Text.Trim(), out weight)) { customer.Weight = new Weight(weight); displayCustomerModel.Weight = weight; } else { customer.Weight = null; } customer.EnableTexting = rbtnEnableTexting.Checked; customer.EnableVoiceMail = rbtnEnableVoiceMail.Checked; displayCustomerModel.EnableVoiceMail = customer.EnableVoiceMail; displayCustomerModel.EnableTexting = customer.EnableTexting; decimal waist; if (_txtWaist.Text.Trim().Length > 0 && decimal.TryParse(_txtWaist.Text.Trim(), out waist)) { customer.Waist = waist; displayCustomerModel.Waist = waist; } else { customer.Waist = null; } if (_ddlGender.SelectedItem.Text == Gender.Male.ToString()) { customer.Gender = Gender.Male; } else if (_ddlGender.SelectedItem.Text == Gender.Female.ToString()) { customer.Gender = Gender.Female; } else { customer.Gender = Gender.Unspecified; } displayCustomerModel.Gender = customer.Gender.GetDescription(); displayCustomerModel.Ssn = customer.Ssn = _txtSsnNumber.Text.Replace("-", "").Trim(); var customerService = IoC.Resolve <ICustomerService>(); try { customerService.SaveCustomer(customer, customerId); if (IsUpdateProfile) { var loginSettingRepository = IoC.Resolve <ILoginSettingRepository>(); var loginSettings = loginSettingRepository.Get(customer.UserLogin.Id); if (loginSettings != null && (IsPinRequiredForRole || ((IsOtpByAppEnabled || IsOtpByEmailEnabled || IsOtpBySmsEnabled) && IsAuthenticationForUserEnabled))) { if (IsPinRequiredForRole) { loginSettings.DownloadFilePin = IsPinRequiredForRole ? (string.IsNullOrEmpty(txtDownloadFilePin.Value) ? loginSettings.DownloadFilePin : txtDownloadFilePin.Value) : null; } if ((IsOtpByAppEnabled || IsOtpByEmailEnabled || IsOtpBySmsEnabled) && IsAuthenticationForUserEnabled) { if (useApp.Checked) { loginSettings.AuthenticationModeId = (long)AuthenticationMode.AuthenticatorApp; loginSettings.GoogleAuthenticatorSecretKey = (string)Session["EncodedSecret"]; } else { loginSettings.GoogleAuthenticatorSecretKey = null; loginSettings.AuthenticationModeId = UseEmail.Checked && UseSms.Checked ? (long)AuthenticationMode.BothSmsEmail : (UseSms.Checked ? (long)AuthenticationMode.Sms : (long)AuthenticationMode.Email); } Session["EncodedSecret"] = null; } loginSettingRepository.Save(loginSettings); } } LogAudit(ModelType.Edit, displayCustomerModel, customerId); } catch (InvalidAddressException ex) { ClientScript.RegisterStartupScript(typeof(string), "jscodecityvalidate", "alert('" + ex.Message + "');", true); return(false); } if (!IsUpdateProfile) { CustomerId = customer.CustomerId; RegistrationFlow.MarketingSource = Request.Form[MarketingSourceDropDown.UniqueID + "_hidden"] ?? string.Empty; } return(true); }
protected void Page_Load(object sender, EventArgs e) { Page.Title = "Request Report"; if (CurrentOrgRole.CheckRole((long)Roles.Technician) || CurrentOrgRole.CheckRole((long)Roles.NursePractitioner)) { var obj = (Franchisee_Technician_TechnicianMaster)Master; obj.settitle("Request Report"); obj.SetBreadcrumb = "<a href=\"/Scheduling/Event/Index\">Dashboard</a>"; this.Form.Action = Request.RawUrl; } else { var obj = (CallCenter_CallCenterMaster1)Master; obj.SetTitle("Request Report"); obj.SetBreadCrumbRoot = "<a href=\"/CallCenter/CallCenterRepDashboard/Index\">Dashboard</a>"; obj.hideucsearch(); } if (CurrentOrgRole.CheckRole((long)Roles.FranchisorAdmin)) { this.Form.Action = Request.RawUrl; } if (Request.QueryString["Call"] != null && Request.QueryString["Call"] == "No") { divCall.Style.Add(HtmlTextWriterStyle.Display, "none"); divCall.Style.Add(HtmlTextWriterStyle.Visibility, "hidden"); } if (!string.IsNullOrEmpty(Request.QueryString["EventId"])) { ResultOtion.EventId = Convert.ToInt64(Request.QueryString["EventId"]); } if (!IsPostBack) { if (string.IsNullOrEmpty(Request.QueryString["guid"]) && (CurrentOrgRole.CheckRole((long)Roles.Technician) || CurrentOrgRole.CheckRole((long)Roles.NursePractitioner) || CurrentOrgRole.CheckRole((long)Roles.FranchisorAdmin))) { hfGuId.Value = Guid.NewGuid().ToString(); var registrationFlow = new RegistrationFlowModel { GuId = hfGuId.Value }; RegistrationFlow = registrationFlow; } if (!string.IsNullOrEmpty(Request.QueryString["EventId"])) { hfEventID.Value = Request.QueryString["EventId"]; } RegistrationFlow.ShippingDetailId = 0; ProductOption.IsProductSelected = true; ProductOption.IsProductCheckboxEnabled = false; //if (!string.IsNullOrEmpty(Request.QueryString["EventId"])) // ProductOption.EventId = Convert.ToInt64(Request.QueryString["EventId"]); if (CallId != null) { hfCallStartTime.Value = new CallCenterCallRepository().GetCallStarttime(CallId.Value); } var customerRepository = IoC.Resolve <ICustomerRepository>(); var objCustomer = customerRepository.GetCustomer(CustomerId); spnCustomerName.InnerText = objCustomer.NameAsString; spnAddress.InnerText = objCustomer.Address.ToString(); spnEmail.InnerText = objCustomer.Email != null?objCustomer.Email.ToString() : string.Empty; ViewState["UrlReferer"] = "/App/CallCenter/CallCenterRep/CustomerOptions.aspx?CustomerID=" + objCustomer.CustomerId + "&Name=" + objCustomer.NameAsString + "&guid=" + GuId;//Request.UrlReferrer.PathAndQuery; if (CurrentOrgRole.CheckRole((long)Roles.Technician) || CurrentOrgRole.CheckRole((long)Roles.NursePractitioner) || CurrentOrgRole.CheckRole((long)Roles.FranchisorAdmin)) { if (!Request.UrlReferrer.PathAndQuery.ToLower().Contains(("/MakePaymentforAddonProduct").ToLower())) { ViewState["UrlReferer"] = Request.UrlReferrer.PathAndQuery; } else { ViewState["UrlReferer"] = Session["c_url"]; } } var masterDal = new MasterDAL(); List <EEvent> customerEvent = masterDal.GetCustomerEvent(CustomerId.ToString(), 1); var tbltemp = new DataTable(); tbltemp.Columns.Add("Id"); tbltemp.Columns.Add("Name"); tbltemp.Columns.Add("Date"); tbltemp.Columns.Add("City"); tbltemp.Columns.Add("AppTime"); tbltemp.Columns.Add("Package"); tbltemp.Columns.Add("PaymentMethod"); tbltemp.Columns.Add("Status"); tbltemp.Columns.Add("EventCustomerID"); tbltemp.Columns.Add("HostName"); tbltemp.Columns.Add("HostAddress"); tbltemp.Columns.Add("EventStatus"); if (customerEvent != null) { for (Int32 intCounter = 0; intCounter < customerEvent.Count; intCounter++) { string strEventDate = Convert.ToDateTime(customerEvent[intCounter].EventDate).ToString("MMM dd yyyy"); string strAppointmentStartTime = Convert.ToDateTime(customerEvent[intCounter].Customer[0].EventAppointment.StartTime).ToString("hh:mm tt"); string strAppointmentEndTime = Convert.ToDateTime(customerEvent[intCounter].Customer[0].EventAppointment.EndTime).ToString("hh:mm tt"); string strAppointmentTime = strAppointmentStartTime + " - " + strAppointmentEndTime; string strPackage = customerEvent[intCounter].Customer[0].EventPackage.Package.PackageName; string strReportStatus = customerEvent[intCounter].Customer[0].Interpreted.ToString(); string strPayMethod = customerEvent[intCounter].Customer[0].PaymentDetail.PaymentType.Name; string strHostAddress = CommonCode.AddressMultiLine(customerEvent[intCounter].Host.Address.Address1, customerEvent[intCounter].Host.Address.Address2, customerEvent[intCounter].Host.Address.City, customerEvent[intCounter].Host.Address.State, customerEvent[intCounter].Host.Address.Zip); tbltemp.Rows.Add(new object[] { customerEvent[intCounter].EventID, customerEvent[intCounter].Name, strEventDate, customerEvent[intCounter].Host.Address.City, strAppointmentStartTime, strPackage, strPayMethod, strReportStatus, customerEvent[intCounter].Customer[0].CustomerEventTestID, customerEvent[intCounter].Host.Name, strHostAddress, Convert.ToString(Enum.Parse(typeof(EventStatus), customerEvent[intCounter].EventStatus.ToString())) }); } dgeventhistory.DataSource = tbltemp; ViewState["DSGRID"] = tbltemp; dgeventhistory.DataBind(); dbsearch.Visible = true; dbsearch.Style["display"] = ""; dvSearchResult.InnerText = "Select the appointment you want to buy the add on product for:"; imgNext.Visible = true; } else { dbsearch.Visible = false; dbsearch.Style["display"] = ""; dgeventhistory.Visible = false; dvSearchResult.InnerText = "No Result found"; imgNext.Visible = false; } ResultOtion.ShowOnlineOption = false; } }
/// <summary> /// Method to search prospects based on search criteria /// </summary> private void SearchProspects() { // format phone no. CommonCode objCommonCode = new CommonCode(); //saving search parameter var parameterString = new string[18]; bool blnReset = false; string roleName = string.Empty; // reset flag if (Request["isreset"] != null && Request["isreset"] == "true") { blnReset = true; Session["ParameterStringHost"] = null; } if (Session["ParameterStringHost"] != null && blnReset == false) { parameterString = (string[])Session["ParameterStringHost"]; } if (Request["prospectname"] != null) { parameterString[0] = Request["prospectname"]; } if (Request["startdate"] != null) { parameterString[1] = Request["startdate"]; } if (Request["enddate"] != null) { parameterString[2] = Request["enddate"]; } if (Request["salesrepid"] != null) { parameterString[3] = Request["salesrepid"]; } if (Request["distance"] != null) { parameterString[4] = Request["distance"]; } if (Request["zipcode"] != null) { parameterString[5] = Request["zipcode"]; } if (Request["status"] != null) { parameterString[6] = Request["status"]; } if (Request["hasevent"] != null) { parameterString[7] = Request["hasevent"]; } if (Request["territory"] != null) { parameterString[8] = Request["territory"]; } if (Request["pagenumber"] != null) { parameterString[9] = Request["pagenumber"]; } if (Request["pagesize"] != null) { parameterString[10] = Request["pagesize"]; } // Assigned To if (Request["assignedTo"] != null) { parameterString[16] = Request["assignedTo"]; } // login role if (Request["role"] != null) { roleName = Request["role"]; } // prospectTypeId if (Request["hostType"] != null) { parameterString[17] = Request["hostType"]; } Session["ParameterStringHost"] = parameterString; long franchiseeid = 0; int territoryid = 0; string strProspectName = string.Empty; string strStartDate = string.Empty; string strEndDate = string.Empty; long iSalesPersonId = 0; long prospectTypeId = 0; int istatusId = 0; int itypeId = 0; string strUserId = string.Empty; string strZipCode = string.Empty; string strDistance = "0"; string strNotesToolTip = string.Empty; const int isFeeder = 4; string strSortColomn = string.Empty; string strSortOrder = string.Empty; int iPageSize = 5; int iPageIndex = 1; long iTotalRecord; long assignedTo = 0; var objFranchisorDal = new FranchisorDAL(); EProspect[] objProspects = null; // Prospect Name if (!string.IsNullOrEmpty(parameterString[0])) { strProspectName = parameterString[0]; } // Start Name if (!string.IsNullOrEmpty(parameterString[1])) { strStartDate = parameterString[1]; } // End Name if (!string.IsNullOrEmpty(parameterString[2])) { strEndDate = parameterString[2]; } // SalesPersonId if (!string.IsNullOrEmpty(parameterString[3])) { iSalesPersonId = Convert.ToInt64(parameterString[3]); } if (!string.IsNullOrEmpty(parameterString[4]) && (!string.IsNullOrEmpty(parameterString[5]))) { strDistance = parameterString[4]; strZipCode = parameterString[5]; } //StatusID if (!string.IsNullOrEmpty(parameterString[6])) { istatusId = Convert.ToInt32(parameterString[6]); } //event status if (!string.IsNullOrEmpty(parameterString[7])) { itypeId = Convert.ToInt32(parameterString[7]); } // Territory id if (!string.IsNullOrEmpty(parameterString[8])) { territoryid = Convert.ToInt32(parameterString[8]); } // Get Page Number if (!string.IsNullOrEmpty(parameterString[9])) { iPageIndex = Convert.ToInt32(parameterString[9]); } // Get Page Size if (!string.IsNullOrEmpty(parameterString[10])) { iPageSize = Convert.ToInt32(parameterString[10]); } // Franchisee id if (!string.IsNullOrEmpty(Request["franchiseeid"])) { franchiseeid = Convert.ToInt64(Request["franchiseeid"]); } // AssignedTo (FranchiFranchiseesUserId) if (!string.IsNullOrEmpty(parameterString[16])) { assignedTo = Convert.ToInt64(parameterString[16]); } // ProspectTypeId if (!string.IsNullOrEmpty(parameterString[17])) { prospectTypeId = Convert.ToInt64(parameterString[17]); } // Get Sort Column if (!string.IsNullOrEmpty(Request["sortcolumn"])) { strSortColomn = Request["sortcolumn"]; } // Get Sort Order if (!string.IsNullOrEmpty(Request["sortorder"])) { strSortOrder = Request["sortorder"]; } if (strSortOrder.Equals("Ascending")) { strSortOrder = " Asc "; } if (strSortOrder.Equals("Descending")) { strSortOrder = " Desc "; } //Get data for salesperson selected in dropdown id true else call all data if (FranchiseeView) { if (strUserId == "" && strZipCode == "" && (strDistance == "" || strDistance == "0")) { var listProspects = objFranchisorDal.GetProspectsDetail(strProspectName, strStartDate, strEndDate, franchiseeid, istatusId, itypeId, 2, "", 0, 1, isFeeder, iSalesPersonId, territoryid, strSortColomn, strSortOrder, iPageSize, iPageIndex, out iTotalRecord, 2, 2, 2, assignedTo, roleName, prospectTypeId); if (listProspects != null) { objProspects = listProspects.ToArray(); } } else if (strUserId != "" && strZipCode != "" && strDistance != "" && strDistance != "0") { var listProspects = objFranchisorDal.GetProspectsDetail(strProspectName, strStartDate, strEndDate, franchiseeid, istatusId, itypeId, 2, strZipCode, Convert.ToInt32(strDistance), 1, isFeeder, iSalesPersonId, territoryid, strSortColomn, strSortOrder, iPageSize, iPageIndex, out iTotalRecord, 2, 2, 2, assignedTo, roleName, prospectTypeId); if (listProspects != null) { objProspects = listProspects.ToArray(); } } else { var listProspects = objFranchisorDal.GetProspectsDetail(strProspectName, strStartDate, strEndDate, franchiseeid, istatusId, itypeId, 2, strZipCode, Convert.ToInt32(strDistance), 1, isFeeder, Convert.ToInt64(iSalesPersonId), territoryid, strSortColomn, strSortOrder, iPageSize, iPageIndex, out iTotalRecord, 2, 2, 2, assignedTo, roleName, prospectTypeId); if (listProspects != null) { objProspects = listProspects.ToArray(); } } } else { string shellId = IoC.Resolve <ISessionContext>().UserSession.CurrentOrganizationRole.OrganizationId.ToString(); var listProspects = objFranchisorDal.GetProspectsDetail(strProspectName, strStartDate, strEndDate, long.Parse(shellId), istatusId, itypeId, 2, strZipCode, int.Parse(strDistance), 1, isFeeder, iSalesPersonId, territoryid, strSortColomn, strSortOrder, iPageSize, iPageIndex, out iTotalRecord, 2, 2, 2, assignedTo, roleName, prospectTypeId); if (listProspects != null) { objProspects = listProspects.ToArray(); } } if (objProspects != null) { if (objProspects.Length == 1 && Request.QueryString["QuickSearch"] != null && Request.QueryString["QuickSearch"].Equals("True")) { Response.Write("/App/Franchisee/SalesRep/SalesRepProspectDetails.aspx?Type=Host&QuickSearch=True&ProspectID=" + objProspects[0].ProspectID); } else { var dtProspect = new DataTable(); //Create template for data table dtProspect.Columns.Add("ProspectId", typeof(Int32)); dtProspect.Columns.Add("ProspectName"); dtProspect.Columns.Add("ProspectCreatedDate"); dtProspect.Columns.Add("PhoneOffice"); dtProspect.Columns.Add("ProspectStatus"); dtProspect.Columns.Add("NoOFCalls"); dtProspect.Columns.Add("NoOFMeeting"); dtProspect.Columns.Add("NoOfContacts"); dtProspect.Columns.Add("SalesPersonFirstName"); dtProspect.Columns.Add("SalesPersonLastName"); dtProspect.Columns.Add("FranchiseeName"); dtProspect.Columns.Add("ProspectAddressId"); dtProspect.Columns.Add("ProspectAddress1"); dtProspect.Columns.Add("ProspectAddress2"); dtProspect.Columns.Add("ProspectCity"); dtProspect.Columns.Add("ProspectState"); dtProspect.Columns.Add("ProspectZip"); dtProspect.Columns.Add("ProspectCountry"); dtProspect.Columns.Add("ProspectCompleteAddress"); dtProspect.Columns.Add("ContactFirstName"); dtProspect.Columns.Add("ContactLastName"); dtProspect.Columns.Add("ContactPhone"); dtProspect.Columns.Add("ContactEmail"); dtProspect.Columns.Add("ContactCallDate"); dtProspect.Columns.Add("ContactCallStatus"); dtProspect.Columns.Add("LnkContactViewAll"); dtProspect.Columns.Add("LnkContactAddCall"); dtProspect.Columns.Add("LnkContactAddMeeting"); dtProspect.Columns.Add("LnkactivityNotes"); dtProspect.Columns.Add("LnkViewDetails"); dtProspect.Columns.Add("LnkAddContact"); dtProspect.Columns.Add("LnkConvertToHost"); dtProspect.Columns.Add("NotesToolTip"); //Add all the fetched data tto data table if (objProspects.Length > 0) { //// Case SalesRep //if (usershellmodulerole.RoleName == Roles.SalesRep.ToString()) //{ // //TODO: This filter is only for SaleRep and need to do for Franchisee also // // Sales Reps with territory assignments should only see hosts applicable to them. // long salesRepId = usershellmodulerole.RoleShellID; // ITerritoryRepository territoryRepository = new TerritoryRepository(); // IHostRepository hostRepository = new HostRepository(); // List<SalesRepTerritory> salesRepTerritories = territoryRepository.GetTerritoriesForSalesRep(salesRepId); // if (!salesRepTerritories.IsEmpty()) // { // IEnumerable<string> acceptableZipCodes = salesRepTerritories. // SelectMany(srt => srt.ZipCodes).Distinct().Select(z => z.Zip); // // Filter out hosts not located in zip codes of this sales rep's territories. // objProspects = objProspects.Where(p => acceptableZipCodes.Contains(p.Address.Zip)).ToArray(); // // Filter out hosts that do not host events of the type that the sales rep can see. // var prospectsToRemove = new List<EProspect>(); // foreach (EProspect prospect in objProspects) // { // string hostingZipCode = prospect.Address.Zip; // SalesRepTerritory territoryEventIsHostedIn = salesRepTerritories.Single(srt => srt.ZipCodes.Select(z => z.Zip). // Contains(hostingZipCode)); // EventType salesRepPermission = territoryEventIsHostedIn.SalesRepTerritoryAssignments. // Single(srta => srta.SalesRep.SalesRepresentativeId == salesRepId).EventTypeSetupPermission; // var acceptableEventTypes = hostRepository.GetEventTypesForHost(prospect.ProspectID); // if (salesRepPermission != EventType.Both && !acceptableEventTypes.Contains(salesRepPermission)) // { // prospectsToRemove.Add(prospect); // } // } // objProspects = objProspects.Except(prospectsToRemove).ToArray(); // iTotalRecord = objProspects.Count(); // } //} foreach (var objProspect in objProspects) { DataRow drProspect = dtProspect.NewRow(); drProspect["ProspectId"] = objProspect.ProspectID; drProspect["ProspectName"] = string.IsNullOrEmpty(objProspect.OrganizationName) ? "N/A" : objProspect.OrganizationName; drProspect["ProspectCreatedDate"] = string.IsNullOrEmpty(objProspect.ProspectDate) ? "N/A" : Convert.ToDateTime(objProspect.ProspectDate).ToShortDateString(); drProspect["PhoneOffice"] = !string.IsNullOrEmpty(objProspect.PhoneOffice) ? objCommonCode.FormatPhoneNumberGet(objProspect.PhoneOffice) : "N/A"; if (string.IsNullOrEmpty(objProspect.Status)) { drProspect["ProspectStatus"] = "N/A"; } else { string status; switch (objProspect.Status) { case "1": status = "Hot"; break; case "2": status = "Cold"; break; case "3": status = "Dead"; break; case "4": status = "Call Back"; break; default: status = "none"; break; } drProspect["ProspectStatus"] = status; } drProspect["NoOFCalls"] = objProspect.NoOfCalls; drProspect["NoOFMeeting"] = objProspect.NoOfMeetings; drProspect["NoOfContacts"] = objProspect.NoOfContacts; if (string.IsNullOrEmpty(objProspect.FirstName) && string.IsNullOrEmpty(objProspect.LastName)) { drProspect["SalesPersonFirstName"] = "N/A"; drProspect["SalesPersonLastName"] = ""; } else { drProspect["SalesPersonFirstName"] = objProspect.FirstName; drProspect["SalesPersonLastName"] = objProspect.LastName; } if (string.IsNullOrEmpty(objProspect.FranchiseeName)) { drProspect["FranchiseeName"] = "N/A"; } else { drProspect["FranchiseeName"] = objProspect.FranchiseeName; } var objAddress = objProspect.Address; // Set Initially the new line in address drProspect["ProspectAddressId"] = objAddress.AddressID.ToString(); drProspect["ProspectAddress1"] = string.IsNullOrEmpty(objAddress.Address1) ? "" : objAddress.Address1; drProspect["ProspectAddress2"] = string.IsNullOrEmpty(objAddress.Address2) ? "" : objAddress.Address2; drProspect["ProspectCity"] = string.IsNullOrEmpty(objAddress.City) ? "N/A" : objAddress.City; drProspect["ProspectState"] = string.IsNullOrEmpty(objAddress.State) ? "N/A" : objAddress.State; if (string.IsNullOrEmpty(objAddress.Zip) || (objAddress.Zip == "0")) { drProspect["ProspectZip"] = "N/A"; } else { drProspect["ProspectZip"] = objAddress.Zip; } // Format Address string prospectCompleteAddress = CommonCode.AddressMultiLine(objAddress.Address1, objAddress.Address2, objAddress.City, objAddress.State, objAddress.Zip); drProspect["ProspectCompleteAddress"] = prospectCompleteAddress; var objContact = objProspect.Contact.ToArray(); if (string.IsNullOrEmpty(objContact[0].FirstName)) { if (string.IsNullOrEmpty(objContact[0].LastName)) { drProspect["ContactFirstName"] = "N/A"; drProspect["ContactLastName"] = ""; } else { drProspect["ContactFirstName"] = objContact[0].FirstName; drProspect["ContactLastName"] = objContact[0].LastName; } } else { drProspect["ContactFirstName"] = objContact[0].FirstName; drProspect["ContactLastName"] = objContact[0].LastName; } if (string.IsNullOrEmpty(objContact[0].PhoneHome)) { drProspect["ContactPhone"] = "N/A"; } else if (objContact[0].PhoneHome.Trim().Equals("(___)-___-____")) { drProspect["ContactPhone"] = "N/A"; } else { drProspect["ContactPhone"] = objCommonCode.FormatPhoneNumberGet(objContact[0].PhoneHome); } drProspect["ContactEmail"] = string.IsNullOrEmpty(objContact[0].EMail) ? "N/A" : objContact[0].EMail; var objContactCall = objProspect.ContactCall; drProspect["ContactCallDate"] = string.IsNullOrEmpty(objContactCall.StartDate) ? "N/A" : objContactCall.StartDate; var objCallStatus = objContactCall.CallStatus; drProspect["ContactCallStatus"] = string.IsNullOrEmpty(objCallStatus.Status) ? "N/A" : objCallStatus.Status; // Prepare Notes ToolTips bool blnNotes = false; strNotesToolTip = strNotesToolTip + "<table cellpadding='3' cellspacing='0' border='0' width='100%'>"; // Date and Time if (!string.IsNullOrEmpty(objContactCall.StartDate)) { string[] strDateTime = objContactCall.StartDate.Split(' '); if (strDateTime.Length >= 2) { strNotesToolTip = strNotesToolTip + "<tr><td>Date: " + strDateTime[0] + "</td><td>Time: " + strDateTime[1] + "</td></tr>"; blnNotes = true; } } // Duration if (!string.IsNullOrEmpty(objCallStatus.Duration) && (objCallStatus.Duration != "0.00")) { strNotesToolTip = strNotesToolTip + "<tr><td colspan=2>Duration: " + objCallStatus.Duration + " mins.</td></tr>"; blnNotes = true; } // Status if (!string.IsNullOrEmpty(objCallStatus.Status)) { strNotesToolTip = strNotesToolTip + "<tr><td colspan=2>Status: " + objCallStatus.Status + "</td></tr>"; blnNotes = true; } // Notes if (!string.IsNullOrEmpty(objCallStatus.Notes)) { strNotesToolTip = strNotesToolTip + "<tr><td colspan=2>Notes: </td></tr><tr><td colspan=2>" + objCallStatus.Notes + "</td></tr>"; blnNotes = true; } strNotesToolTip = strNotesToolTip + "</table>"; drProspect["NotesToolTip"] = blnNotes ? strNotesToolTip : "<table cellpadding='3' cellspacing='0' border='0' width='100%'><tr><td> Details Not Available </td></tr></table>"; strNotesToolTip = string.Empty; dtProspect.Rows.Add(drProspect); } } if (dtProspect.Rows.Count > 0) { grdProspect.DataSource = dtProspect; grdProspect.DataBind(); string pagingstring = ImplementPaging(iPageIndex, iPageSize, iTotalRecord); HtmlForm formNew = Page.Form; formNew.Controls.Clear(); formNew.Controls.Add(grdProspect); var sb = new System.Text.StringBuilder(); var htWriter = new HtmlTextWriter(new System.IO.StringWriter(sb)); formNew.RenderControl(htWriter); string strRenderedHTML = sb.ToString(); int startindex = strRenderedHTML.IndexOf("<table"); int endindex = strRenderedHTML.LastIndexOf("</table>"); int length = (endindex - startindex) + 8; strRenderedHTML = strRenderedHTML.Substring(startindex, length); string totalRecord = "<span id=spnTotalRecordAsync>" + iTotalRecord + "</span>"; strRenderedHTML = "<div style='float: left; width: 746px'>" + strRenderedHTML + "</div>"; Response.Write(strRenderedHTML + pagingstring + "<p class=\"blueboxbotbg_cl\"><img src=\"/App/Images/specer.gif\" width=\"746\" height=\"5\" /></p>" + totalRecord); } else { string noRecordFound = "<div style='float:left; width:746px; border:solid 1px #E7F0F5; padding:10px 0px 10px 0px; display:block;' id='dvNoProspectFound' runat='server'>"; noRecordFound = noRecordFound + "<div class='divnoitemfound_custdbrd' style='margin-top:0px;'><p class='divnoitemtxt_custdbrd'><span class='orngbold18_default'>No Records Found</span></p></div></div>"; Response.Write(noRecordFound); } } } }
/// <summary> /// Get the list of sales rep of the /// advocate sales manager franchisee /// </summary> private void getTeamForAdvocateSalesManager() { // format phone no. CommonCode objCommonCode = new CommonCode(); //FranchiseeFranchiseeUserService objFFService = new FranchiseeFranchiseeUserService(); // Removed Franchisee Service FranchiseeDAL franchiseeDAL = new FranchiseeDAL(); List <EFranchiseeFranchiseeUser> objFFUser = null; //objFFUser = objFFService.GetTeamForAdvocateSalesManager(1, true, intAdvocateSalesManagerId, true); objFFUser = franchiseeDAL.GetTeamForAdvocateSalesManager(1, intAdvocateSalesManagerId); DataTable dtSalesTeam = new DataTable(); dtSalesTeam.Columns.Add("Sr"); dtSalesTeam.Columns.Add("FranchiseeFranchiseeUserID"); dtSalesTeam.Columns.Add("Name"); dtSalesTeam.Columns.Add("Phone"); dtSalesTeam.Columns.Add("Email"); dtSalesTeam.Columns.Add("FranchiseeID"); dtSalesTeam.Columns.Add("ManagerID"); dtSalesTeam.Columns.Add("ManagerName"); dtSalesTeam.Columns.Add("Status"); Falcon.Entity.Other.EUser objuser; if (objFFUser != null) { for (int icount = 0; icount < objFFUser.Count; icount++) { string strName; objuser = objFFUser[icount].FranchiseeUser.User; strName = CommonClass.FormatName(objuser.FirstName, objuser.MiddleName, objuser.LastName); string strStatus; if (objFFUser[icount].AdvocateSalesManagerID == 0) { strStatus = "<a href='#' onclick='return UpdateStatus(" + intAdvocateSalesManagerId + "," + objFFUser[icount].FranchiseeFranchiseeUserID + ",true)'>Add</a> "; } else if (objFFUser[icount].AdvocateSalesManagerID == intAdvocateSalesManagerId) { strStatus = "<a href='#' onclick='return UpdateStatus(" + intAdvocateSalesManagerId + "," + objFFUser[icount].FranchiseeFranchiseeUserID + ",false)'>Remove</a> "; } else { strStatus = objFFUser[icount].AdvocateSalesManager; } if ((objFFUser[icount].FranchiseeUser.User.PhoneHome == "") || (objFFUser[icount].FranchiseeUser.User.PhoneHome == string.Empty)) { objFFUser[icount].FranchiseeUser.User.PhoneHome = "N/A"; } else { objFFUser[icount].FranchiseeUser.User.PhoneHome = objCommonCode.FormatPhoneNumberGet(objFFUser[icount].FranchiseeUser.User.PhoneHome); } if ((objFFUser[icount].FranchiseeUser.User.EMail1 == "") || (objFFUser[icount].FranchiseeUser.User.EMail1 == string.Empty)) { objFFUser[icount].FranchiseeUser.User.EMail1 = "N/A"; } dtSalesTeam.Rows.Add(new object[] { icount + 1, objFFUser[icount].FranchiseeFranchiseeUserID, strName, objFFUser[icount].FranchiseeUser.User.PhoneHome, objFFUser[icount].FranchiseeUser.User.EMail1, objFFUser[icount].Franchisee.FranchiseeID, objFFUser[icount].AdvocateSalesManagerID, objFFUser[icount].AdvocateSalesManager, strStatus }); } } grdTeam.DataSource = dtSalesTeam; ViewState["DSGRID"] = dtSalesTeam; grdTeam.DataBind(); }
public void Apply() { _actor.Pseudo = _playerName; CommonCode.RefreshStats(Nc); string spells = ((List <mysql.players>)DataBase.DataTables.players).Find(f => f.pseudo == _playerName).sorts; // recuperer le totalXp du niveau en cours int totalXp = ((List <mysql.xplevel>)DataBase.DataTables.xplevel).Exists(f => f.level == _actor.level + 1) ? ((List <mysql.xplevel>)DataBase.DataTables.xplevel).Find(f => f.level == (_actor.level + 1)).xp : 0; // convertir la list de quete en string, ce code se trouve sur 2 endroit, quand le joueur selectionne un player et quand le joueur été déja dans un combat et que apres un co qui précédé une deco, le player se selectionne tous seul string quete = _actor.Quests.Aggregate("", (current, t) => current + (t.QuestName + ":" + t.MaxSteps + ":" + t.CurrentStep + ":" + t.Submited.ToString() + "/")); if (quete != "") { quete = quete.Substring(0, quete.Length - 1); } // si cette cmd est modifié, il faut aussi modifier les autre cmd cmd•SelectedPlayer• et checkandupdatestates string buffer = _actor.Pseudo + "#" + _actor.classeName + "#" + _actor.spirit + "#" + _actor.spiritLvl + "#" + _actor.Pvp + "#" + _actor.hiddenVillage + "#" + _actor.maskColorString + "#" + _actor.directionLook + "#" + _actor.level + "#" + _actor.map + "#" + _actor.officialRang + "#" + _actor.currentHealth + "#" + _actor.maxHealth + "#" + _actor.xp + "#" + totalXp + "#" + _actor.doton + "#" + _actor.katon + "#" + _actor.futon + "#" + _actor.raiton + "#" + _actor.suiton + "#" + MainClass.chakralvl1 + "#" + MainClass.chakralvl2 + "#" + MainClass.chakralvl3 + "#" + MainClass.chakralvl4 + "#" + MainClass.chakralvl5 + "#" + _actor.usingDoton + "#" + _actor.usingKaton + "#" + _actor.usingFuton + "#" + _actor.usingRaiton + "#" + _actor.usingSuiton + "#" + _actor.equipedDoton + "#" + _actor.equipedKaton + "#" + _actor.equipedFuton + "#" + _actor.equipedRaiton + "#" + _actor.equipedSuiton + "#" + _actor.originalPc + "#" + _actor.originalPm + "#" + _actor.pe + "#" + _actor.cd + "#" + _actor.summons + "#" + _actor.initiative + "#" + _actor.job1 + "#" + _actor.job2 + "#" + _actor.specialty1 + "#" + _actor.specialty2 + "#" + _actor.maxWeight + "#" + _actor.currentWeight + "#" + _actor.ryo + "#" + _actor.resiDotonPercent + "#" + _actor.resiKatonPercent + "#" + _actor.resiFutonPercent + "#" + _actor.resiRaitonPercent + "#" + _actor.resiSuitonPercent + "#" + _actor.dodgePC + "#" + _actor.dodgePM + "#" + _actor.dodgePE + "#" + _actor.dodgeCD + "#" + _actor.removePC + "#" + _actor.removePM + "#" + _actor.removePE + "#" + _actor.removeCD + "#" + _actor.escape + "#" + _actor.blocage + "#" + spells + "#" + _actor.resiDotonFix + "#" + _actor.resiKatonFix + "#" + _actor.resiFutonFix + "#" + _actor.resiRaitonFix + "#" + _actor.resiSuitonFix + "#" + _actor.resiFix + "#" + _actor.domDotonFix + "#" + _actor.domKatonFix + "#" + _actor.domFutonFix + "#" + _actor.domRaitonFix + "#" + _actor.domSuitonFix + "#" + _actor.domFix + "#" + _actor.power + "#" + _actor.equipedPower + "•" + quete + "•" + _actor.spellPointLeft; ConfirmSelectActorResponseMessage confirmSelectPlayerResponseMessage = new ConfirmSelectActorResponseMessage(); confirmSelectPlayerResponseMessage.Initialize(new [] { buffer }, Nc); confirmSelectPlayerResponseMessage.Serialize(); confirmSelectPlayerResponseMessage.Send(); mysql.connected newConnetion = ((List <mysql.connected>)DataBase.DataTables.connected).Find(f => f.user == _actor.Username); newConnetion.pseudo = _playerName; newConnetion.timestamp = CommonCode.ReturnTimeStamp(); newConnetion.map = _actor.map; newConnetion.map_position = _actor.map_position.X + "/" + _actor.map_position.Y; // il faut informer les autres de la connexion // pseudo#classe#pvp:spirit:spiritLvl#village#MaskColors#map_position#orientation#level#action#waypoint - separateur entre plusieurs joueurs string data = _actor.Pseudo + "#" + _actor.classeName + "#"; if (!_actor.Pvp) { data += "false:null:null#"; } else { data += "true:" + _actor.spirit + ":" + _actor.spiritLvl + "#"; // il faut renvoyer que True ou False au lieu de 0 ou 1, il faut aussi voir de l'autre coté "client MMORPG" } // ici on passe pas les dernier donné qui corespond à action(walk,idle...) et waypoint data += _actor.hiddenVillage + "#" + _actor.maskColorString + "#" + _actor.map_position.X + "/" + _actor.map_position.Y + "#" + _actor.directionLook + "#" + _actor.level + "##"; IList <NetConnection> abonnedPlayers = MainClass.netServer.Connections.FindAll(f => ((Actor)f.Tag).map == _actor.map && ((Actor)f.Tag).Pseudo != _actor.Pseudo && ((Actor)f.Tag).inBattle == 0); foreach (NetConnection t in abonnedPlayers) { SpawnActorResponseMessage spawnActorResponseMessage = new SpawnActorResponseMessage(); spawnActorResponseMessage.Initialize(new object[] { data }, t); spawnActorResponseMessage.Serialize(); spawnActorResponseMessage.Send(); } abonnedPlayers.Clear(); }
void DefaultCursor(Bmp bmp, MouseEventArgs e) { CommonCode.CursorDefault_MouseOut(null, null); }
private void Save() { // string format = "d"; CultureInfo cult = new CultureInfo("hi-IN"); string ref_no = ""; if (Ddl_advancerefNo.SelectedIndex > 0) { ref_no = Ddl_advancerefNo.SelectedItem.Text; } else { ref_no = ""; } pl.fin_year = ddlFinancial.SelectedValue; pl.EmpType = ddlEmpType.SelectedValue; pl.ECODE = ddl_emp.SelectedValue; pl.EMP_NAME = ddl_emp.SelectedItem.Text; pl.GPS_NPS = ddlGpsMps.SelectedValue; pl.refrence_no = ref_no; pl.freeze_flage = "N"; pl.DoB = Convert.ToDateTime(lblDoB.Text); pl.DateTime_Of_Start = Convert.ToDateTime(txtDateTimeStrt.Text); pl.Ranks = lblRank.Text.ToString(); pl.Gpf_Pran_No = Convert.ToDecimal(lblGPFNo.Text.Trim()); pl.BasicPay = Convert.ToDecimal(lblBasicPay.Text.Trim()); pl.HeadqtrOffice = ddlHdtrOffice.SelectedValue.ToString(); pl.OrderForMove_Duty = txtOfMDuty.Text.Trim(); pl.AuthorityRule_TR_SR = txtAuthRole.Text.Trim(); pl.StationFrom_Journey_commenced = txtStationfrmjnycom.Text.Trim(); pl.Levels = lblLevel.Text.Trim(); pl.Cells = lblCell.Text.Trim(); if (btnSave.Text == "Save") { pl.sptype = 1; pl.CreatedBy = Session["USERID"].ToString(); } else { pl.UpdatedBy = Session["UserID"].ToString(); pl.TableID = Convert.ToInt32(lblRecordID.Text); pl.sptype = 2; } List <PL_Tempdutychild> objlist = new List <PL_Tempdutychild>(); for (int row = 0; row < Grd.Rows.Count; row++) { PL_Tempdutychild pd = new PL_Tempdutychild(); pd.NameOfPlace_Arrived_At = Grd.Rows[row].Cells[0].Text; pd.Arvl_Date = Convert.ToDateTime(Grd.Rows[row].Cells[1].Text, cult); pd.Arvl_Hrs = Grd.Rows[row].Cells[2].Text; pd.Distance_by_Road = Grd.Rows[row].Cells[3].Text; pd.ConveyMode = Grd.Rows[row].Cells[4].Text; pd.ConveyClass = Grd.Rows[row].Cells[5].Text; pd.Departure_Date = Convert.ToDateTime(Grd.Rows[row].Cells[6].Text, cult); pd.Departure_Hrs = Grd.Rows[row].Cells[7].Text; pd.NoOfDA = Convert.ToDecimal(Grd.Rows[row].Cells[8].Text); pd.Rate_RMA_DA = Grd.Rows[row].Cells[9].Text; pd.Amount = Convert.ToDecimal(Grd.Rows[row].Cells[10].Text); pd.Remark = Grd.Rows[row].Cells[11].Text; objlist.Add(pd); } string xmlDoc = CommonCode.ConvertToXMLFormat <PL_Tempdutychild>(ref objlist); int result = bl.Insert(pl, xmlDoc); if (result > 0) { Reset(); bindgrdData(); Messagebox.Show(pl.MSG); } else { Messagebox.Show(pl.MSG); } }
public void Fetch(string[] commandStrings) { #region // connexion d'un joueur // pseudo#classe#pvp:spirit:spiritLvl#village#MaskColors#map_position#orientation#level#action#waypoint - separateur entre plusieurs joueurs // pvp=0 donc mode pvp off, si pvp = 1 mode pvp on string[] data = commandStrings[1].Split('#'); string playerName = data[0]; Enums.ActorClass.ClassName className = (Enums.ActorClass.ClassName)Enum.Parse(typeof(Enums.ActorClass.ClassName), data[1]); bool pvpEnabled = bool.Parse(data[2].Split(':')[0]); Enums.Spirit.Name spirit = (Enums.Spirit.Name)Enum.Parse(typeof(Enums.Spirit.Name), data[2].Split(':')[1]); int spiritLevel = int.Parse(data[2].Split(':')[2]); Enums.HiddenVillage.Names hiddenVillage = (Enums.HiddenVillage.Names)Enum.Parse(typeof(Enums.HiddenVillage.Names), data[3]); string maskColorsString = data[4]; string[] maskColors = maskColorsString.Split('/'); Point mapPosition = new Point(Convert.ToInt16(data[5].Split('/')[0]), Convert.ToInt16(data[5].Split('/')[1])); int directionLook = int.Parse(data[6]); int level = int.Parse(data[7]); Enums.AnimatedActions.Name animatedAction = (data[8] != "") ? (Enums.AnimatedActions.Name)Enum.Parse(typeof(Enums.AnimatedActions.Name), data[8]) : Enums.AnimatedActions.Name.idle; string waypoint = data[9]; // verifier si le personnage est deja present pour ne pas créer un doublons, si par erreur le serveur n'envoie pas une cmd de deconnexion du client ou SessionZero if (CommonCode.AllActorsInMap.Exists(f => ((Actor)f.tag).pseudo == playerName && ((Actor)f.tag).pseudo != CommonCode.MyPlayerInfo.instance.pseudo)) { Bmp tmpBmp = CommonCode.AllActorsInMap.Find(f => ((Actor)f.tag).pseudo == playerName); tmpBmp.visible = false; Manager.manager.GfxObjList.RemoveAll(f => f != null && f.GetType() == typeof(Bmp) && f.Tag() != null && f.Tag().GetType() == typeof(Actor) && ((Actor)f.Tag()).pseudo == playerName); CommonCode.AllActorsInMap.Remove(CommonCode.AllActorsInMap.Find(f => ((Actor)f.tag).pseudo == playerName)); } // affichage du personnage + position + orientation Bmp ibPlayers = new Bmp(@"gfx\general\classes\" + className + ".dat", Point.Empty, "Player_" + playerName, 0, true, 1, SpriteSheet.GetSpriteSheet(className.ToString(), CommonCode.ConvertToClockWizeOrientation(directionLook))); ibPlayers.MouseOver += CommonCode.ibPlayers_MouseOver; ibPlayers.MouseOut += CommonCode.ibPlayers_MouseOut; ibPlayers.MouseMove += CommonCode.CursorHand_MouseMove; ibPlayers.MouseClic += CommonCode.ibPlayers_MouseClic; Manager.manager.GfxObjList.Add(ibPlayers); // attachement des données ibPlayers.tag = new Actor(playerName, level, !pvpEnabled ? Enums.Spirit.Name.neutral : spirit, className, pvpEnabled, !pvpEnabled ? 0 : spiritLevel, hiddenVillage, maskColorsString, directionLook, animatedAction, waypoint); Actor pi = (Actor)ibPlayers.tag; pi.realPosition = mapPosition; CommonCode.AdjustPositionAndDirection(ibPlayers, new Point(mapPosition.X * 30, mapPosition.Y * 30)); CommonCode.VerticalSyncZindex(ibPlayers); // affichage des ailles if (pi.pvpEnabled) { if (pi.spirit != Enums.Spirit.Name.neutral) { Bmp spiritBmp = new Bmp(@"gfx\general\obj\2\" + pi.spirit + @"\" + pi.spiritLevel + ".dat", Point.Empty, "spirit_" + ibPlayers.name, Manager.TypeGfx.Obj, false, 1); spiritBmp.point = new Point((ibPlayers.rectangle.Width / 2) - (spiritBmp.rectangle.Width / 2), -spiritBmp.rectangle.Height); ibPlayers.Child.Add(spiritBmp); Txt lPseudo = new Txt(pi.pseudo, Point.Empty, "lPseudo_" + ibPlayers.name, Manager.TypeGfx.Obj, false, new Font("Verdana", 10, FontStyle.Regular), Brushes.Red); lPseudo.point = new Point((ibPlayers.rectangle.Width / 2) - (TextRenderer.MeasureText(lPseudo.Text, lPseudo.font).Width / 2) + 5, -spiritBmp.rectangle.Height - 15); ibPlayers.Child.Add(lPseudo); Txt lLvlSpirit = new Txt(pi.spiritLevel.ToString(), Point.Empty, "lLvlSpirit_" + ibPlayers.name, Manager.TypeGfx.Obj, false, new Font("Verdana", 10, FontStyle.Bold), Brushes.Red); lLvlSpirit.point = new Point((ibPlayers.rectangle.Width / 2) - (TextRenderer.MeasureText(lLvlSpirit.Text, lLvlSpirit.font).Width / 2) + 2, -spiritBmp.rectangle.Y - (spiritBmp.rectangle.Height / 2) - (TextRenderer.MeasureText(lLvlSpirit.Text, lLvlSpirit.font).Height / 2)); ibPlayers.Child.Add(lLvlSpirit); Bmp village = new Bmp(@"gfx\general\obj\1\pays_thumbs.dat", Point.Empty, "village_" + pi.hiddenVillage, Manager.TypeGfx.Obj, false, 1, SpriteSheet.GetSpriteSheet("pays_" + pi.hiddenVillage + "_thumbs", 0)); village.point = new Point((ibPlayers.rectangle.Width / 2) - (village.rectangle.Width / 2), lPseudo.point.Y - village.rectangle.Height + 2); ibPlayers.Child.Add(village); } } else { Txt lPseudo = new Txt(pi.pseudo, Point.Empty, "lPseudo_" + ibPlayers.name, Manager.TypeGfx.Obj, false, new Font("Verdana", 10, FontStyle.Regular), Brushes.Red); lPseudo.point = new Point((ibPlayers.rectangle.Width / 2) - (TextRenderer.MeasureText(lPseudo.Text, lPseudo.font).Width / 2) + 5, -15); ibPlayers.Child.Add(lPseudo); Bmp village = new Bmp(@"gfx\general\obj\1\pays_thumbs.dat", Point.Empty, "village_" + pi.hiddenVillage, Manager.TypeGfx.Obj, false, 1, SpriteSheet.GetSpriteSheet("pays_" + pi.hiddenVillage + "_thumbs", 0)); village.point = new Point((ibPlayers.rectangle.Width / 2) - (village.rectangle.Width / 2), lPseudo.point.Y - village.rectangle.Height + 2); ibPlayers.Child.Add(village); } // coloriage selon le MaskColors if (maskColors[0] != "null") { Color tmpColor = Color.FromArgb(Convert.ToInt16(maskColors[0].Split('-')[0]), Convert.ToInt16(maskColors[0].Split('-')[1]), Convert.ToInt16(maskColors[0].Split('-')[2])); CommonCode.SetPixelToClass(className, tmpColor, 1, ibPlayers); } if (maskColors[1] != "null") { Color tmpColor = Color.FromArgb(Convert.ToInt16(maskColors[1].Split('-')[0]), Convert.ToInt16(maskColors[1].Split('-')[1]), Convert.ToInt16(maskColors[1].Split('-')[2])); CommonCode.SetPixelToClass(className, tmpColor, 2, ibPlayers); } if (maskColors[2] != "null") { Color tmpColor = Color.FromArgb(Convert.ToInt16(maskColors[2].Split('-')[0]), Convert.ToInt16(maskColors[2].Split('-')[1]), Convert.ToInt16(maskColors[2].Split('-')[2])); CommonCode.SetPixelToClass(className, tmpColor, 3, ibPlayers); } // ajout du joueur dans la liste des joueurs CommonCode.ApplyMaskColorToClasse(ibPlayers); CommonCode.AllActorsInMap.Add(ibPlayers); #endregion }
protected void Page_Load(object sender, EventArgs e) { Page.Title = "Request Report"; var obj = (CallCenter_CallCenterMaster1)Master; obj.SetTitle("Request Report"); obj.SetBreadCrumbRoot = "<a href=\"/CallCenter/CallCenterRepDashboard/Index\">Dashboard</a>"; obj.hideucsearch(); if (Request.QueryString["Call"] != null && Request.QueryString["Call"] == "No") { divCall.Style.Add(HtmlTextWriterStyle.Display, "none"); divCall.Style.Add(HtmlTextWriterStyle.Visibility, "hidden"); } if (!IsPostBack) { if (CallId != null) { hfCallStartTime.Value = new CallCenterCallRepository().GetCallStarttime(CallId.Value); } var customerRepository = IoC.Resolve <ICustomerRepository>(); var objCustomer = customerRepository.GetCustomer(CustomerId); spnCustomerName.InnerText = objCustomer.NameAsString; spnAddress.InnerText = objCustomer.Address.ToString(); spnEmail.InnerText = objCustomer.Email != null?objCustomer.Email.ToString() : string.Empty; ViewState["UrlReferer"] = "/App/CallCenter/CallCenterRep/CustomerOptions.aspx?CustomerID=" + objCustomer.CustomerId + "&Name=" + objCustomer.NameAsString + "&guid=" + GuId; //Request.UrlReferrer.PathAndQuery; var masterDal = new MasterDAL(); List <EEvent> customerEvent = masterDal.GetCustomerEvent(CustomerId.ToString(), 1); var tbltemp = new DataTable(); tbltemp.Columns.Add("Id"); tbltemp.Columns.Add("Name"); tbltemp.Columns.Add("Date"); tbltemp.Columns.Add("City"); tbltemp.Columns.Add("AppTime"); tbltemp.Columns.Add("Package"); tbltemp.Columns.Add("PaymentMethod"); tbltemp.Columns.Add("Status"); tbltemp.Columns.Add("EventCustomerID"); tbltemp.Columns.Add("HostName"); tbltemp.Columns.Add("HostAddress"); tbltemp.Columns.Add("EventStatus"); if (customerEvent != null) { for (Int32 intCounter = 0; intCounter < customerEvent.Count; intCounter++) { string strEventDate = Convert.ToDateTime(customerEvent[intCounter].EventDate).ToString("MMM dd yyyy"); string strAppointmentStartTime = Convert.ToDateTime(customerEvent[intCounter].Customer[0].EventAppointment.StartTime).ToString("hh:mm tt"); string strAppointmentEndTime = Convert.ToDateTime(customerEvent[intCounter].Customer[0].EventAppointment.EndTime).ToString("hh:mm tt"); string strAppointmentTime = strAppointmentStartTime + " - " + strAppointmentEndTime; string strPackage = customerEvent[intCounter].Customer[0].EventPackage.Package.PackageName; string strReportStatus = customerEvent[intCounter].Customer[0].Interpreted.ToString(); string strPayMethod = customerEvent[intCounter].Customer[0].PaymentDetail.PaymentType.Name; string strHostAddress = CommonCode.AddressMultiLine(customerEvent[intCounter].Host.Address.Address1, customerEvent[intCounter].Host.Address.Address2, customerEvent[intCounter].Host.Address.City, customerEvent[intCounter].Host.Address.State, customerEvent[intCounter].Host.Address.Zip); tbltemp.Rows.Add(new object[] { customerEvent[intCounter].EventID, customerEvent[intCounter].Name, strEventDate, customerEvent[intCounter].Host.Address.City, strAppointmentTime, strPackage, strPayMethod, strReportStatus, customerEvent[intCounter].Customer[0].CustomerEventTestID, customerEvent[intCounter].Host.Name, strHostAddress, Convert.ToString(Enum.Parse(typeof(EventStatus), customerEvent[intCounter].EventStatus.ToString())) }); } dgeventhistory.DataSource = tbltemp; ViewState["DSGRID"] = tbltemp; dgeventhistory.DataBind(); dbsearch.Visible = true; dbsearch.Style["display"] = ""; dvSearchResult.InnerText = "Select the appointment you want to buy the shipping option for:"; imgNext.Visible = true; } else { dbsearch.Visible = false; dbsearch.Style["display"] = ""; dgeventhistory.Visible = false; dvSearchResult.InnerText = "No Result found"; imgNext.Visible = false; } rbtReportMailY.Checked = true; ShippingOtion.ShowOnlineOption = false; } }
public void Fetch(string[] commandStrings) { // il faut voir le rawdata reçu si ca correspond vraiment a la longeur demandé et associé au variables ? #region reception des données du joueur qui a été selectionné dans la liste des joueurs /*_actor.Pseudo + "#"_actor.ClasseName + "#" + _actor.Spirit + "#" + _actor.SpiritLvl + * "#" + _actor.Pvp + "#" + _actor.village + "#" + _actor.MaskColors + "#" + * _actor.Orientation + "#" + _actor.Level + "#" + _actor.map + "#" + _actor.rang + "#" + * _actor.currentHealth + "#" + _actor.totalHealth + "#" + _actor.xp + "#" + totalXp + "#" + * _actor.doton + "#" + _actor.katon + "#" + _actor.futon + "#" + _actor.raiton + "#" + * _actor.suiton + "#" + MainClass.chakralvl2 + "#" + MainClass.chakralvl3 + "#" + * MainClass.chakralvl4 + "#" + MainClass.chakralvl5 + "#" + MainClass.chakralvl6 + "#" + * _actor.usingDoton + "#" + _actor.usingKaton + "#" + _actor.usingFuton + "#" + * _actor.usingRaiton + "#" + _actor.usingSuiton + "#" + _actor.equipedDoton + "#" + * _actor.equipedKaton + "#" + _actor.equipedFuton + "#" + _actor.equipedRaiton + "#" + * _actor.suitonEquiped + "#" + _actor.original_Pc + "#" + _actor.original_Pm + "#" + * _actor.pe + "#" + _actor.cd + "#" + _actor.invoc + "#" + _actor.Initiative + "#" + * _actor.job1 + "#" + _actor.job2 + "#" + _actor.specialite1 + "#" + _actor.specialite2 + "#" + * _actor.TotalPoid + "#" + _actor.CurrentPoid + "#" + _actor.Ryo + "#" + * _actor.resiDotonPercent + "#" + _actor.resiKatonPercent + "#" + _actor.resiFutonPercent + * "#" + _actor.resiRaitonPercent + "#" + _actor.resiSuitonPercent + "#" + _actor.dodgePC + * "#" + _actor.dodgePM + "#" + _actor.dodgePE + "#" + _actor.dodgeCD + "#" + _actor.removePC + * "#" + _actor.removePM + "#" + _actor.removePE + "#" + _actor.removeCD + "#" + _actor.escape + * "#" + _actor.blocage + "#" + _sorts + "#" + _actor.resiDotonFix + "#" + _actor.resiKatonFix + * "#" + _actor.resiFutonFix + "#" + _actor.resiRaitonFix + "#" + _actor.resiSuitonFix + "#" + * _actor.resiFix + "#" + _actor.domDotonFix + "#" + _actor.domKatonFix + "#" + * _actor.domFutonFix + "#" + _actor.domRaitonFix + "#" + _actor.domSuitonFix + "#" + * _actor.domFix + "#" + _actor.power + "#" + _actor.powerEquiped + "•" + quete + "•" + * _actor.spellPointLeft;*/ string[] states = commandStrings[1].Split('#'); string actorName = states[0]; Enums.ActorClass.ClassName className = (Enums.ActorClass.ClassName)Enum.Parse(typeof(Enums.ActorClass.ClassName), states[1]); Enums.Spirit.Name spirit = (Enums.Spirit.Name)Enum.Parse(typeof(Enums.Spirit.Name), states[2]); int spiritLevel = int.Parse(states[3]); bool pvpEnabled = bool.Parse(states[4]); Enums.HiddenVillage.Names hiddenVillage = (Enums.HiddenVillage.Names)Enum.Parse(typeof(Enums.HiddenVillage.Names), states[5]); string maskColorsString = states[6]; int orientation = int.Parse(states[7]); int level = int.Parse(states[8]); string map = states[9]; Enums.Rang.official officialRang = (Enums.Rang.official)Enum.Parse(typeof(Enums.Rang.official), states[10]); int currentHealth = int.Parse(states[11]); int maxHealth = int.Parse(states[12]); int currentXp = int.Parse(states[13]); int maxXp = int.Parse(states[14]); int doton = int.Parse(states[15]); int katon = int.Parse(states[16]); int futon = int.Parse(states[17]); int raiton = int.Parse(states[18]); int suiton = int.Parse(states[19]); int chakra1Level = int.Parse(states[20]); int chakra2Level = int.Parse(states[21]); int chakra3Level = int.Parse(states[22]); int chakra4Level = int.Parse(states[23]); int chakra5Level = int.Parse(states[24]); int usingDoton = int.Parse(states[25]); int usingKaton = int.Parse(states[26]); int usingFuton = int.Parse(states[27]); int usingRaiton = int.Parse(states[28]); int usingSuiton = int.Parse(states[29]); int equipedDoton = int.Parse(states[30]); int equipedKaton = int.Parse(states[31]); int equipedFuton = int.Parse(states[32]); int equipedRaiton = int.Parse(states[33]); int equipedSuiton = int.Parse(states[34]); int pc = int.Parse(states[35]); int pm = int.Parse(states[36]); int pe = int.Parse(states[37]); int cd = int.Parse(states[38]); int summons = int.Parse(states[39]); int initiative = int.Parse(states[40]); string job1 = states[41]; string job2 = states[42]; string specialty1 = states[43]; string specialty2 = states[44]; int maxWeight = int.Parse(states[45]); int currentWeight = int.Parse(states[46]); int ryo = int.Parse(states[47]); int resiDotonPercent = int.Parse(states[48]); int resiKatonPercent = int.Parse(states[49]); int resiFutonPercent = int.Parse(states[50]); int resiRaitonPercent = int.Parse(states[51]); int resiSuitonPercent = int.Parse(states[52]); int dodgePc = int.Parse(states[53]); int dodgePm = int.Parse(states[54]); int dodgePe = int.Parse(states[55]); int dodgeCd = int.Parse(states[56]); int removePc = int.Parse(states[57]); int removePm = int.Parse(states[58]); int removePe = int.Parse(states[59]); int removeCd = int.Parse(states[60]); int escape = int.Parse(states[61]); int blocage = int.Parse(states[62]); string[] spellsString = states[63].Split('/'); int resiDotonFix = int.Parse(states[64]); int resiKatonFix = int.Parse(states[65]); int resiFutonFix = int.Parse(states[66]); int resiRaitonFix = int.Parse(states[67]); int resiSuitonFix = int.Parse(states[68]); int resiFix = int.Parse(states[69]); int domDotonFix = int.Parse(states[70]); int domKatonFix = int.Parse(states[71]); int domFutonFix = int.Parse(states[72]); int domRaitonFix = int.Parse(states[73]); int domSuitonFix = int.Parse(states[74]); int domFix = int.Parse(states[75]); int power = int.Parse(states[76]); int equipedPower = int.Parse(states[77]); string questString = commandStrings[2]; int spellPointsLeft = int.Parse(commandStrings[3]); HudHandle.DrawHud(); new System.Threading.Thread(() => { #region on affiche une fenetre de chargement // compteur pour voir si le temps passé est sufisant pour voir le chargement, si non on oblige le joueur a patienter le reste du temps détérminé pour l'animation qui est de 300 miliseconds Benchmark.Start(); Bmp loadingParent = new Bmp(@"gfx\general\artwork\loading\naruto.dat", new Point(0, 0), "__loadingParent", Manager.TypeGfx.Bgr, true, 1) { zindex = 100 }; Manager.manager.GfxTopList.Add(loadingParent); // barre de chargement Bmp loadingGif = new Bmp(@"gfx\general\obj\1\loading1.dat", Point.Empty, "__loadingGif", Manager.TypeGfx.Bgr, true); loadingGif.point = new Point((ScreenManager.WindowWidth / 2) - (loadingGif.rectangle.Width / 2), ScreenManager.WindowHeight - 50); loadingParent.Child.Add(loadingGif); Txt loadingLabel = new Txt(CommonCode.TranslateText(187), Point.Empty, "__loadingLabel", Manager.TypeGfx.Top, true, new Font("Verdana", 10, FontStyle.Bold), Brushes.White); loadingLabel.point = new Point((ScreenManager.WindowWidth / 2) - (TextRenderer.MeasureText(loadingLabel.Text, loadingLabel.font).Width / 2), 610); loadingParent.Child.Add(loadingLabel); Anim loadingSystemStart = new Anim(15, 1); for (int cnt = 0; cnt < 15; cnt++) { loadingSystemStart.AddCell(@"gfx\general\obj\1\LoadingSystem.dat", 0, 300 + (cnt * 12), 550, 25 + (cnt * 2), 25 + (cnt * 2), 0.1F * (Convert.ToSingle(cnt)), 15); } loadingSystemStart.AddCell(@"gfx\general\obj\1\LoadingSystem.dat", 0, 300 + (15 * 12), 550, 25 + (15 * 2), 25 + (15 * 2), 0.1F * (Convert.ToSingle(15)), 15); loadingSystemStart.Ini(Manager.TypeGfx.Top, "__LoadingSystemStart", true); loadingSystemStart.AutoResetAnim = false; loadingSystemStart.Start(); loadingParent.Child.Add(loadingSystemStart); ///////////////////////////////////////////////////////////// CommonCode.MyPlayerInfo.instance.ibPlayer = new Bmp { tag = new Actor() }; Actor actor = (Actor)CommonCode.MyPlayerInfo.instance.ibPlayer.tag; actor.pseudo = actorName; actor.className = className; actor.spirit = spirit; actor.spiritLevel = spiritLevel; actor.pvpEnabled = pvpEnabled; actor.hiddenVillage = hiddenVillage; actor.maskColorString = maskColorsString; actor.directionLook = orientation; actor.level = level; actor.map = map; actor.officialRang = officialRang; actor.currentHealth = currentHealth; actor.maxHealth = maxHealth; actor.currentXp = currentXp; actor.maxXp = maxXp; actor.doton = doton; actor.katon = katon; actor.futon = futon; actor.raiton = raiton; actor.suiton = suiton; // association des données des chakralvl2,3,4,5 CommonCode.chakra1Level = chakra1Level; CommonCode.chakra2Level = chakra2Level; CommonCode.chakra3Level = chakra3Level; CommonCode.chakra4Level = chakra4Level; CommonCode.chakra5Level = chakra5Level; actor.usingDoton = usingDoton; actor.usingKaton = usingKaton; actor.usingFuton = usingFuton; actor.usingRaiton = usingRaiton; actor.usingSuiton = usingSuiton; actor.equipedDoton = equipedDoton; actor.equipedKaton = equipedKaton; actor.equipedFuton = equipedFuton; actor.equipedRaiton = equipedRaiton; actor.equipedSuiton = equipedSuiton; actor.originalPc = pc; actor.originalPm = pm; actor.pe = pe; actor.cd = cd; actor.summons = summons; actor.initiative = initiative; actor.job1 = job1; actor.job2 = job2; actor.specialty1 = specialty1; actor.specialty2 = specialty2; actor.maxWeight = maxWeight; actor.currentWeight = currentWeight; actor.ryo = ryo; actor.resiDotonPercent = resiDotonPercent; actor.resiKatonPercent = resiKatonPercent; actor.resiFutonPercent = resiFutonPercent; actor.resiRaitonPercent = resiRaitonPercent; actor.resiSuitonPercent = resiSuitonPercent; actor.dodgePc = dodgePc; actor.dodgePm = dodgePm; actor.dodgePe = dodgePe; actor.dodgeCd = dodgeCd; actor.removePc = removePc; actor.removePm = removePm; actor.removePe = removePe; actor.removeCd = removeCd; actor.escape = escape; actor.blocage = blocage; if (spellsString.Length > 0) { foreach (string t in spellsString) { Actor.SpellsInformations infoSorts = new Actor.SpellsInformations { sortID = Convert.ToInt32(t.Split(':')[0]), emplacement = Convert.ToInt32(t.Split(':')[1]), level = Convert.ToInt32(t.Split(':')[2]), colorSort = Convert.ToInt32(t.Split(':')[3]) }; actor.spells.Add(infoSorts); } } actor.resiDotonFix = resiDotonFix; actor.resiKatonFix = resiKatonFix; actor.resiFutonFix = resiFutonFix; actor.resiRaitonFix = resiRaitonFix; actor.resiSuitonFix = resiSuitonFix; actor.resiFix = resiFix; // supression des sorts s'il sont déja été affiché avant if (HudHandle.all_sorts.Child.Count > 0) { HudHandle.all_sorts.Child.Clear(); } // affichage des sorts foreach (Actor.SpellsInformations t in actor.spells) { Bmp spell = new Bmp(@"gfx\general\obj\1\spells.dat", new Point(spells.spellPositions[t.emplacement].X, spells.spellPositions[t.emplacement].Y), "__spell", Manager.TypeGfx.Top, true, 1, SpriteSheet.GetSpriteSheet(t.sortID + "_spell", 0)) { tag = t }; // attachement des infos du sort au tag de l'image spell.MouseMove += MMORPG.Battle.__spell_MouseMove; spell.MouseOut += CommonCode.CursorDefault_MouseOut; spell.MouseClic += MMORPG.Battle.__spell_MouseClic; HudHandle.all_sorts.Child.Add(spell); } actor.domDotonFix = domDotonFix; actor.domKatonFix = domKatonFix; actor.domFutonFix = domFutonFix; actor.domRaitonFix = domRaitonFix; actor.domSuitonFix = domSuitonFix; actor.domFix = domFix; actor.power = power; actor.equipedPower = equipedPower; CommonCode.CurMap = actor.map; Benchmark.End(); System.Threading.Thread.Sleep(225); loadingLabel.Text = CommonCode.TranslateText(188); loadingLabel.point = new Point((ScreenManager.WindowWidth / 2) - (TextRenderer.MeasureText(loadingLabel.Text, loadingLabel.font).Width / 2), 610); ////////////////// mode designe loadingSystemStart.Visible(false); loadingParent.Child.Remove(loadingSystemStart); Anim loadingSystemEnd = new Anim(15, 1); for (int cnt = 0; cnt < 15; cnt++) { loadingSystemEnd.AddCell(@"gfx\general\obj\1\LoadingSystem.dat", 0, loadingSystemStart.img.point.X + (cnt * 12), 550, 25 + ((15 - cnt) * 2), 25 + ((15 - cnt) * 2), 0.1F * (Convert.ToSingle(15 - cnt)), 15); } loadingSystemEnd.Ini(Manager.TypeGfx.Top, "__LoadingSystemEnd", true); loadingSystemEnd.AutoResetAnim = false; loadingSystemEnd.Start(); loadingParent.Child.Add(loadingSystemEnd); Anim loadingGfxStart = new Anim(15, 1); for (int cnt = 0; cnt < 15; cnt++) { loadingGfxStart.AddCell(@"gfx\general\obj\1\GrayPaletteColor.dat", 0, 300 + (cnt * 12), 550, 25 + (cnt * 2), 25 + (cnt * 2), 0.1F * (Convert.ToSingle(cnt)), 15); } loadingGfxStart.AddCell(@"gfx\general\obj\1\paletteColor.dat", 0, 300 + (15 * 12), 550, 25 + (15 * 2), 25 + (15 * 2), 0.1F * (Convert.ToSingle(15)), 15); loadingGfxStart.Ini(Manager.TypeGfx.Top, "__paletteColor", true); loadingGfxStart.AutoResetAnim = false; loadingGfxStart.Start(); loadingParent.Child.Add(loadingGfxStart); loadingLabel.Text = CommonCode.TranslateText(189); loadingLabel.point = new Point((ScreenManager.WindowWidth / 2) - (TextRenderer.MeasureText(loadingLabel.Text, loadingLabel.font).Width / 2), 610); ///////////////// affichage des composants du tableau stats // affichage de l'avatar MenuStats.ThumbsAvatar = new Bmp(@"gfx\general\classes\" + actor.className + ".dat", new Point(15, 10), "ThumbsAvatar", Manager.TypeGfx.Top, true, 1, SpriteSheet.GetSpriteSheet("avatar_" + actor.className, 0)) { tag = CommonCode.MyPlayerInfo.instance.ibPlayer.tag }; CommonCode.ApplyMaskColorToClasse(MenuStats.ThumbsAvatar); MenuStats.StatsImg.Child.Add(MenuStats.ThumbsAvatar); // affichage du nom du personnage MenuStats.StatsPlayerName.Text = actor.pseudo[0].ToString().ToUpper() + actor.pseudo.Substring(1, actor.pseudo.Length - 1); // level MenuStats.StatsLevel.Text = CommonCode.TranslateText(50) + " " + actor.level; // affichage du rang général MenuStats.Rang.Text = CommonCode.officialRangToCurrentLangTranslation(actor.officialRang); // affichage du level Pvp MenuStats.LevelPvp.Text = actor.spiritLevel.ToString(); // affichage du grade Pvp if (spirit != Enums.Spirit.Name.neutral) { MenuStats.GradePvp = new Bmp(@"gfx\general\obj\2\" + actor.spirit + @"\" + MenuStats.LevelPvp.Text + ".dat", new Point(276 + (15 - Convert.ToInt16(MenuStats.LevelPvp.Text)), 2), new Size(40 + Convert.ToInt16(MenuStats.LevelPvp.Text), 20 + Convert.ToInt16(MenuStats.LevelPvp.Text)), "PlayerStats." + actor.spirit, Manager.TypeGfx.Top, true, 1); MenuStats.StatsImg.Child.Add(MenuStats.GradePvp); } // update des pdv,Pc HudHandle.UpdateHealth(); HudHandle.UpdatePc(); HudHandle.UpdatePm(); MenuStats.Flag = new Bmp(@"gfx\general\obj\1\pays_thumbs.dat", new Point(240, 8), "__Flag", Manager.TypeGfx.Top, true, 1, SpriteSheet.GetSpriteSheet("pays_" + actor.hiddenVillage + "_thumbs", 0)); MenuStats.StatsImg.Child.Add(MenuStats.Flag); MenuStats.LFlag.Text = hiddenVillage.ToString(); MenuStats.Fusion1.Text = CommonCode.TranslateText(75); MenuStats.Fusion2.Text = CommonCode.TranslateText(75); MenuStats.NiveauGaugeTxt.Text = CommonCode.TranslateText(50) + " " + actor.level; // NiveauGaugeRecPercent, barre de progression du niveau // calcule du pourcentage du niveau en progression int currentProgressLevel = actor.currentXp; int totalProgressLevel = actor.maxXp; int percentProgressLevel; if (totalProgressLevel != 0) { percentProgressLevel = (currentProgressLevel * 100) / totalProgressLevel; } else { percentProgressLevel = 100; } MenuStats.NiveauGaugeRecPercent.size.Width = (258 * percentProgressLevel) / 100; // affichage du label progression lvl MenuStats.NiveauGaugeTxtCurrent.Text = currentProgressLevel + "/" + totalProgressLevel + " (" + percentProgressLevel + "%)"; MenuStats.NiveauGaugeTxtCurrent.point = new Point(MenuStats.NiveauGaugeRec2.point.X + (MenuStats.NiveauGaugeRec2.size.Width / 2) - (TextRenderer.MeasureText(MenuStats.NiveauGaugeTxtCurrent.Text, MenuStats.NiveauGaugeTxtCurrent.font).Width / 2), MenuStats.NiveauGaugeRec2.point.Y); // raffrechissement du text pour des mesures de changement de langue MenuStats.AffiniteElementaireTxt.Text = CommonCode.TranslateText(76); MenuStats.terreStats.Text = "(" + CommonCode.TranslateText(77) + ")"; MenuStats.FeuStats.Text = "(" + CommonCode.TranslateText(78) + ")"; MenuStats.VentStats.Text = "(" + CommonCode.TranslateText(79) + ")"; MenuStats.FoudreStats.Text = "(" + CommonCode.TranslateText(80) + ")"; MenuStats.EauStats.Text = "(" + CommonCode.TranslateText(81) + ")"; MenuStats.TerrePuissance.Text = "(" + actor.doton + "+" + actor.equipedDoton + ")=" + (actor.doton + actor.equipedDoton); MenuStats.FeuPuissance.Text = "(" + actor.katon + "+" + actor.equipedKaton + ")=" + (actor.katon + actor.equipedKaton); MenuStats.VentPuissance.Text = "(" + actor.futon + "+" + actor.equipedFuton + ")=" + (actor.futon + actor.equipedFuton); MenuStats.FoudrePuissance.Text = "(" + actor.raiton + "+" + actor.equipedRaiton + ")=" + (actor.raiton + actor.equipedRaiton); MenuStats.EauPuissance.Text = "(" + actor.suiton + "+" + actor.equipedSuiton + ")=" + (actor.suiton + actor.equipedSuiton); MenuStats.Lvl1RegleTxt.Text = CommonCode.TranslateText(82); MenuStats.Lvl2RegleTxt.Text = CommonCode.TranslateText(83); MenuStats.Lvl3RegleTxt.Text = CommonCode.TranslateText(84); MenuStats.Lvl4RegleTxt.Text = CommonCode.TranslateText(85); MenuStats.Lvl5RegleTxt.Text = CommonCode.TranslateText(86); MenuStats.Lvl6RegleTxt.Text = CommonCode.TranslateText(87); // affichage de la gauge lvl chakra selon les points MenuStats.Lvl2ReglePts.Text = CommonCode.chakra1Level.ToString(); MenuStats.Lvl3ReglePts.Text = CommonCode.chakra2Level.ToString(); MenuStats.Lvl4ReglePts.Text = CommonCode.chakra3Level.ToString(); MenuStats.Lvl5ReglePts.Text = CommonCode.chakra4Level.ToString(); MenuStats.Lvl6ReglePts.Text = CommonCode.chakra5Level.ToString(); // modification du lvl de l'utilisation de l'element CommonCode.UpdateUsingElement(Enums.Chakra.Element.doton, actor.usingDoton); CommonCode.UpdateUsingElement(Enums.Chakra.Element.katon, actor.usingKaton); CommonCode.UpdateUsingElement(Enums.Chakra.Element.futon, actor.usingFuton); CommonCode.UpdateUsingElement(Enums.Chakra.Element.raiton, actor.usingRaiton); CommonCode.UpdateUsingElement(Enums.Chakra.Element.suiton, actor.equipedSuiton); MenuStats.DotonLvl.Text = actor.usingDoton.ToString(); MenuStats.KatonLvl.Text = actor.usingKaton.ToString(); MenuStats.FutonLvl.Text = actor.usingFuton.ToString(); MenuStats.RaitonLvl.Text = actor.usingRaiton.ToString(); MenuStats.SuitonLvl.Text = actor.usingSuiton.ToString(); // bar de vie selon les pdv 11 current, 12 total int totalPdv = actor.maxHealth; int currentPdv = actor.currentHealth; int x = 0; if (totalPdv != 0) { x = (currentPdv * 100) / totalPdv; } MenuStats.VieBar.size.Width = (236 * x) / 100; // point de vie dans Menustats MenuStats.VieLabel.Text = CommonCode.TranslateText(88); MenuStats.ViePts.Text = currentPdv + " / " + totalPdv + " (" + x + "%)"; MenuStats.PC.Text = actor.originalPc.ToString(); MenuStats.PM.Text = actor.originalPm.ToString(); MenuStats.PE.Text = actor.pe.ToString(); MenuStats.CD.Text = actor.cd.ToString(); MenuStats.Invoc.Text = actor.summons.ToString(); MenuStats.Initiative.Text = actor.initiative.ToString(); MenuStats.Puissance.Text = (actor.power + actor.equipedPower).ToString(); MenuStats.DomFix.Text = actor.domFix.ToString(); MenuStats.Job1Label.Text = CommonCode.TranslateText(95) + " 1"; MenuStats.Specialite1Label.Text = CommonCode.TranslateText(96) + " 1"; MenuStats.Job2Labe1.Text = CommonCode.TranslateText(95) + " 2"; MenuStats.Specialite2Label.Text = CommonCode.TranslateText(96) + " 2"; //////// playerData[41] = job1 //////// playerdata[42] = job2 //////// playerdata[43] = specialite1 //////// playerdata[44] = specialite2 MenuStats.PoidLabel.Text = CommonCode.TranslateText(97); int totalPoid = actor.maxWeight; int currentPoid = actor.currentWeight; int percentPoid = (currentPoid * 100) / totalPoid; MenuStats.PoidRec.size.Width = (116 * percentPoid) / 100; MenuStats.Poid.Text = currentPoid + " / " + totalPoid + " (" + percentPoid + "%)"; MenuStats.Poid.point.X = MenuStats.PoidRec.point.X + 58 - (TextRenderer.MeasureText(MenuStats.Poid.Text, MenuStats.Poid.font).Width / 2); MenuStats.Ryo.Text = CommonCode.MoneyThousendSeparation(actor.ryo.ToString()); MenuStats.resiDotonTxt.Text = actor.resiDotonPercent + "%"; MenuStats.resiKatonTxt.Text = actor.resiKatonPercent + "%"; MenuStats.resiFutonTxt.Text = actor.resiFutonPercent + "%"; MenuStats.resiRaitonTxt.Text = actor.resiRaitonPercent + "%"; MenuStats.resiSuitonTxt.Text = actor.resiSuitonPercent + "%"; MenuStats.__esquivePC_Txt.Text = actor.dodgePc.ToString(); MenuStats.__esquivePM_Txt.Text = actor.dodgePm.ToString(); MenuStats.__retraitPC_Txt.Text = actor.removePc.ToString(); MenuStats.__retraitPM_Txt.Text = actor.removePm.ToString(); // quete // convertir la list de quete en string if (questString != "") { for (int cnt = 0; cnt < questString.Split('/').Length; cnt++) { string quest = questString.Split('/')[cnt]; Actor.QuestInformations qi = new Actor.QuestInformations { nom_quete = quest.Split(':')[0], totalSteps = Convert.ToInt16(quest.Split(':')[1]), currentStep = Convert.ToInt16(quest.Split(':')[2]), submited = Convert.ToBoolean(quest.Split(':')[3]) }; actor.Quests.Add(qi); } } // verification si le joueur été en combat pour le rediriger vers ce joueur /*if (commandStrings[3] == "inBattle") * { * common1.MyPlayerInfo.instance.pseudo = pi.pseudo; * common1.MyPlayerInfo.instance.Event = "inBattle"; * }*/ actor.spellPointLeft = spellPointsLeft; ///// effacement du menu loading loadingLabel.Text = CommonCode.TranslateText(190); loadingLabel.point = new Point((ScreenManager.WindowWidth / 2) - (TextRenderer.MeasureText(loadingLabel.Text, loadingLabel.font).Width / 2), 610); System.Threading.Thread.Sleep(2000); // changement de map Manager.manager.mainForm.BeginInvoke((Action)(() => { CommonCode.ChangeMap(actor.map); // affichage du hud Manager.manager.GfxTopList.Remove(loadingParent); // enlever l'image d'avant plant qui empeche de voir la map MainForm.chatBox.Show(); HudHandle.HudVisibility(true); MainForm.drawSpellStatesMenuOnce(); HudHandle.chatBoxRefreshHandler(); HudHandle.recalibrateChatBoxPosition(); })); #endregion }).Start(); #endregion }
protected void gvRemoveFriend_RowCommand(object sender, GridViewCommandEventArgs e) { //string name1 = ""; ////string Id1=""; //string Id1 = Convert.ToString(e.CommandArgument); //tmp.Value = Id1; //string Sql1 = " SELECT DISTINCT UserMaster.usrFirstName +' '+ UserMaster.usrLastName as Name , " + // " FriendRelationMaster.Relation, FriendGroupRelation.GroupId " + // " FROM FriendGroupRelation INNER JOIN " + // " FriendRelationMaster ON FriendGroupRelation.RelId = FriendRelationMaster.FriRelId INNER JOIN " + // " UserMaster ON FriendRelationMaster.FriendId = UserMaster.usrUserId " + // " where FriendRelationMaster.FriRelId=" + Id1 + ""; //CommonCode cc1 = new CommonCode(); //DataSet ds1 = cc1.ExecuteDataset(Sql1); //foreach (DataRow dr in ds1.Tables[0].Rows) //{ // name1 = Convert.ToString(dr["Name"]); // string Relation = Convert.ToString(dr["Relation"]); //} if (e.CommandName == "Remove") { urUserRegBLLObj.frnrelFriendId = Convert.ToString(e.CommandArgument); urUserRegBLLObj.frnrelUserId = Convert.ToString(Session["User"]); status = urUserRegBLLObj.BLLUserFriendRelativeRemove(urUserRegBLLObj); if (status == 1) { ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Friend Removed')", true); urUserRegBLLObj.usrUserId = Convert.ToString(Session["User"]); DataTable dtFriendRelList = urUserRegBLLObj.BLLFriendRelativeShowById(urUserRegBLLObj); gvRemoveFriend.DataSource = dtFriendRelList; gvRemoveFriend.DataBind(); //gvSearchFriend.DataSource = dtFriendRelList; //gvSearchFriend.DataBind(); //TextfirstN.Text = ""; //TextlastN.Text = ""; } else { ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Friend Not Removed')", true); } } else if (e.CommandName == "Edit") { s = Convert.ToString(e.CommandArgument); urUserRegBLLObj.frnrelFriendId = Convert.ToString(e.CommandArgument); urUserRegBLLObj.frnrelUserId = Convert.ToString(Session["User"]); LoadFriendGroup(); string Id = Convert.ToString(e.CommandArgument); tmp.Value = Id; string Sql = " SELECT DISTINCT UserMaster.usrFirstName +' '+ UserMaster.usrLastName as Name , " + " FriendRelationMaster.Relation, FriendGroupRelation.GroupId " + " FROM FriendGroupRelation INNER JOIN " + " FriendRelationMaster ON FriendGroupRelation.RelId = FriendRelationMaster.FriRelId INNER JOIN " + " UserMaster ON FriendRelationMaster.FriendId = UserMaster.usrUserId " + " where FriendRelationMaster.FriRelId=" + Id + ""; CommonCode cc = new CommonCode(); DataSet ds = cc.ExecuteDataset(Sql); foreach (DataRow dr in ds.Tables[0].Rows) { lblName.Text = Convert.ToString(dr["Name"]); //string name1 = lblName.Text; txtRelation.Text = Convert.ToString(dr["Relation"]); string GroupId = Convert.ToString(dr["GroupId"]); for (int i = 0; i < chkGroup.Items.Count - 1; i++) { if (GroupId == Convert.ToString(chkGroup.Items[i].Value.ToString())) { chkGroup.Items[i].Selected = true; } } } try { tmp.Value = Id; con.Open(); string sql = "Select FriRelName from FriendRelationMaster where FriRelId= '" + Id.ToString() + "'"; SqlCommand cmd = new SqlCommand(sql, con); SqlDataReader dr = cmd.ExecuteReader(); DataSet dset = cc.ExecuteDataset(sql); foreach (DataRow dr1 in dset.Tables[0].Rows) { fname = Convert.ToString(dr1["FriRelName"]); } string fullname = fname; infix = fullname.Split(' '); ddlinfix.Items.Add(infix[0]); if (infix[1] == " " || infix[1] == null) { ddlinfix.Items.Add(""); } else { ddlinfix.Items.Add(infix[1]); } //{ // ddlinfix.DataTextField = dr["UserFirstNameN"].ToString(); // ddlinfix.DataValueField = dr["User"].ToString(); //} // SqlDataAdapter da = new SqlDataAdapter(sql, con); // DataSet dset = new DataSet(); // da.Fill(dset); // ddlinfix.DataSource = dset; // ddlinfix.DataTextField = "---Select--"; //Session["UserFirstNameN"] = ddlinfix.SelectedItem.Text.ToString(); // Session["UserLastNameN"] = ddlinfix.SelectedItem.Text.ToString(); //ddlinfix.DataValueField = "usrUserId"; //ddlinfix.DataTextField = "usrFirstName"; //ddlinfix.DataTextField = "usrLastName"; ddlinfix.DataBind(); } catch (Exception ex) { throw ex; } mdlEditGroup.Show(); } }
public void Fetch(string[] commandStrings) { #region MapData // commandStrings[1] = pseudo#classe#pvp:spirit:spiritLvl#village#MaskColors#map_position#orientation#level#action#waypoint#TotalPdv#CurrentPdv#rang | separateur entre plusieurs joueurs // pvp=0 donc mode pvp off, si pvp = 1 mode pvp on string[] playersInfos = commandStrings[1].Split('|'); foreach (string t in playersInfos) { string[] states = t.Split('#'); string actorName = states[0]; Enums.ActorClass.ClassName className = (Enums.ActorClass.ClassName)Enum.Parse(typeof(Enums.ActorClass.ClassName), states[1]); bool pvpEnabled = states[2].Split(':')[0] == "1"; Enums.Spirit.Name spirit = (Enums.Spirit.Name)Enum.Parse(typeof(Enums.Spirit.Name), states[2].Split(':')[1]); int spiritLevel = int.Parse(states[2].Split(':')[2]); Enums.HiddenVillage.Names hiddenVillage = (Enums.HiddenVillage.Names)Enum.Parse(typeof(Enums.HiddenVillage.Names), states[3]); string maskColors = states[4]; Point mapPoint = new Point(int.Parse(states[5].Split('/')[0]), int.Parse(states[5].Split('/')[1])); int orientation = int.Parse(states[6]); int level = int.Parse(states[7]); Enums.AnimatedActions.Name action = (Enums.AnimatedActions.Name)Enum.Parse(typeof(Enums.AnimatedActions.Name), states[8]); string waypoint = states[9]; int maxHealth = int.Parse(states[10]); int currentHealth = int.Parse(states[11]); // cette valeur n'est pas utilisé dans le jeu puisque le rang n'est pas encore affiché, il faut prévoir un truc pour montrer les rang de chaque joueur, ou pas si le rang dois etre caché, ptet que le rang est caché mais permet d'afficher le joueur avec un ora spécial Enums.Rang.official officialRang = (Enums.Rang.official)Enum.Parse(typeof(Enums.Rang.official), states[12]); // supprimer tout les anciennes instances qui correspond a ce joueur pour eviter un doublons ou une erreur de la part du serveur ou client s'il n'envoie pas la cmd de deconnexion du joeur au abonnés if (CommonCode.AllActorsInMap.Count(i => ((Actor)i.tag).pseudo == actorName) > 0) { Bmp allPlayers = CommonCode.AllActorsInMap.Find(f => ((Actor)f.tag).pseudo == actorName); allPlayers.visible = false; CommonCode.AllActorsInMap.Remove(allPlayers); CommonCode.AllActorsInMap.RemoveAll(i => ((Actor)i.tag).pseudo == actorName); } // affichage du personnage + position + orientation Bmp ibPlayers = new Bmp(@"gfx\general\classes\" + className + ".dat", Point.Empty, "Player_" + actorName, Manager.TypeGfx.Obj, true, 1, SpriteSheet.GetSpriteSheet(className.ToString(), CommonCode.ConvertToClockWizeOrientation(orientation))); ibPlayers.point = new Point((mapPoint.X * 30) + 15 - (ibPlayers.rectangle.Width / 2), (mapPoint.Y * 30) - (ibPlayers.rectangle.Height) + 15); ibPlayers.MouseOver += CommonCode.ibPlayers_MouseOver; ibPlayers.MouseOut += CommonCode.ibPlayers_MouseOut; ibPlayers.MouseMove += CommonCode.CursorHand_MouseMove; ibPlayers.MouseClic += CommonCode.ibPlayers_MouseClic; CommonCode.VerticalSyncZindex(ibPlayers); ibPlayers.TypeGfx = Manager.TypeGfx.Obj; Manager.manager.GfxObjList.Add(ibPlayers); ibPlayers.tag = CommonCode.MyPlayerInfo.instance.pseudo != actorName ? new Actor(actorName, level, !pvpEnabled ? Enums.Spirit.Name.neutral : spirit, className, pvpEnabled, !pvpEnabled ? 0 : spiritLevel, hiddenVillage, maskColors, orientation, action, waypoint) : CommonCode.MyPlayerInfo.instance.ibPlayer.tag; Actor actor = (Actor)ibPlayers.tag; actor.realPosition = mapPoint; actor.officialRang = officialRang; // affichage des ailles if (actor.pvpEnabled) { if (actor.spirit != Enums.Spirit.Name.neutral) { Bmp _spirit = new Bmp(@"gfx\general\obj\2\" + actor.spirit + @"\" + actor.spiritLevel + ".dat", Point.Empty, "spirit_" + ibPlayers.name, Manager.TypeGfx.Obj, false, 1); _spirit.point = new Point((ibPlayers.rectangle.Width / 2) - (_spirit.rectangle.Width / 2), -_spirit.rectangle.Height); ibPlayers.Child.Add(_spirit); Txt lPseudo = new Txt(actor.pseudo, Point.Empty, "lPseudo_" + ibPlayers.name, Manager.TypeGfx.Obj, false, new Font("Verdana", 10, FontStyle.Regular), Brushes.Red); lPseudo.point = new Point((ibPlayers.rectangle.Width / 2) - (TextRenderer.MeasureText(lPseudo.Text, lPseudo.font).Width / 2) + 5, -_spirit.rectangle.Height - 15); ibPlayers.Child.Add(lPseudo); Txt lLvlSpirit = new Txt(actor.spiritLevel.ToString(), Point.Empty, "lLvlSpirit_" + ibPlayers.name, Manager.TypeGfx.Obj, false, new Font("Verdana", 10, FontStyle.Bold), Brushes.Red); lLvlSpirit.point = new Point((ibPlayers.rectangle.Width / 2) - (TextRenderer.MeasureText(lLvlSpirit.Text, lLvlSpirit.font).Width / 2) + 2, -_spirit.rectangle.Y - (_spirit.rectangle.Height / 2) - (TextRenderer.MeasureText(lLvlSpirit.Text, lLvlSpirit.font).Height / 2)); ibPlayers.Child.Add(lLvlSpirit); Bmp village = new Bmp(@"gfx\general\obj\1\pays_thumbs.dat", Point.Empty, "village_" + actor.hiddenVillage, Manager.TypeGfx.Obj, false, 1, SpriteSheet.GetSpriteSheet("pays_" + actor.hiddenVillage + "_thumbs", 0)); village.point = new Point((ibPlayers.rectangle.Width / 2) - (village.rectangle.Width / 2), lPseudo.point.Y - village.rectangle.Height + 2); ibPlayers.Child.Add(village); } } else { Txt lPseudo = new Txt(actor.pseudo, Point.Empty, "lPseudo_" + ibPlayers.name, Manager.TypeGfx.Obj, false, new Font("Verdana", 10, FontStyle.Regular), Brushes.Red); lPseudo.point = new Point((ibPlayers.rectangle.Width / 2) - (TextRenderer.MeasureText(lPseudo.Text, lPseudo.font).Width / 2) + 5, -15); ibPlayers.Child.Add(lPseudo); Bmp village = new Bmp(@"gfx\general\obj\1\pays_thumbs.dat", Point.Empty, "village_" + actor.hiddenVillage, Manager.TypeGfx.Obj, false, 1, SpriteSheet.GetSpriteSheet("pays_" + actor.hiddenVillage + "_thumbs", 0)); village.point = new Point((ibPlayers.rectangle.Width / 2) - (village.rectangle.Width / 2), lPseudo.point.Y - village.rectangle.Height + 2); ibPlayers.Child.Add(village); } // coloriage du personnage et attachement du maskColor au personnage CommonCode.ApplyMaskColorToClasse(ibPlayers); // pointeur vers l'image ibplayer de notre joueur s'il s'agit de son personnage if (CommonCode.MyPlayerInfo.instance.pseudo == actor.pseudo) { CommonCode.MyPlayerInfo.instance.ibPlayer = ibPlayers; } // ajout du personnage dans la liste des joueurs CommonCode.AllActorsInMap.Add(ibPlayers); // lancement de l'animation de mouvement si le joueur a un waypoint if (actor.wayPoint.Count > 0) { //mouvement du personnage // thread a part Thread tAnimAction = new Thread(() => CommonCode.AnimAction(ibPlayers, actor.wayPoint, actor.wayPoint.Count > 5 ? 20 : 50)); tAnimAction.Start(); } // affectation des pdv actor.maxHealth = maxHealth; actor.currentHealth = currentHealth; } #endregion }
protected void btnUpdateContact_Click(object sender, EventArgs e) { //Update the Group //s = urUserRegBLLObj.frnrelUserId; string Id = tmp.Value; urUserRegBLLObj.frnrelUserId = Convert.ToString(Session["User"]); urUserRegBLLObj.frnrelFriendId = Convert.ToString(Id); urUserRegBLLObj.FrnrelPrefix = Convert.ToString(ddlprefix.SelectedItem.Text); if (ddlprefix.SelectedItem.Text == null) { urUserRegBLLObj.FrnrelPrefix = "Dear"; } urUserRegBLLObj.Frnrelinfix = Convert.ToString(ddlinfix.SelectedItem.Text); if (ddlinfix.SelectedItem.Text == null) { urUserRegBLLObj.Frnrelinfix = infix[0]; } urUserRegBLLObj.Frnrelpostfix = Convert.ToString(ddlpostfix.SelectedItem.Text); if (ddlpostfix.SelectedItem.Text == null) { urUserRegBLLObj.Frnrelpostfix = " "; } try { status = urUserRegBLLObj.BLLPrefixUpdate(urUserRegBLLObj); if (status == 0) { //ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('User already Exists')", true); } } catch (Exception ex) { throw ex; } string Sql = "Delete from friendGroupRelation where RelId=" + Id + " "; Sql = Sql + " Update FriendRelationMaster set Relation='" + txtRelation.Text.ToString() + "' " + " where FriRelId=" + Id + " "; //sql1=Sql+"update " for (int i = 0; i < chkGroup.Items.Count - 1; i++) { if (chkGroup.Items[i].Selected == true) { Sql = Sql + " Insert into FriendGroupRelation (RelId, GroupId) Values " + " (" + Id + "," + chkGroup.Items[i].Value.ToString() + " ) "; } } CommonCode cc = new CommonCode(); int tmp1 = cc.ExecuteNonQuery(Sql); urUserRegBLLObj.usrUserId = Convert.ToString(Session["User"]); DataTable dtFriendRelList = urUserRegBLLObj.BLLFriendRelativeShowById(urUserRegBLLObj); gvRemoveFriend.DataSource = dtFriendRelList; gvRemoveFriend.DataBind(); urUserRegBLLObj.frnrelUserId = Convert.ToString(Session["User"]); string query = "select * from FriendRelationMaster where UserId='" + urUserRegBLLObj.frnrelUserId.ToString() + "'"; DataSet ds = cc.ExecuteDataset(query); foreach (DataRow dr in ds.Tables[0].Rows) { string userid = Convert.ToString(dr["UserId"]); string frienduserid = Convert.ToString(dr["FriendId"]); } }
public HomePage() { common = new CommonCode(); read = new Read_ini(); }
/// <summary> /// this method save the franchisor data to the database /// </summary> private void SaveFranchisor() { // format phone no. CommonCode objCommonCode = new CommonCode(); OtherDAL otherDal = new OtherDAL(); EZip objczip = otherDal.CheckCityZip(txtCity.Text, txtzip1.Text, ddlstate.SelectedValue); if (objczip.CityID == 0) { ClientScript.RegisterStartupScript(typeof(string), "bujscode", "alert('City name entered for contact address is not valid.');", true); return; } else if (objczip.CityID > 0 && objczip.ZipID == 0) { ClientScript.RegisterStartupScript(typeof(string), "bujscode", "alert('Zip Code entered for contact address, corresponding to its city name, is not valid.');", true); return; } EFranchisorFranchisorUser franchisorfranchisoruser = new EFranchisorFranchisorUser(); EFranchisorUser franchisoruser = new EFranchisorUser(); EFranchisor franchisor = new EFranchisor(); franchisor.Active = true; //HealthYes.Web.UI.FranchisorFranchisorUserService.EAddress address = new HealthYes.Web.UI.FranchisorFranchisorUserService.EAddress(); var address = new Falcon.Entity.Other.EAddress(); address.Address1 = txtaddress1.Text; address.Address2 = string.Empty; address.CityID = objczip.CityID; address.StateID = Convert.ToInt32(ddlstate.SelectedValue); address.CountryID = Convert.ToInt32(hfCountryID.Value); address.ZipID = objczip.ZipID; //HealthYes.Web.UI.FranchisorFranchisorUserService.EUser user = new HealthYes.Web.UI.FranchisorFranchisorUserService.EUser(); var user = new Falcon.Entity.Other.EUser(); user.FirstName = txtfname.Text; user.MiddleName = txtMiddleName.Text.Length == 0 ? "" : txtMiddleName.Text; user.LastName = txtlname.Text; user.SSN = txtSSN.Text.Length == 0 ? "" : txtSSN.Text; user.DOB = Convert.ToDateTime(txtDOB.Text).ToString(); user.PhoneHome = txtphonehome.Text.Length == 0 ? "" : objCommonCode.FormatPhoneNumber(txtphonehome.Text); user.PhoneOffice = txtphoneother.Text.Length == 0 ? "" : objCommonCode.FormatPhoneNumber(txtphoneother.Text); user.PhoneCell = txtphonecell.Text.Length == 0 ? "" : objCommonCode.FormatPhoneNumber(txtphonecell.Text); user.EMail1 = txtEmail1.Text; user.EMail2 = txtEmail2.Text.Length == 0 ? "" : txtEmail2.Text; user.HomeAddress = address; Ucupdatephotopanel1.GetAllImages(); franchisoruser.OtherPictures = Ucupdatephotopanel1.Images; //franchisoruser.OtherPictures = Ucupdatephotopanel1.Images.ToArray(); franchisoruser.TeamPicture = Ucupdatephotopanel1.TeamImage; franchisoruser.MyPicture = Ucupdatephotopanel1.MyImage; franchisoruser.User = user; franchisorfranchisoruser.Franchisor = franchisor; franchisorfranchisoruser.FranchisorUser = franchisoruser; var sessionContext = IoC.Resolve <ISessionContext>(); if (ViewState["FranchisorFranchisorUserID"] != null && ViewState["Email"].ToString().Equals(txtEmail1.Text.Trim())) { if (ViewState["FranchisorFranchisorUserID"].ToString() != string.Empty) { FranchisorDAL franchisorDal = new FranchisorDAL(); var listFranchisorFranchisorUser = franchisorDal.GetFranchisorFranchisorUser(ViewState["FranchisorFranchisorUserID"].ToString(), 1); EFranchisorFranchisorUser[] FFUser = null; if (listFranchisorFranchisorUser != null) { FFUser = listFranchisorFranchisorUser.ToArray(); } if (FFUser != null) { franchisorfranchisoruser.FranchisorUser.User.UserID = Convert.ToInt32(ViewState["UserID"].ToString()); franchisorDal.SaveFranchisorFranchisorUser(franchisorfranchisoruser, Convert.ToInt32(EOperationMode.Update), sessionContext.UserSession.CurrentOrganizationRole.OrganizationId); Response.RedirectUser(ResolveUrl("~/App/Franchisor/FranchisorAdminUser.aspx?Action=Edited")); } } } else { IUserRepository <User> userRepository = IoC.Resolve <IUserRepository <User> >(); if (userRepository.UserNameExists(txtEmail1.Text)) { divErrorMsg.Visible = true; divErrorMsg.InnerHtml = "Contact email already exists. Please try another email."; return; } if (ViewState["FranchisorFranchisorUserID"] != null) { if (ViewState["FranchisorFranchisorUserID"].ToString() != string.Empty) { FranchisorDAL franchisorDal = new FranchisorDAL(); var listFranchisorFranchisorUser = franchisorDal.GetFranchisorFranchisorUser( ViewState["FranchisorFranchisorUserID"].ToString(), 1); EFranchisorFranchisorUser[] FFUser = null; if (listFranchisorFranchisorUser != null) { FFUser = listFranchisorFranchisorUser.ToArray(); } if (FFUser != null) { franchisorfranchisoruser.FranchisorUser.User.UserID = Convert.ToInt32(ViewState["UserID"].ToString()); franchisorDal.SaveFranchisorFranchisorUser(franchisorfranchisoruser, Convert.ToInt32(EOperationMode.Update), sessionContext.UserSession.CurrentOrganizationRole.OrganizationId); Response.RedirectUser(ResolveUrl("~/App/Franchisor/FranchisorAdminUser.aspx?Action=Edited")); } } } else { //service.AddFranchisorFranchisorUser(franchisorfranchisoruser, usershellmodulerole1, out returnresult, out temp); FranchisorDAL franchisorDal = new FranchisorDAL(); franchisorDal.SaveFranchisorFranchisorUser(franchisorfranchisoruser, Convert.ToInt32(EOperationMode.Insert), sessionContext.UserSession.CurrentOrganizationRole.OrganizationId); Response.RedirectUser(ResolveUrl("~/App/Franchisor/FranchisorAdminUser.aspx?Action=Added")); } } }