public VehicleLicenseDTO(VehicleLicense vehicleLicense) { this.Id = vehicleLicense.Id; this.CreateDate = vehicleLicense.CreateDate; this.Owner = vehicleLicense.Owner; this.PlateNo = vehicleLicense.PlateNo; }
public ActionResult ViewDetail() { //当前登录用户 ViewBag.Title = "行驶证详情";; MpUserID = new Guid("E8325C13-9C76-4B70-911E-57395A2F4D69"); MpUser mpUser = _mpUserService.GetById(MpUserID); if (mpUser == null || mpUser.IsAuth != 1) { return(Json(new { message = "您没有权限,请先申请成为业务员!" })); } VehicleLicense vehicleLicense = new VehicleLicense(); if (!string.IsNullOrWhiteSpace(RQuery["Id"])) { vehicleLicense = _vehicleLicenseService.GetById(new Guid(RQuery["Id"])); } //VehicleLicense vehicleLicense = _vehicleLicenseService.GetUnique("from VehicleLicense where Id = '" +id + "'"); if (vehicleLicense != null && vehicleLicense.MpUserId != Guid.Empty && vehicleLicense.MpUserId != MpUserID) { return(Json(new { message = "您没有权限,请先申请成为业务员!" })); } return(View(vehicleLicense)); }
public static async Task <IRestResponse> CreatePrivateLicense(VehicleLicense license) { string json = SerializeObject(license); var url = String.Format("{0}/api/v1/vl/private", Setting.ApiUrl); return(await SendData(json, url, Method.POST)); }
public ActionResult AllotEditProvide(Guid id) { if (!base.HasPermission("VehicleLicense", PermissionOperate.track)) { return(JsonMessage(false, "你没有分配业务员的权限")); } VehicleLicense vehicleLicense = _vehicleLicenseService.GetById(id); if (vehicleLicense == null) { return(JsonMessage(false, "该笔行驶证已不存在,不能继续操作!")); } string bussMan = RQuery["AssignBussinessMan"].ToString(); string bussPhone = RQuery["BussinessManPhone"].ToString(); MpUser bussManUser = _mpUserService.GetUnique("from MpUser where Name = '" + bussMan.Trim() + "' and MobilePhone = '" + bussPhone.Trim() + "'"); if (bussManUser == null) { return(JsonMessage(false, "业务员信息有错!")); } vehicleLicense.MpUserId = bussManUser.Id; _vehicleLicenseService.Update(vehicleLicense); base.AddLog(string.Format("分配业务员[{0}]成功", vehicleLicense.Owner + "To" + bussMan.Trim()), AdminLoggerModuleEnum.VehicleLicense); return(JsonMessage(true, "处理成功")); }
public VLReStructuring(VehicleLicense obj) { InitializeComponent(); lblStateNumberPlate.Text = TextUI.StateNumberPlate; lblMakeModel.Text = TextUI.MakeModel; lblColor.Text = TextUI.Color; lblYearOfManufacture.Text = TextUI.YearOfManufacture; lblType.Text = TextUI.Type; lblVehicleIdentificationNumberKuzov.Text = TextUI.VehicleIdentificationNumberKuzov; lblVehicleIdentificationNumberShassi.Text = TextUI.VehicleIdentificationNumberShassi; lblGrossWeight.Text = TextUI.GrossWeight; lblCurbWeight.Text = TextUI.CurbWeight; lblEngineNumber.Text = TextUI.EngineNumber; lblEnginePower.Text = TextUI.EnginePower; lblFuelType.Text = TextUI.FuelType; lblNumberOfSeats.Text = TextUI.NumberOfSeats; lblNumberOfStandees.Text = TextUI.NumberOfStandees; lblSpecialMarks.Text = TextUI.SpecialMarks; label20.Text = TextUI.CompanyName; label19.Text = TextUI.Inn; groupBox1.Text = TextUI.Address; label7.Text = TextUI.Region; label5.Text = TextUI.District; label6.Text = TextUI.Address; label8.Text = TextUI.StateNumberPlate; label9.Text = TextUI.MakeModel; label12.Text = TextUI.Color; label1.Text = TextUI.YearOfManufacture; label14.Text = TextUI.Type; label16.Text = TextUI.VehicleIdentificationNumberKuzov; label15.Text = TextUI.VehicleIdentificationNumberShassi; label2.Text = TextUI.GrossWeight; label10.Text = TextUI.CurbWeight; label17.Text = TextUI.EngineNumber; label11.Text = TextUI.EnginePower; label18.Text = TextUI.FuelType; label3.Text = TextUI.NumberOfSeats; label13.Text = TextUI.NumberOfStandees; label4.Text = TextUI.SpecialMarks; lblCurrent.Text = TextUI.CurrentVehicle; lblnew.Text = TextUI.NewVehicle; lblCompanyName.Text = TextUI.CompanyName; lblInn.Text = TextUI.Inn; gbAddressOrg.Text = TextUI.Address; lblRegionOrg.Text = TextUI.Region; lblDistrictOrg.Text = TextUI.District; lblAddressOrg.Text = TextUI.Address; kbtnSave.Text = TextUI.Save; bsRestructing.DataSource = obj; kbtnSave.Click += kbtnSave_Click; }
public ActionResult VehicleLicenseEdit() { if (!base.HasPermission("VehicleLicense", PermissionOperate.add) && !base.HasPermission("VehicleLicense", PermissionOperate.edit)) { return(base.ShowNotPermissionTip("")); } string id = RQuery["Id"]; VehicleLicense vehicleLicense = string.IsNullOrWhiteSpace(id) ? null : _vehicleLicenseService.GetById(new Guid(id)); return(AdminView(vehicleLicense)); }
public ActionResult VehicleLicenseProvide() { if (string.IsNullOrWhiteSpace(RQuery["VehicleLicenseId"])) { if (!base.HasPermission("VehicleLicense", PermissionOperate.add)) { return(JsonMessage(false, "你没有添加驾驶证的权限")); } } else { if (!base.HasPermission("VehicleLicense", PermissionOperate.edit)) { return(JsonMessage(false, "你没有编辑驾驶证的权限")); } } VehicleLicense vehicleLicense = new VehicleLicense(); if (!string.IsNullOrWhiteSpace(RQuery["VehicleLicenseId"])) { vehicleLicense = _vehicleLicenseService.GetById(new Guid(RQuery["VehicleLicenseId"])); } UpdateModel <VehicleLicense>(vehicleLicense); if (string.IsNullOrWhiteSpace(RQuery["VehicleLicenseId"])) { //branch.Status = 1; try { vehicleLicense.CreateDate = DateTime.Now; _vehicleLicenseService.Insert(vehicleLicense); } catch (System.Exception ex) { // } base.AddLog(string.Format("添加驾驶证[{0}]成功", vehicleLicense.Owner), AdminLoggerModuleEnum.VehicleLicense); return(JsonMessage(true, "添加驾驶证成功")); } else { _vehicleLicenseService.Update(vehicleLicense); base.AddLog(string.Format("修改驾驶证[{0}]成功", vehicleLicense.Owner), AdminLoggerModuleEnum.VehicleLicense); return(JsonMessage(true, "修改驾驶证成功")); } }
private void kbtnRestructuring_Click(object sender, EventArgs e) { var cr = kdgvDataOrg.CurrentRow; VehicleLicense obj = ((ObjectView <VehicleLicense>)cr.DataBoundItem).Object; if (obj != null) { var RestructForm = new VLReStructuring(obj); if (RestructForm.ShowDialog() == DialogResult.OK) { FillDataGrid(); RestructForm.Close(); RestructForm.Dispose(); } } }
public ActionResult VehicleLicenseProvide(Guid id) { if (!base.HasPermission("VehicleLicense", PermissionOperate.delete)) { return(JsonMessage(false, "你没有删除驾驶证的权限")); } try { VehicleLicense vehicleLicense = _vehicleLicenseService.GetById(id); _vehicleLicenseService.Delete(id.ToString()); base.AddLog(string.Format("删除驾驶证[{0}]成功", vehicleLicense.Owner), AdminLoggerModuleEnum.Branch); } catch (System.Exception ex) { } return(JsonMessage(true, "删除成功")); }
void kbtnNew_Click(object sender, EventArgs e) { var isIndividual = (knTabs.SelectedPage == kpIndividual); var vl = new VehicleLicense { Id = 0, IsPersonal = isIndividual, DateOfIssue = DateTime.Now, ExpireDate = DateTime.Now }; var frm = new VehicleLicenseObjectForm { Object = vl }; var dr = frm.ShowDialog(); if (dr == DialogResult.OK) { FillDataGrid(); } }
public ActionResult GetBussManDetail(Guid id) { if (!base.HasPermission("VehicleLicense", PermissionOperate.track)) { return(null); } VehicleLicense vehicleLicense = _vehicleLicenseService.GetById(id); if (vehicleLicense == null || vehicleLicense.MpUserId == Guid.Empty) { return(Json(new { AssignBussinessMan = "", BussinessManPhone = "" })); } MpUser bussMan = _mpUserService.GetById(vehicleLicense.MpUserId); if (bussMan == null) { return(Json(new { AssignBussinessMan = "", BussinessManPhone = "" })); } return(Json(new { AssignBussinessMan = bussMan.Name, BussinessManPhone = bussMan.MobilePhone })); }
public ActionResult VehicleLicenseApplyProvide(string isEdit) { VehicleLicense vehicleLicense = new VehicleLicense(); if (!string.IsNullOrWhiteSpace(RQuery["Id"])) { vehicleLicense = _vehicleLicenseService.GetById(new Guid(RQuery["Id"])); } UpdateModel <VehicleLicense>(vehicleLicense); if (string.IsNullOrWhiteSpace(RQuery["Id"])) { vehicleLicense.CreateDate = DateTime.Now; _vehicleLicenseService.Insert(vehicleLicense); return(JsonMessage(true, "添加驾驶证成功")); } else { _vehicleLicenseService.Update(vehicleLicense); return(JsonMessage(true, "修改驾驶证成功")); } }
void FillView(VehicleLicense vl) { var rootPersonalNumber = new KryptonTreeNode(TextUI.PersonalNumber); //rootPersonalNumber.Nodes.Add(vl.PersonalNumber); rootPersonalNumber.Expand(); var rootDateOfIssue = new KryptonTreeNode(TextUI.DateOfIssue); rootDateOfIssue.Nodes.Add(vl.DateOfIssue.ToShortDateString()); rootDateOfIssue.Expand(); var rootDateOfExpire = new KryptonTreeNode(TextUI.DateOfExpire); rootDateOfExpire.Nodes.Add(vl.ExpireDate < DateTime.Today && vl.ExpireDate != null? vl.ExpireDate.Value.ToString("dd/MM/yyyy"):string.Empty); rootDateOfExpire.Expand(); var rootPlaceOfIssue = new KryptonTreeNode(TextUI.PlaceOfIssue); rootPlaceOfIssue.Nodes.Add(vl.UbddName); rootPlaceOfIssue.Expand(); var rootAddress = new KryptonTreeNode(TextUI.Address); rootAddress.Nodes.Add(vl.Organization.Address.Region); rootAddress.Nodes.Add(vl.Organization.Address.District); rootAddress.Nodes.Add(vl.Organization.Address.Address); rootAddress.Expand(); var rootMakeModel = new KryptonTreeNode(TextUI.MakeModel); rootMakeModel.Nodes.Add(vl.Vehicle.ModelName); rootMakeModel.Expand(); var rootYearOfManufacture = new KryptonTreeNode(TextUI.YearOfManufacture); rootYearOfManufacture.Nodes.Add(vl.Vehicle.YearOfManufacture.ToSafeString()); rootYearOfManufacture.Expand(); var rootType = new KryptonTreeNode(TextUI.Type); rootType.Nodes.Add(vl.Vehicle.Type); rootType.Expand(); var rootVehicleIdentificationNumber = new KryptonTreeNode(TextUI.VehicleIdentificationNumberKuzov); rootVehicleIdentificationNumber.Nodes.Add(vl.Vehicle.VehicleIdentificationNumberKuzov); rootVehicleIdentificationNumber.Expand(); var rootEngineNumber = new KryptonTreeNode(TextUI.EngineNumber); rootEngineNumber.Nodes.Add(vl.Vehicle.EngineNumber); rootEngineNumber.Expand(); var rootEnginePower = new KryptonTreeNode(TextUI.EnginePower); rootEnginePower.Nodes.Add(vl.Vehicle.EnginePower.ToSafeString()); rootEnginePower.Expand(); var rootFuelType = new KryptonTreeNode(TextUI.FuelType); rootFuelType.Nodes.Add(vl.Vehicle.FuelType); rootFuelType.Expand(); var rootGrossWeight = new KryptonTreeNode(TextUI.GrossWeight); rootGrossWeight.Nodes.Add(vl.Vehicle.GrossWeight.ToSafeString("n2")); rootGrossWeight.Expand(); var rootCurbWeight = new KryptonTreeNode(TextUI.CurbWeight); rootCurbWeight.Nodes.Add(vl.Vehicle.CurbWeight.ToSafeString("n2")); rootCurbWeight.Expand(); var rootNumberOfSeats = new KryptonTreeNode(TextUI.NumberOfSeats); rootNumberOfSeats.Nodes.Add(vl.Vehicle.NumberOfSeats.ToSafeString()); rootNumberOfSeats.Expand(); var rootNumberOfStandees = new KryptonTreeNode(TextUI.NumberOfStandees); rootNumberOfStandees.Nodes.Add(vl.Vehicle.NumberOfStandees.ToSafeString()); rootNumberOfStandees.Expand(); var rootSpecialMarks = new KryptonTreeNode(TextUI.SpecialMarks); rootSpecialMarks.Nodes.Add(vl.Vehicle.SpecialMarks); rootSpecialMarks.Expand(); ktvView.Nodes.Add(rootPersonalNumber); ktvView.Nodes.Add(rootDateOfIssue); ktvView.Nodes.Add(rootPlaceOfIssue); ktvView.Nodes.Add(rootAddress); ktvView.Nodes.Add(rootMakeModel); ktvView.Nodes.Add(rootYearOfManufacture); ktvView.Nodes.Add(rootType); ktvView.Nodes.Add(rootVehicleIdentificationNumber); ktvView.Nodes.Add(rootEngineNumber); ktvView.Nodes.Add(rootEnginePower); ktvView.Nodes.Add(rootFuelType); ktvView.Nodes.Add(rootGrossWeight); ktvView.Nodes.Add(rootCurbWeight); ktvView.Nodes.Add(rootNumberOfSeats); ktvView.Nodes.Add(rootNumberOfStandees); ktvView.Nodes.Add(rootSpecialMarks); }