public bool Save(string name, string phone, string idcardno, string specialidcard, string belong, DJ_GroupWorkerType workertype, DJ_DijiesheInfo currentDjs,out DJ_Workers worker, out string errMsg) { worker = new DJ_Workers(); bool result = true; errMsg = string.Empty; var workers = GetWorkers8Multi(string.Empty, name, phone, idcardno, string.Empty, workertype, currentDjs.Id.ToString()); if (workers.Count > 0) { result = false; worker = workers[0]; errMsg = "此工作人员已录入,不能重复添加"; } else { worker.CompanyBelong = belong; worker.DJ_Dijiesheinfo = currentDjs; worker.IDCard = idcardno; worker.Name = name; worker.Phone = phone; worker.SpecificIdCard = specialidcard; worker.WorkerType = workertype; Save(worker); } return result; }
public bool Save(string name, string phone, string idcardno, string specialidcard, string belong, DJ_GroupWorkerType workertype,DJ_DijiesheInfo currentDjs, out string errMsg) { DJ_Workers worker = new DJ_Workers(); return Save(name, phone, idcardno, specialidcard, belong, workertype, currentDjs, out worker, out errMsg); }
protected void BtnRegister_Click(object sender, EventArgs e) { if (ckSelect.Checked) { if (!Verify()) { ScriptManager.RegisterStartupScript(this, this.GetType(), "s", "alert('请上传营业执照')", true); } else { DJ_DijiesheInfo DJS = new DJ_DijiesheInfo(); Area area = bllArea.GetAreaByCode(ddlCountry.SelectedValue); string filename; try { string fileExt = System.IO.Path.GetExtension(fuLicence.FileName); filename = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString() + DateTime.Now.Day.ToString() + DateTime.Now.Hour.ToString() + DateTime.Now.Minute.ToString() + DateTime.Now.Second.ToString() + fileExt; fuLicence.SaveAs(Server.MapPath("~/Data/License") + "\\" + filename); } catch (Exception ex) { throw ex; } bllEnt.AddDjs(txtDJSName.Text.Trim(), txtDJSAddress.Text.Trim(), area, txtLinkName.Text.Trim(), txtTel.Text.Trim(), txtTel.Text.Trim(), filename, txtEmail.Text, null); Response.Redirect("/RegisterSuccess.aspx"); } } else { ScriptManager.RegisterStartupScript(this, this.GetType(), "s", "alert('未同意单位管理平台协议')", true); } }
protected override void OnInit(EventArgs e) { MembershipUser mu = Membership.GetUser(); BLLDJ_User blldj_user = new BLLDJ_User(); DJ_User_TourEnterprise DJ_User_TourEnterprise = null; if (mu != null) { DJ_User_TourEnterprise = new BLLMembership().GetMemberById((Guid)mu.ProviderUserKey) as DJ_User_TourEnterprise; } if (mu == null || mu.UserName == string.Empty || DJ_User_TourEnterprise == null || !(DJ_User_TourEnterprise.Enterprise is DJ_DijiesheInfo)) { Response.Redirect("/LTALogin.aspx"); } int perType=(int)DJ_User_TourEnterprise.PermissionType; if (perType == 1 || perType == 3 || perType == 5 || perType == 9 || perType == 7 || perType == 11 || perType == 13 || perType == 15) li_1.Visible = true; else li_1.Visible = false; if (perType == 2 || perType == 3 || perType == 6 || perType == 10 || perType == 7 || perType == 11 || perType == 14 || perType == 15) { li_3.Visible = true; li_4.Visible = true; } else { li_3.Visible = false; li_4.Visible = false; } if (perType == 4 || perType == 5 || perType == 6 || perType == 12 || perType == 7 || perType == 14 || perType == 13 || perType == 15) { li_6.Visible = true; } else { li_6.Visible = false; } if (perType == 8 || perType == 9 || perType == 10 || perType == 12 || perType == 11 || perType == 13 || perType == 14 || perType == 15) { li_2.Visible = true; li_5.Visible = true; li_7.Visible = true; li_8.Visible = true; } else { li_2.Visible = false; li_5.Visible = false; li_7.Visible = false; li_8.Visible = false; } CurrentDJS = DJ_User_TourEnterprise.Enterprise as DJ_DijiesheInfo; (Master.FindControl("changepwd") as HtmlAnchor).HRef = "/LocalTravelAgent/ChangePwd.aspx"; (Master.FindControl("changedetails") as HtmlAnchor).HRef = "/localtravelagent/djsedit.aspx"; base.OnInit(e); }
/// <summary> /// /// </summary> /// <param name="name"></param> /// <param name="address"></param> /// <param name="area"></param> /// <param name="cpn">管理人姓�/param> /// <param name="cpp">管理人手�/param> /// <param name="phone"></param> /// <returns></returns> public int AddDjs(string name, string address, Model.Area area, string cpn, string cpp, string phone, string lincese, string email, string seoname) { Model.DJ_TourEnterprise djs = new Model.DJ_DijiesheInfo() { Name = name, Address = address, Area = area, ChargePersonName = cpn, ChargePersonPhone = cpp, Phone = phone, Email = email, Buslicense = lincese, Type = Model.EnterpriseType.旅行社, SeoName = string.IsNullOrEmpty(seoname) ? "" : seoname }; dalEnt.SaveOrUpdate(djs); return djs.Id; }
public bool UpdateForm(DJ_TourGroup CurrentGroup,string groupName,string beginDate, string daysAmount, DJ_DijiesheInfo CurrentDJS, DJ_User_TourEnterprise CurrentMember,IList<string> workerIds, out string errMsg) { errMsg = string.Empty; CurrentGroup.Name = groupName; CurrentGroup.BeginDate = Convert.ToDateTime(beginDate); if (CurrentGroup.BeginDate.DayOfYear < DateTime.Now.DayOfYear) { errMsg = "开始时间不能小于当天时间"; return false; } int iDayAmount=Convert.ToInt32(daysAmount); //if (CurrentGroup.DaysAmount>iDayAmount) //{ // errMsg = string.Format("操作无法完成:当前输入的天数({1})小于已录入行程的天数({0}).为保证数据安全,输入天数应该大于等于已录入行程天数.请修改数字,或者在行程编辑页面删除部分行程.", CurrentGroup.DaysAmount, iDayAmount); // return false; //} //for (int i = 0; i < iDayAmount; i++) //{ // DJ_Route r = new DJ_Route(); // r.DayNo = i + 1; // r.DJ_TourGroup = CurrentGroup; // CurrentGroup.Routes.Add(r); //} CurrentGroup.DaysAmount = iDayAmount; CurrentGroup.EndDate = CurrentGroup.BeginDate.AddDays(CurrentGroup.DaysAmount - 1); CurrentGroup.DJ_DijiesheInfo = CurrentDJS; CurrentGroup.DijiesheEditor = (DJ_User_TourEnterprise)CurrentMember; ///司机和导游 bool hasSelectGuide = false; bool hasSelectDriver = false; bllGroupWorker.DeleteFromGroup(CurrentGroup); IList<DJ_Workers> workers = new List<DJ_Workers>(); foreach(string workerId in workerIds) { Model.DJ_Group_Worker gw = new DJ_Group_Worker(); hasSelectGuide = true; DJ_Workers worker = bllWorker.GetOne(new Guid(workerId)); if (worker.WorkerType == DJ_GroupWorkerType.司机) { hasSelectDriver = true; } if (worker.WorkerType == DJ_GroupWorkerType.导游) { hasSelectGuide = true; } gw.DJ_Workers = worker; gw.DJ_TourGroup = CurrentGroup; gw.RD_WorkerName = worker.Name; gw.RD_WorkerIdCard = worker.IDCard; gw.RD_Phone = worker.Phone; bllGroupWorker.Save(gw); } if (!hasSelectGuide) { errMsg = "必须指定导游"; return false; } if (!hasSelectDriver) { errMsg = "必须指定司机"; return false; } //路线信息 return true; }