private void btnSave_Click(object sender, EventArgs e) { if (!ClientUtils.CheckEmpty(txtHotelName, "EMPTY_HOTEL_NAME") || !ClientUtils.CheckEmpty(txtFee, "EMPTY_FEE")) { return; } try { Convert.ToInt16(txtRoomCount.Text); } catch { txtRoomCount.Text = "0"; } hotel = new HotelDto { HouseName = txtHotelName.Text, Fee = Convert.ToSingle(txtFee.Text), AgentFee = Convert.ToSingle(txtAgentFee.Text), CoverPic = pic, Description = txtDesc.Text, Remark = txtRemark.Text, Pics = otherPics, Location = txtLocation.Text, RoomCount = Convert.ToInt16(txtRoomCount.Text) }; this.DialogResult = DialogResult.OK; this.Close(); }
private void btnSave_Click(object sender, EventArgs e) { if (!ClientUtils.CheckEmpty(txtName, "EMPTY_NAME") || !ClientUtils.CheckEmpty(txtLoginName, "EMPTY_LOGIN_NAME") || !ClientUtils.CheckEmpty(cbxRole, "EMPTY_ROLE")) { return; } int id = isModify ? user.UserID : 0; UserDto param = new UserDto { UserID = id, UserName = txtName.Text, LoginName = txtLoginName.Text, RoleID = roles[cbxRole.SelectedIndex].RoleID, isEnable = chkEnable.Checked }; string strResult = WebCall.PostMethod <UserDto>(isModify?WebCall.ModifyUser:WebCall.AddUser, param); WebResult result = AppUtils.JsonDeserialize <WebResult>(strResult); if (result.Code.Equals(SystemConst.MSG_SUCCESS)) { ClientUtils.WarningCode(Travel.Client.Lang.LangBase.GetString(isModify? "MODIFY_SUCCESS" : "ADD_USER_SUCCESS") + result.Message); this.DialogResult = DialogResult.OK; this.Close(); } else { ClientUtils.WarningCode(result.Message); } }
private void btnSave_Click(object sender, EventArgs e) { if (!ClientUtils.CheckEmpty(txtName, "EMPTY_VIP_NAME")) { return; } int id = isModify ? vip.ServerID: 0; VIPDto param = new VIPDto { ServerID = id, SupplierID = supplierID, ServerName = txtName.Text, Contact = txtContact.Text, Tel = txtTel.Text, Remark = txtRemark.Text, }; string strResult = WebCall.PostMethod <VIPDto>(isModify ? WebCall.ModifyVips : WebCall.AddVips, param); WebResult result = AppUtils.JsonDeserialize <WebResult>(strResult); if (result.Code.Equals(SystemConst.MSG_SUCCESS)) { ClientUtils.WarningCode(Travel.Client.Lang.LangBase.GetString(isModify ? "MODIFY_VIP_SUCCESS" : "ADD_VIP_SUCCESS") + result.Message); this.DialogResult = DialogResult.OK; this.Close(); } else { ClientUtils.WarningCode(result.Message); } }
private void btnSave_Click(object sender, EventArgs e) { if (!ClientUtils.CheckEmpty(txtProjectName, "EMPTY_PROJECT_NAME") || !ClientUtils.CheckEmpty(txtAdultFee, "EMPTY_ADULT_FEE") || !ClientUtils.CheckEmpty(txtChildFee, "EMPTY_CHILD_FEE") || !ClientUtils.CheckEmpty(txtAgentAdult, "EMPTY_AGENT_ADULT_FEE") || !ClientUtils.CheckEmpty(txtAgentChild, "EMPTY_AGENT_CHILD_FEE") || !ClientUtils.CheckEmpty(cbxType, "EMPTY_PROJECT_TYPE")) { return; } travelProject = new TravelProjectDto { ProjectName = txtProjectName.Text, AdultFee = Convert.ToSingle(txtAdultFee.Text), ChildFee = Convert.ToSingle(txtChildFee.Text), AgentAdultFee = Convert.ToSingle(txtAgentAdult.Text), AgentChildFee = Convert.ToSingle(txtAgentChild.Text), Description = txtDesc.Text, Remark = txtRemark.Text, ProjectTypeID = projectTypes[cbxType.SelectedIndex].ProjectTypeID, ProjectTypeName = projectTypes[cbxType.SelectedIndex].ProjectTypeName, CoverPic = pic }; this.DialogResult = DialogResult.OK; this.Close(); }
private void btnOK_Click(object sender, EventArgs e) { if (!ClientUtils.CheckEmpty(txtName, "EMPTY_DRIVER_NAME") || !ClientUtils.CheckEmpty(txtBigCar, "EMPTY_FEE") || !ClientUtils.CheckEmpty(txtAgentBigCar, "EMPTY_FEE") || !ClientUtils.CheckEmpty(txtSmallCar, "EMPTY_FEE") || !ClientUtils.CheckEmpty(txtAgentSmallCar, "EMPTY_FEE") || !ClientUtils.CheckEmpty(txtBigCarPick, "EMPTY_FEE") || !ClientUtils.CheckEmpty(txtAgentBigCarPick, "EMPTY_FEE") || !ClientUtils.CheckEmpty(txtSmallCarPick, "EMPTY_FEE") || !ClientUtils.CheckEmpty(txtAgentSmallCarPick, "EMPTY_FEE") || !ClientUtils.CheckEmpty(txtBigCarSend, "EMPTY_FEE") || !ClientUtils.CheckEmpty(txtAgentBigCarSend, "EMPTY_FEE") || !ClientUtils.CheckEmpty(txtSmallCarSend, "EMPTY_FEE") || !ClientUtils.CheckEmpty(txtAgentSmallCarSend, "EMPTY_FEE")) { return; } int driverID = isModify ? selectedDriver.DriverID : 0; DriverDto param = new DriverDto { DriverID = driverID, DriverName = txtName.Text, Tel = txtTel.Text, Contact = txtContact.Text, BigCarFee = Convert.ToSingle(txtBigCar.Text), SmallCarFee = Convert.ToSingle(txtSmallCar.Text), AgentBigCarFee = Convert.ToSingle(txtAgentBigCar.Text), AgentBigCarPickAirportFee = Convert.ToSingle(txtAgentBigCarPick.Text), AgentBigCarSendAirportFee = Convert.ToSingle(txtAgentBigCarSend.Text), BigCarPickAirportFee = Convert.ToSingle(txtBigCarPick.Text), BigCarSendAirportFee = Convert.ToSingle(txtBigCarSend.Text), AgentSmallCarFee = Convert.ToSingle(txtAgentSmallCar.Text), AgentSmallCarPickAirportFee = Convert.ToSingle(txtAgentSmallCarPick.Text), AgentSmallCarSendAirportFee = Convert.ToSingle(txtAgentSmallCarSend.Text), SmallCarPickAirportFee = Convert.ToSingle(txtSmallCarPick.Text), SmallCarSendAirportFee = Convert.ToSingle(txtSmallCarSend.Text), Remark = txtRemark.Text, SupplierID = supplierID }; string strResult = WebCall.PostMethod <DriverDto>(isModify ? WebCall.ModifyDrivers: WebCall.AddDrivers, param); WebResult result = AppUtils.JsonDeserialize <WebResult>(strResult); if (result.Code.Equals(SystemConst.MSG_SUCCESS)) { ClientUtils.WarningCode(Travel.Client.Lang.LangBase.GetString(isModify ? "MODIFY_SUCCESS" : "ADD_SUCCESS") + result.Message); this.DialogResult = DialogResult.OK; this.Close(); } else { ClientUtils.WarningCode(result.Message); } }
private void btnSave_Click(object sender, EventArgs e) { if (!ClientUtils.CheckEmpty(txtSupplierName, "EMPTY_SUPPLIER_NAME") || !ClientUtils.CheckEmpty(txtContact, "EMPTY_SUPPLIER_CONTACT")) { return; } if (!isModify) { SupplierPara supplierPara = new SupplierPara(); supplierPara.supplier = new Supplier { SupplierName = txtSupplierName.Text, Contact = txtContact.Text }; supplierPara.travelProjects = travelProjects.ToList(); supplierPara.hotels = hotels.ToList(); string str_result = WebCall.PostMethod <SupplierPara>(WebCall.AddSupplier, supplierPara); WebResult result = AppUtils.JsonDeserialize <WebResult>(str_result); if (result.Code.Equals(SystemConst.MSG_SUCCESS)) { ClientUtils.WarningCode("ADD_SUCCESS"); this.DialogResult = DialogResult.OK; this.Close(); } else { ClientUtils.WarningCode(result.Message); } } else { Supplier selectSupplier = new Supplier { SupplierID = supplier.SupplierID, SupplierName = txtSupplierName.Text, Contact = txtContact.Text }; string str_result = WebCall.PostMethod <Supplier>(WebCall.ModifySupplier, selectSupplier); WebResult result = AppUtils.JsonDeserialize <WebResult>(str_result); if (result.Code.Equals(SystemConst.MSG_SUCCESS)) { ClientUtils.WarningCode("MODIFY_SUCCESS"); this.DialogResult = DialogResult.OK; this.Close(); } else { ClientUtils.WarningCode(result.Message); } } }
private void btnOK_Click(object sender, EventArgs e) { if (!ClientUtils.CheckEmpty(txtGuideName, "EMPTY_GUIDE_NAME") || !ClientUtils.CheckEmpty(txtLandFee, "EMPTY_LAND_FEE") || !ClientUtils.CheckEmpty(txtSeaFee, "EMPTY_SEA_FEE") || !ClientUtils.CheckEmpty(txtAgentLandFee, "EMPTY_AGENT_LAND_FEE") || !ClientUtils.CheckEmpty(txtAgentSeaFee, "EMPTY_AGENT_SEA_FEE")) { return; } int guideID = selectedGuide == null ? 0 : selectedGuide.GuideID; GuideDto param = new GuideDto { GuideID = guideID, GuideName = txtGuideName.Text, Tel = txtTel.Text, Contact = txtContact.Text, LandFee = Convert.ToSingle(txtLandFee.Text), AgentLandFee = Convert.ToSingle(txtAgentLandFee.Text), SeaFee = Convert.ToSingle(txtSeaFee.Text), AgentSeaFee = Convert.ToSingle(txtAgentSeaFee.Text), Remark = txtRemark.Text, SupplierID = supplierID }; string strResult = WebCall.PostMethod <GuideDto>(isModify ? WebCall.ModifyGuides: WebCall.AddGuides, param); WebResult result = AppUtils.JsonDeserialize <WebResult>(strResult); if (result.Code.Equals(SystemConst.MSG_SUCCESS)) { ClientUtils.WarningCode(Travel.Client.Lang.LangBase.GetString(isModify ? "MODIFY_SUCCESS" : "ADD_SUCCESS") + result.Message); this.DialogResult = DialogResult.OK; this.Close(); } else { ClientUtils.WarningCode(result.Message); } }