コード例 #1
0
ファイル: Index.aspx.cs プロジェクト: hihua/hihuacode
 protected void Member_Account_Submit_Click(object sender, EventArgs e)
 {
     BLL.Member b_Member = new BLL.Member();
     Entity.Member o_Member = b_Member.Select_Member(Member_Account_Name.Text, Member_Account_PassWord.Text);
     if (o_Member == null)
         ResponseError("帐号或密码错误");
     else
     {
         Session["Member"] = o_Member;
         Response.Redirect("Index.aspx");
     }
 }
コード例 #2
0
ファイル: Login.ascx.cs プロジェクト: hihua/hihuacode
        protected void Member_Account_Submit_Click(object sender, EventArgs e)
        {
            BLL.Member b_Member = new BLL.Member();
            Entity.Member o_Member = b_Member.Select_Member(Member_Account_Name.Text, Member_Account_PassWord.Text);
            if (o_Member == null)
            {
                Response.Write("<script type=\"text/javascript\">alert(\"帐号或密码错误\");window.history.back();</script>");
                Response.End();
            }
            else
            {
                Session["Member"] = o_Member;

                if (Request.UrlReferrer == null)
                    Response.Redirect("Index.aspx");
                else
                    Response.Redirect(Request.UrlReferrer.ToString());
            }
        }
コード例 #3
0
        protected void Consumption_Submit_Click(object sender, EventArgs e)
        {
            if (!Consumption_Serial_RadioButton1.Checked && !Consumption_Serial_RadioButton2.Checked)
                ResponseError("请选择定位代号");

            if (!Consumption_Type1.Checked && !Consumption_Type2.Checked && !Consumption_Type3.Checked)
                ResponseError("请选择类型");

            if (!VerifyUtility.IsString_NotNull(Consumption_Src.Text))
                ResponseError("请输入出发地");

            if (!VerifyUtility.IsString_NotNull(Consumption_Dest.Text))
                ResponseError("请输入目的地");

            if (!VerifyUtility.IsNumber_NotNull(Consumption_Price.Text))
                ResponseError("请输入票价");

            if (!VerifyUtility.IsNumber_NotNull(Consumption_DePrice.Text))
                ResponseError("请输入低价");

            if (!VerifyUtility.IsNumber_NotNull(Consumption_Points.Text))
                ResponseError("请输入积分");

            if (!VerifyUtility.IsNumber_NotNull(Consumption_Commission.Text))
                ResponseError("请输入佣金");

            if (!VerifyUtility.IsString_NotNull(Consumption_Date.Text))
                ResponseError("请输入出发日期");

            if (!VerifyUtility.Check_Date(Consumption_Date.Text))
                ResponseError("出发日期, 请输入正确的日期格式如: " + DateTime.Now.ToString("yyyy-MM-dd"));

            if (!VerifyUtility.IsString_NotNull(Consumption_Org_Member_ID.SelectedValue))
                ResponseError("请选择会员");

            Entity.Consumption e_Consumption = new Entity.Consumption();
            string Consumption_Serial_RadioButton = "";
            if (Consumption_Serial_RadioButton1.Checked)
                Consumption_Serial_RadioButton += Consumption_Serial_RadioButton1.Text;
            else
                Consumption_Serial_RadioButton += Consumption_Serial_RadioButton2.Text;

            e_Consumption.Consumption_Serial = Consumption_Serial.Text + Consumption_Serial_RadioButton;

            if (Consumption_Type1.Checked)
                e_Consumption.Consumption_Type = 1;

            if (Consumption_Type2.Checked)
                e_Consumption.Consumption_Type = 2;

            if (Consumption_Type3.Checked)
                e_Consumption.Consumption_Type = 3;

            e_Consumption.Consumption_Src = Consumption_Src.Text;
            e_Consumption.Consumption_Dest = Consumption_Dest.Text;
            e_Consumption.Consumption_Price = Convert.ToInt32(Consumption_Price.Text);
            e_Consumption.Consumption_DePrice = Convert.ToInt32(Consumption_DePrice.Text);
            e_Consumption.Consumption_Points = Convert.ToInt32(Consumption_Points.Text);
            e_Consumption.Consumption_Commission = Convert.ToInt32(Consumption_Commission.Text);
            e_Consumption.Consumption_Date = DateTime.Parse(Consumption_Date.Text);

            BLL.Member b_Member = new BLL.Member();
            e_Consumption.Consumption_Org_Member_ID = b_Member.Select_Member(Convert.ToInt32(Consumption_Org_Member_ID.SelectedValue));
            if (e_Consumption.Consumption_Org_Member_ID != null)
            {
                e_Consumption.Consumption_Org_Member_ID.Member_Points += e_Consumption.Consumption_Points;
                e_Consumption.Consumption_Org_Member_ID.Member_Consumption += e_Consumption.Consumption_Price;

                if (e_Consumption.Consumption_Org_Member_ID.Member_Level == 1)
                    e_Consumption.Consumption_Org_Member_ID.Member_Level = 2;
            }
            else
                ResponseError("没有该会员");

            if (e_Consumption.Consumption_Org_Member_ID.Member_Recommended > 0)
            {
                e_Consumption.Consumption_Com_Member_ID = b_Member.Select_Member(e_Consumption.Consumption_Org_Member_ID.Member_Recommended);
                if (e_Consumption.Consumption_Com_Member_ID != null)
                {
                    e_Consumption.Consumption_Com_Member_ID.Member_Commission += e_Consumption.Consumption_Commission;
                    e_Consumption.Consumption_Com_Member_ID.Member_Times++;
                }
            }

            e_Consumption.Consumption_Admin_ID = g_AdminUser;
            e_Consumption.Consumption_AddTime = DateTime.Now;
            e_Consumption.Consumption_Remark = Consumption_Remark.Text;

            b_Consumption.Insert_Consumption(e_Consumption);

            b_Member.Update_Member(e_Consumption.Consumption_Org_Member_ID);

            if (e_Consumption.Consumption_Com_Member_ID != null)
                b_Member.Update_Member(e_Consumption.Consumption_Com_Member_ID);

            ResponseSuccess("提交成功", "Consumption_Detail.aspx?Action_ID=1");
        }
コード例 #4
0
        private void GetMember()
        {
            Consumption_Org_Member_ID.Items.Clear();

            BLL.Member b_Member = new BLL.Member();
            Entity.Member[] e_Member = b_Member.Select_Member("", 0, 0x7FFFFFFF, 1);

            if (e_Member != null)
            {
                foreach (Entity.Member o_Member in e_Member)
                {
                    ListItem o_ListItem = new ListItem(o_Member.Member_Serial + " " + o_Member.Member_Account, o_Member.Member_ID.ToString());
                    Consumption_Org_Member_ID.Items.Add(o_ListItem);
                }
            }
        }
コード例 #5
0
ファイル: Member_Reg.aspx.cs プロジェクト: hihua/hihuacode
        protected void Member_Submit_Click(object sender, EventArgs e)
        {
            BLL.Member b_Member = new BLL.Member();

            if (!VerifyUtility.IsString_NotNull(Member_Account.Text))
                ResponseError("请输入帐号");

            if (b_Member.Check_Account(Member_Account.Text))
                ResponseError(Member_Account.Text + "已经注册过");

            if (!VerifyUtility.IsString_NotNull(Member_PassWord1.Text))
                ResponseError("请输入密码");

            if (!VerifyUtility.IsString_NotNull(Member_PassWord2.Text))
                ResponseError("请输入确认密码");

            if (Member_PassWord1.Text != Member_PassWord2.Text)
                ResponseError("请输入确认密码输入不正确");

            if (!VerifyUtility.IsString_NotNull(Member_Name_CN.Text))
                ResponseError("请输入中文名");

            if (!VerifyUtility.IsString_NotNull(Member_Name_EN.Text))
                ResponseError("请输入英文名");

            if (!Member_Male.Checked && !Member_Female.Checked)
                ResponseError("请选择性别");

            if (!VerifyUtility.IsString_NotNull(Member_Work.SelectedValue))
                ResponseError("请选择工作状态");

            if (!VerifyUtility.IsString_NotNull(Member_Tel.Text))
                ResponseError("请输入电话");

            if (!VerifyUtility.IsString_NotNull(Member_Mobile.Text))
                ResponseError("请输入手机号码");

            if (!VerifyUtility.IsString_NotNull(Member_Email.Text))
                ResponseError("请输入电子邮件");

            if (b_Member.Check_Email(Member_Email.Text))
                ResponseError(Member_Email.Text + "已经注册过");

            if (!VerifyUtility.IsString_NotNull(Member_Address.Text))
                ResponseError("请输入居住地址");

            Entity.Member o_Member = new Entity.Member();

            int Member_Recommended = 0;
            if (VerifyUtility.IsString_NotNull(Member_Serial.Text))
            {
                Entity.Member e_Member = b_Member.Select_Member(2, Member_Serial.Text);
                if (e_Member == null)
                    ResponseError("没有该会员号");
                else
                {
                    Member_Recommended = e_Member.Member_ID;
                    o_Member.Member_ReSerial = Member_Serial.Text;
                }
            }
            else
                o_Member.Member_ReSerial = "";

            o_Member.Member_Account = Member_Account.Text;
            o_Member.Member_PassWord = Member_PassWord1.Text;
            o_Member.Member_Name_CN = Member_Name_CN.Text;
            o_Member.Member_Name_EN = Member_Name_EN.Text;

            if (Member_Male.Checked)
                o_Member.Member_Sex = true;
            else
                o_Member.Member_Sex = false;

            o_Member.Member_Work = Member_Work.Text;
            o_Member.Member_Tel = Member_Tel.Text;
            o_Member.Member_Mobile = Member_Mobile.Text;
            o_Member.Member_Email = Member_Email.Text;
            o_Member.Member_Address = Member_Address.Text;
            o_Member.Member_Company_Name = Member_Company_Name.Text;
            o_Member.Member_Company_Tel = Member_Company_Tel.Text;
            o_Member.Member_Company_Address = Member_Company_Address.Text;

            for (int i = 1; i <= 12; i++)
            {
                Control o_Control = form1.FindControl("Member_Months_" + i.ToString());
                if (o_Control != null)
                {
                    CheckBox o_CheckBox = (CheckBox)o_Control;
                    if (o_CheckBox.Checked)
                    {
                        if (o_Member.Member_Months == null)
                            o_Member.Member_Months = new List<int>();

                        o_Member.Member_Months.Add(i);
                    }
                }
            }

            for (int i = 1; i <= 34; i++)
            {
                if (Request["checkbox" + i.ToString()] != null)
                    o_Member.Member_Airlines += Request["checkbox" + i.ToString()] + ";";
            }

            if (o_Member.Member_Airlines.EndsWith(";"))
                o_Member.Member_Airlines = o_Member.Member_Airlines.Remove(o_Member.Member_Airlines.Length - 1, 1);

            o_Member.Member_Serial = b_Member.Random_Member();
            o_Member.Member_Points = 0;
            o_Member.Member_Commission = 0;
            o_Member.Member_Consumption = 0;
            o_Member.Member_Times = 0;
            o_Member.Member_Recommended = Member_Recommended;
            o_Member.Member_Level = 1;
            o_Member.Member_AddTime = DateTime.Now;

            b_Member.Insert_Member(o_Member);

            ResponseSuccess("注册成功", "Member_Reg.aspx");
        }
コード例 #6
0
ファイル: Member.aspx.cs プロジェクト: hihua/hihuacode
        private void GetMember()
        {
            BLL.Member b_Member = new BLL.Member();
            Entity.Member[] e_Member = b_Member.Select_Member(Search_Content.Text, Convert.ToInt32(Search_Method.SelectedValue), g_PageSize, g_Page);
            if (e_Member != null)
            {
                int i = 1;

                foreach (Entity.Member o_Member in e_Member)
                {
                    HtmlTableRow o_HtmlTableRow = new HtmlTableRow();
                    HtmlTableCell o_HtmlTableCell;
                    HtmlAnchor o_HtmlAnchor;
                    HtmlGenericControl o_HtmlGenericControl;

                    o_HtmlTableCell = new HtmlTableCell();
                    o_HtmlTableCell.InnerText = ((g_Page - 1) * g_PageSize + i).ToString();
                    o_HtmlTableRow.Controls.Add(o_HtmlTableCell);

                    o_HtmlTableCell = new HtmlTableCell();
                    o_HtmlTableCell.InnerText = o_Member.Member_Serial;
                    o_HtmlTableRow.Controls.Add(o_HtmlTableCell);

                    o_HtmlTableCell = new HtmlTableCell();

                    if (o_Member.Member_Sex)
                        o_HtmlTableCell.InnerText = "男";
                    else
                        o_HtmlTableCell.InnerText = "女";

                    o_HtmlTableRow.Controls.Add(o_HtmlTableCell);

                    o_HtmlTableCell = new HtmlTableCell();
                    o_HtmlTableCell.InnerText = o_Member.Member_Account;
                    o_HtmlTableRow.Controls.Add(o_HtmlTableCell);

                    o_HtmlTableCell = new HtmlTableCell();
                    o_HtmlTableCell.InnerText = b_Member.Show_Member_Level(o_Member.Member_Level);
                    o_HtmlTableRow.Controls.Add(o_HtmlTableCell);

                    o_HtmlTableCell = new HtmlTableCell();
                    o_HtmlTableCell.InnerText = o_Member.Member_Name_CN;
                    o_HtmlTableRow.Controls.Add(o_HtmlTableCell);

                    o_HtmlTableCell = new HtmlTableCell();
                    o_HtmlTableCell.InnerText = o_Member.Member_Name_EN;
                    o_HtmlTableRow.Controls.Add(o_HtmlTableCell);

                    o_HtmlTableCell = new HtmlTableCell();
                    o_HtmlTableCell.InnerText = o_Member.Member_Tel;
                    o_HtmlTableRow.Controls.Add(o_HtmlTableCell);

                    o_HtmlTableCell = new HtmlTableCell();
                    o_HtmlTableCell.InnerText = o_Member.Member_Mobile;
                    o_HtmlTableRow.Controls.Add(o_HtmlTableCell);

                    o_HtmlTableCell = new HtmlTableCell();
                    o_HtmlTableCell.InnerText = o_Member.Member_Email;
                    o_HtmlTableRow.Controls.Add(o_HtmlTableCell);

                    o_HtmlTableCell = new HtmlTableCell();
                    o_HtmlTableCell.InnerText = o_Member.Member_AddTime.ToString();
                    o_HtmlTableRow.Controls.Add(o_HtmlTableCell);

                    o_HtmlTableCell = new HtmlTableCell();
                    o_HtmlAnchor = new HtmlAnchor();
                    o_HtmlAnchor.HRef = "#";
                    o_HtmlAnchor.Attributes.Add("onclick", "ActionSubmit(2, " + o_Member.Member_ID.ToString() + ");return false;");
                    o_HtmlAnchor.Attributes.Add("class", "AdminToolsLink2");
                    o_HtmlAnchor.InnerText = "详细";
                    o_HtmlTableCell.Controls.Add(o_HtmlAnchor);

                    o_HtmlGenericControl = new HtmlGenericControl();
                    o_HtmlGenericControl.InnerHtml = "&nbsp;&nbsp;";
                    o_HtmlTableCell.Controls.Add(o_HtmlGenericControl);

                    if (o_Member.Member_Level < 3)
                    {
                        o_HtmlAnchor = new HtmlAnchor();
                        o_HtmlAnchor.HRef = "#";
                        o_HtmlAnchor.Attributes.Add("onclick", "ActionSubmit(4, " + o_Member.Member_ID.ToString() + ");return false;");
                        o_HtmlAnchor.Attributes.Add("class", "AdminToolsLink2");
                        o_HtmlAnchor.InnerText = "转成VIP";
                        o_HtmlTableCell.Controls.Add(o_HtmlAnchor);

                        o_HtmlGenericControl = new HtmlGenericControl();
                        o_HtmlGenericControl.InnerHtml = "&nbsp;&nbsp;";
                        o_HtmlTableCell.Controls.Add(o_HtmlGenericControl);
                    }

                    o_HtmlAnchor = new HtmlAnchor();
                    o_HtmlAnchor.HRef = "#";
                    o_HtmlAnchor.Attributes.Add("onclick", "ActionSubmit(3, " + o_Member.Member_ID.ToString() + ");return false;");
                    o_HtmlAnchor.Attributes.Add("class", "AdminToolsLink2");
                    o_HtmlAnchor.InnerText = "删除";
                    o_HtmlTableCell.Controls.Add(o_HtmlAnchor);
                    o_HtmlTableRow.Controls.Add(o_HtmlTableCell);

                    o_HtmlTableRow.Align = "center";
                    o_HtmlTableRow.Style.Add(HtmlTextWriterStyle.Height, "30px");

                    g_MainTable.Rows.Add(o_HtmlTableRow);

                    i++;
                }

                Current_Page.Text = g_Page.ToString();
                Total_Page.Text = b_Member.g_TotalPage.ToString();
                Total_Count.Text = b_Member.g_TotalCount.ToString();

                if (g_Page > 1)
                {
                    Previous_Page.Visible = true;
                    Previous_Page.CommandArgument = (g_Page - 1).ToString();
                }
                else
                {
                    Previous_Page.Visible = false;
                }

                if (g_Page < b_Member.g_TotalPage)
                {
                    Next_Page.Visible = true;
                    Next_Page.CommandArgument = (g_Page + 1).ToString();
                }
                else
                {
                    Next_Page.Visible = false;
                }

                Current_Page.Visible = true;
                Splite_Page.Visible = true;
                Total_Page.Visible = true;
            }
            else
            {
                Current_Page.Visible = false;
                Splite_Page.Visible = false;
                Total_Page.Visible = false;
                Total_Count.Text = "0";
            }
        }