private void ModifyUser() { if (dgUsers.SelectedCells.Count == 0) { MessageBox.Show(LangBase.GetString("NOT_SELECT_USER")); return; } else { int rowIndex = dgUsers.SelectedCells[0].RowIndex; UserDto user = new UserDto { UserID = Convert.ToInt16(dgUsers.Rows[rowIndex].Cells["colID"].Value), UserName = dgUsers.Rows[rowIndex].Cells["colName"].Value.ToString(), LoginName = dgUsers.Rows[rowIndex].Cells["colLoginName"].Value.ToString(), RoleName = dgUsers.Rows[rowIndex].Cells["colRoleName"].Value.ToString(), isEnable = Convert.ToBoolean(dgUsers.Rows[rowIndex].Cells["colStatusName"].Value) }; AddUser fmodify = new AddUser(user); if (fmodify.ShowDialog() == DialogResult.OK) { GetAllUsers(); } } }
private void modifyHotel() { if (dgHotel.SelectedCells.Count == 0) { MessageBox.Show(LangBase.GetString("NOT_SELECT_HOTEL")); return; } else { int rowIndex = dgHotel.SelectedCells[0].RowIndex; HotelDto hotel = hotels[rowIndex]; AddHotel modifyHotel = new AddHotel(hotel); if (isModify) { if (modifyHotel.ShowDialog() == DialogResult.OK) { modifyHotel.hotel.HouseID = hotel.HouseID; string str_result = WebCall.PostMethod <HotelDto>(WebCall.ModifyHotel, modifyHotel.hotel); WebResult result = AppUtils.JsonDeserialize <WebResult>(str_result); if (result.Code.Equals(SystemConst.MSG_SUCCESS)) { hotel.HouseName = modifyHotel.hotel.HouseName; hotel.Fee = modifyHotel.hotel.Fee; hotel.AgentFee = modifyHotel.hotel.AgentFee; hotel.CoverPic = modifyHotel.hotel.CoverPic; hotel.Pics = modifyHotel.hotel.Pics; hotel.Description = modifyHotel.hotel.Description; hotel.Remark = modifyHotel.hotel.Remark; hotel.Location = modifyHotel.hotel.Location; hotel.RoomCount = modifyHotel.hotel.RoomCount; dgHotel.DataSource = null; dgHotel.DataSource = hotels; } else { ClientUtils.WarningCode(result.Message); } } } else { if (modifyHotel.ShowDialog() == DialogResult.OK) { hotels.RemoveAt(rowIndex); hotels.Add(modifyHotel.hotel); dgHotel.DataSource = null; dgHotel.DataSource = hotels; } } } }
private void modifyTravelService() { if (dgTravelService.SelectedCells.Count == 0) { MessageBox.Show(LangBase.GetString("NOT_SELECT_TRAVEL_SERVICE")); return; } else { int rowIndex = dgTravelService.SelectedCells[0].RowIndex; TravelProjectDto travelProject = travelProjects[rowIndex]; AddTravelProject modifyTravelProject = new AddTravelProject(travelProject); if (isModify) { if (modifyTravelProject.ShowDialog() == DialogResult.OK) { modifyTravelProject.travelProject.ProjectID = travelProject.ProjectID; string str_result = WebCall.PostMethod <TravelProjectDto>(WebCall.ModifyTravelService, modifyTravelProject.travelProject); WebResult result = AppUtils.JsonDeserialize <WebResult>(str_result); if (result.Code.Equals(SystemConst.MSG_SUCCESS)) { travelProject.ProjectName = modifyTravelProject.travelProject.ProjectName; travelProject.AdultFee = modifyTravelProject.travelProject.AdultFee; travelProject.ChildFee = modifyTravelProject.travelProject.ChildFee; travelProject.AgentAdultFee = modifyTravelProject.travelProject.AgentAdultFee; travelProject.AgentChildFee = modifyTravelProject.travelProject.AgentChildFee; travelProject.Description = modifyTravelProject.travelProject.Description; travelProject.ProjectTypeID = modifyTravelProject.travelProject.ProjectTypeID; travelProject.Remark = modifyTravelProject.travelProject.Remark; travelProject.CoverPic = modifyTravelProject.travelProject.CoverPic; dgTravelService.DataSource = null; dgTravelService.DataSource = travelProjects; } else { ClientUtils.WarningCode(result.Message); } } } else { if (modifyTravelProject.ShowDialog() == DialogResult.OK) { travelProjects.RemoveAt(rowIndex); travelProjects.Add(modifyTravelProject.travelProject); dgTravelService.DataSource = null; dgTravelService.DataSource = travelProjects; } } } }
public static string GetLangString(StringIden strIden) { LangBase langIt = GameData.langMng.GetRowByIdx((int)strIden) as LangBase; if (U3D.Lang == (int)LanguageType.Ch && langIt != null) { return(langIt.Ch); } if (U3D.Lang == (int)LanguageType.En && langIt != null) { return(langIt.En); } return(""); }
public string GetLangStr() { LangBase langIt = GameData.langMng.GetRowByIdx((int)LangIdx) as LangBase; if (GameData.gameStatus.Language == (int)LanguageType.Ch && langIt != null) { return(langIt.Ch); } if (GameData.gameStatus.Language == (int)LanguageType.En && langIt != null) { return(langIt.En); } return(null); }
public static void PopupTip(int strIden) { PopupTip tip = WsWindow.OpenMul <PopupTip>(WsWindow.PopupTip); LangBase langIt = GameData.langMng.GetRowByIdx((int)strIden) as LangBase; string str = ""; if (Lang == (int)LanguageType.Ch && langIt != null) { str = langIt.Ch; } if (Lang == (int)LanguageType.En && langIt != null) { str = langIt.En; } tip.Popup(str); }
private void ModifyVip() { if (dgVIP.SelectedCells.Count == 0) { MessageBox.Show(LangBase.GetString("NOT_SELECT_VIP")); return; } else { int rowIndex = dgVIP.SelectedCells[0].RowIndex; AddVip fmodify = new AddVip(vips[rowIndex]); if (fmodify.ShowDialog() == DialogResult.OK) { GetAllVipServices(); } } }
private void modifyGuide() { if (dgGuides.SelectedCells.Count == 0) { MessageBox.Show(LangBase.GetString("NOT_SELECT_GUIDE")); return; } else { int rowIndex = dgGuides.SelectedCells[0].RowIndex; GuideDto travelProject = guides[rowIndex]; AddGuide modifyTravelProject = new AddGuide(travelProject); if (modifyTravelProject.ShowDialog() == DialogResult.OK) { GetAllGuides(); } } }
private void modifyDriver() { if (dgDrivers.SelectedCells.Count == 0) { MessageBox.Show(LangBase.GetString("NOT_SELECT_DRIVER")); return; } else { int rowIndex = dgDrivers.SelectedCells[0].RowIndex; DriverDto driver = drivers[rowIndex]; AddDriver modifyTravelProject = new AddDriver(driver); if (modifyTravelProject.ShowDialog() == DialogResult.OK) { GetAllDrivers(); } } }
private void ModifySupplier() { if (dgSuppliers.SelectedCells.Count == 0) { MessageBox.Show(LangBase.GetString("NOT_SELECT_SUPPLIER")); return; } else { int rowIndex = dgSuppliers.SelectedCells[0].RowIndex; Supplier supplier = new Supplier { SupplierID = Convert.ToInt16(dgSuppliers.Rows[rowIndex].Cells["colID"].Value), SupplierName = dgSuppliers.Rows[rowIndex].Cells["colName"].Value.ToString(), Contact = Convert.ToString(dgSuppliers.Rows[rowIndex].Cells["colContact"].Value) }; AddSupplier fmodify = new AddSupplier(supplier); fmodify.ShowDialog(); GetAllSuppliers(); } }
private void btnLogin_Click(object sender, EventArgs e) { LoginPara para = new LoginPara() { Username = txtUser.Text, Password = AppUtils.SHA1Hash(txtPwd.Text) }; string str_result = WebCall.PostMethod <LoginPara>(WebCall.Login, para); LoginResult result = AppUtils.JsonDeserialize <LoginResult>(str_result); if (result.Code.Equals(SystemConst.MSG_SUCCESS)) { Configure.UserID = result.Data.UserID; Configure.UserName = result.Data.UserName; Configure.Functions = result.Data.Functions; isLogined = true; this.Close(); } else { MessageBox.Show(LangBase.GetString(result.Message)); } }