Esempio n. 1
0
    private void bind()
    {
        if (!string.IsNullOrEmpty(Pageurl))
            LoginStatus1.LogoutPageUrl = Pageurl;
        MembershipUser mu = Membership.GetUser();
        BLLDJ_User blldj_user = new BLLDJ_User();
        Model.TourMembership tm = new Model.TourMembership();
        if (mu != null)
        {
            tm = new BLLMembership().GetMemberById((Guid)mu.ProviderUserKey);
            if (tm is DJ_User_TourEnterprise)
            {
                laETName.Text = (tm as DJ_User_TourEnterprise).Enterprise.Name;
                MasterCss.Href = "/theme/default/css/MasterPage.css";
            }
            if (tm is DJ_User_Gov)
            {
                laETName.Text = (tm as DJ_User_Gov).GovDpt.Name;
                MasterCss.Href = "/theme/default/css/MasterPage2.css";
            }
        }
        else
        {

        }
    }
Esempio n. 2
0
 protected void rptScenicAdmin_ItemCommand(object source, RepeaterCommandEventArgs e)
 {
     if (e.CommandName == "make")
     {
         int scid = int.Parse(e.CommandArgument.ToString());
         ScenicAdmin sa = new ScenicAdmin();
         sa.AdminType = ScenicAdminType.景区资料员 | ScenicAdminType.检票员 | ScenicAdminType.景区财务;
         sa.Scenic = bllScenic.GetScenicById(scid);
         if (!string.IsNullOrEmpty(sa.Scenic.SeoName))
         {
             string loginname = new MakeAccount().automakeaccount(sa.Scenic.SeoName);
             new BLL.BLLMembership().CreateUser("", "", "", "", loginname, "123456","");
             TourMembership tour = new BLL.BLLMembership().GetMember(loginname);
             sa.Membership = tour;
             bllscenicadmin.SaveOrUpdate(sa);
         }
     }
     if (e.CommandName == "reset")
     {
         int scid = int.Parse(e.CommandArgument.ToString());
         ScenicAdmin sa = bllscenicadmin.GetScenicAdminByScidandtype(scid, 7);
         sa.Membership.Password = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile("123456", "MD5");
         bllscenicadmin.SaveOrUpdate(sa);
     }
     BindUsers();
 }
Esempio n. 3
0
 protected void BtnOK_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(CurrentUser.UserName))
     {
         Response.Redirect("ShowMessage.aspx?type=1");
     }
     Model.DiscountCode dc = blldc.GetDiscountCodeByDisCode(DisCode.Text.Trim());
     if (dc == null)
     {
         ScriptManager.RegisterStartupScript(this, this.GetType(), "notfound", "alert('未找到您输入的注册码,请重新确认!')", true);
         return;
     }
     if (!string.IsNullOrEmpty(dc.IdCard))
     {
         ScriptManager.RegisterStartupScript(this, this.GetType(), "s", "alert('该优惠码已经被注册')", true);
     }
     else
     {
         Model.TourMembership user = new BLLMembership().GetUserByUserId((Guid)CurrentUser.ProviderUserKey);
         dc.MemberId = user.Id;
         dc.IdCard = user.IdCard;
         blldc.updateDiscountCode(dc);
         ScriptManager.RegisterStartupScript(this, this.GetType(), "s", "alert('优惠码注册成功')", true);
     }
 }
Esempio n. 4
0
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        if (string.IsNullOrWhiteSpace(txtname.Text) || string.IsNullOrWhiteSpace(txtpsw.Text) || cblAdminType.SelectedItem==null)
        {
            ScriptManager.RegisterStartupScript(this, this.GetType(), "s", "alert('信息填写不完善')", true);
        }
        else
        {
            Model.ScenicAdminType sat = 0;
            foreach (ListItem item in cblAdminType.Items)
            {
                if (item.Selected)
                {
                    Model.ScenicAdminType admintype = (Model.ScenicAdminType)Enum.Parse(typeof(Model.ScenicAdminType), item.Text);
                    sat = sat | admintype;
                }
            }
            int scid = Master.Scenic.Id;
            ScenicAdmin sa = new ScenicAdmin();
            sa.AdminType = ScenicAdminType.景区资料员;
            sa.Scenic = bllScenic.GetScenicById(scid);
            sa.AdminType = sat;
            sa.RealName = txtRealName.Text.Trim();
            new BLL.BLLMembership().CreateUser(txtRealName.Text.Trim(), "", "", "", txtname.Text, txtpsw.Text, "");
            TourMembership tour = new BLL.BLLMembership().GetMember(txtname.Text);
            sa.Membership = tour;
            sa.IsDisabled = false;

            bllscenicadmin.SaveOrUpdate(sa);
            Page.ClientScript.RegisterStartupScript(this.GetType(), "btnOk", "alert('添加成功')", true);
            Response.Redirect("/WorkerList.aspx");
        }
    }
Esempio n. 5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Model.ScenicAdmin user = new BLL.BLLMembership().GetScenicAdmin((Guid)CurrentUser.ProviderUserKey);
     Model.Scenic scenic = user.Scenic;
     //lblScenicname.Text = scenic.Name;
     title.InnerHtml = scenic.Name + "更改价格表";
     rptScenicTicket.DataSource = new BLLScenic().GetScenicById(scenic.Id).Tickets;
     rptScenicTicket.DataBind();
 }
Esempio n. 6
0
 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);
 }
Esempio n. 7
0
 protected void BtnReset_Click(object sender, EventArgs e)
 {
     string id = Request.QueryString["id"];
     string pwd = Request.QueryString["pwdcode"];
     TourMembership user = new BLLMembership().GetUserByUserId(Guid.Parse(id));
     string newpwd = txtPwd.Text;
     string encryptedNewPsw = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(newpwd, "MD5");
     user.Password = encryptedNewPsw;
     new BLLMembership().updateinfo(user);
     ScriptManager.RegisterStartupScript(this, this.GetType(), "s", "alert('重置密码成功!');window.location='/Account/Login.aspx'", true);
 }
Esempio n. 8
0
 private void bind()
 {
     MembershipUser mu = Membership.GetUser();
     BLLDJ_User blldj_user = new BLLDJ_User();
     Model.TourMembership tm = new Model.TourMembership();
     if (mu != null)
     {
         tm = new BLLMembership().GetMemberById((Guid)mu.ProviderUserKey);
         if (tm is DJ_User_TourEnterprise)
         {
             dptid = (tm as DJ_User_TourEnterprise).Enterprise.Id.ToString();
             //laETName.Text = (tm as DJ_User_TourEnterprise).Enterprise.Name;
         }
         if (tm is DJ_User_Gov)
         {
             dptid = (tm as DJ_User_Gov).GovDpt.Id.ToString();
             int perType=(int)(tm as DJ_User_Gov).PermissionType;
             if (perType == 1 || perType == 3 || perType == 5 || perType == 7)
             {
                 li_1.Visible = true;
                 li_2.Visible = true;
             }
             else
             {
                 li_1.Visible = false;
                 li_2.Visible = false;
             }
             if (perType == 2 || perType == 3 || perType == 6 || perType == 7)
             {
                 li_3.Visible = true;
             }
             else
             {
                 li_3.Visible = false;
             }
             if (perType == 4 || perType == 5 || perType == 6 || perType == 7)
             {
                 li_4.Visible = true;
             }
             else
             {
                 li_4.Visible = false;
             }
         }
     }
     else
     {
         Response.Redirect("/Login.aspx");
     }
     (Master.FindControl("changepwd") as HtmlAnchor).HRef = "/TourManagerDpt/ChangePwd.aspx";
     (Master.FindControl("changedetails") as HtmlAnchor).HRef = "/TourManagerDpt/ChangeDetails.aspx?dptId=" + dptid;
 }
Esempio n. 9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Request.QueryString["id"] == null || Request.QueryString["pwdcode"] == null)
     {
         Response.Redirect("/");
     }
     else
     {
         string id = Request.QueryString["id"];
         string pwd = Request.QueryString["pwdcode"];
         TourMembership user = new BLLMembership().GetUserByUserId(Guid.Parse(id));
         if (user.Password != pwd)
         {
             Response.Redirect("/");
         }
     }
 }
Esempio n. 10
0
    protected override void OnInit(EventArgs e)
    {
        MembershipUser mu = Membership.GetUser();
        BLLDJ_User blldj_user = new BLLDJ_User();
        DJ_User_TourEnterprise DJ_User_TE = null;
        if (mu != null)
        {
            DJ_User_TE = new BLLMembership().GetMemberById((Guid)mu.ProviderUserKey) as DJ_User_TourEnterprise;
        }
        if (mu == null || mu.UserName == string.Empty || DJ_User_TE == null || DJ_User_TE.Enterprise is DJ_DijiesheInfo)
        {
            Response.Redirect("/Login.aspx");
        }
        else
        {
            currentTE = DJ_User_TE.Enterprise;
        }
        int perType = (int)DJ_User_TE.PermissionType;
        if (perType == 1 || perType == 3 || perType == 5 || perType == 7)
        {
            li_1.Visible = true;
            li_3.Visible = true;
        }
        else
        {
            li_1.Visible = false;
            li_3.Visible = false;
        }
        if (perType == 2 || perType == 3 || perType == 6 || perType == 7)
        {
            li_2.Visible = true;
        }
        else
            li_2.Visible = false;
        if (perType == 4 || perType == 5 || perType == 6 || perType == 7)
        {
            li_5.Visible = true;
        }
        else
            li_5.Visible = false;

        (Master.FindControl("changepwd") as HtmlAnchor).HRef = "/TourEnterprise/TEChangePwd.aspx";
        (Master.FindControl("changedetails") as HtmlAnchor).HRef = "/TourEnterprise/TEInfo.aspx";
        base.OnInit(e);
    }
Esempio n. 11
0
    protected void btnok_Click(object sender, EventArgs e)
    {
        string strPath = Server.MapPath("\\ScenicImg");
        string savefilename = "";
        if (fuwj.HasFile)
        {
            string fileExt = System.IO.Path.GetExtension(fuwj.FileName);
            if (fileExt == ".jpg" || fileExt == ".gif" || fileExt == ".png")
            {
                try
                {
                    var filename = DateTime.Now.ToString("MMddhhmmss") + DateTime.Now.Millisecond.ToString() + fileExt;
                    savefilename = filename;
                    fuwj.SaveAs(strPath + "\\" + filename);
                }
                catch
                {

                }
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "s", "alert('只允许上传jpg,gif,png格式的文件');", true);
                return;
            }
        }
        else
        {
            ScriptManager.RegisterStartupScript(this, this.GetType(), "s", "alert('请选择上传的文件');", true);
            return;
        }

        Model.ScenicAdmin user = new BLL.BLLMembership().GetScenicAdmin((Guid)CurrentUser.ProviderUserKey);
        Model.Scenic scenic = user.Scenic;
        ContractImg ci = new ContractImg();
        ci.Imgloc = savefilename;
        ci.Scenic = scenic;
        if (bllscenic.GetContractImg(scenic.Id) != null)
        {
            ci.Id = bllscenic.GetContractImg(scenic.Id).Id;
        }
        ci.ScenicModule = ScenicModule.SellOnLine;
        bllscenic.UploadContractImg(ci);
    }
Esempio n. 12
0
    protected void btnOK_Click(object sender, EventArgs e)
    {
        Model.ScenicAdmin user = new BLLMembership().GetScenicAdmin((Guid)CurrentUser.ProviderUserKey);
        Scenic scenic = user.Scenic;
        scenic.Name = ScenicName.Text.Trim();
        scenic.Level = ScenicLevel.Text.Trim();
        scenic.Area.Name = ScenicArea.Text.Trim();
        scenic.Address = Address.Text;
        scenic.Desec = Desc.Text;
        scenic.Photo = "";
        scenic.Email = Email.Text;
        scenic.Position = hfposition.Value;
        ScenicCheckProgress temp=scenic.CheckProgress.First<ScenicCheckProgress>(x => x.Module == ScenicModule.SellOnLine);
        temp.CheckStatus = CheckStatus.NotApplied;
        bllscenic.UpdateScenicInfo(scenic);

        bind();
        ScriptManager.RegisterStartupScript(this, this.GetType(), "s", "alert('更新成功');window.location=window.location", true);
    }
Esempio n. 13
0
 protected void Login1_LoggedIn(object sender, EventArgs e)
 {
     TourMembership tourMembership = bllMember.GetMember(Login1.UserName);
     tourMembership.loginCount += 1;
     tourMembership.lastLogin = DateTime.Now;
     bllMember.Update(tourMembership);
     BLL.BLLMembership bllMembership = new BLLMembership();
     MembershipUser member = (tourmembership.GetUser(Login1.UserName, true));
     if (member == null)
     {
         ScriptManager.RegisterStartupScript(this, this.GetType(), "s", "alert('未找到该用户名,请重新确认!');", true);
     }
     if (Roles.IsUserInRole(member.UserName, "SiteAdmin"))
     {
         Response.Redirect("/Manager/default.aspx");
     }
     else
         ScriptManager.RegisterStartupScript(this, this.GetType(), "s", "alert('用户名或密码错误');", true);
 }
Esempio n. 14
0
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     //checkbox中保存了membershipId, 用于将来可能的假删除操作
     foreach (RepeaterItem item in rptScenicAdmin.Items)
     {
         if (item.FindControl("ckbselect") != null)
         {
             CheckBox cb = item.FindControl("ckbselect") as CheckBox;
             if (cb.Checked == true)
             {
                 HiddenField hf = item.FindControl("hfid") as HiddenField;
                 Model.ScenicAdmin sa = new BLL.BLLMembership().GetScenicAdmin((Guid.Parse(hf.Value.ToString())));
                 sa.IsDisabled = true;
                 new BLL.BLLScenicAdmin().SaveOrUpdate(sa);
             }
         }
     }
     BindUsers();
 }
Esempio n. 15
0
    private void bind()
    {
        Model.ScenicAdmin user = new BLLMembership().GetScenicAdmin((Guid)CurrentUser.ProviderUserKey);

        Scenic scenic = user.Scenic;
        ScenicName.Text = scenic.Name;
        ScenicLevel.Text = scenic.Level;
        ScenicArea.Text = scenic.Area.Name;
        Address.Text = scenic.Address;
        Desc.Text = scenic.Desec;
        Email.Text = scenic.Email;
        if (!string.IsNullOrEmpty(scenic.Position))
        {
            hfposition.Value = scenic.Position;
        }
        IList<ScenicImg> list= bllscenicimg.GetSiByType(scenic,1);
        if (list.Count > 0)
        {
            ScenicImg.ImageUrl = "/ScenicImg/" + list[0].Name;
        }
    }