Esempio n. 1
0
        protected void Member_PassWord_Submit_Click(object sender, EventArgs e)
        {
            BLL.Member b_Member = new BLL.Member();

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

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

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

            if (Member_PassWord.Text != g_Member.Member_PassWord)
                ResponseError("输入旧密码不正确");

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

            g_Member.Member_PassWord = Member_PassWord1.Text;

            b_Member.Update_Member(g_Member);
            ResponseSuccess("更新密码成功,请重新登录");
        }
Esempio n. 2
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");
        }
Esempio n. 3
0
        protected void Member_Submit_Click(object sender, EventArgs e)
        {
            BLL.Member b_Member = new BLL.Member();

            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 (g_Member.Member_Email != Member_Email.Text)
            {
                if (b_Member.Check_Email(Member_Email.Text))
                    ResponseError(Member_Email.Text + "已经注册过");
            }

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

            g_Member.Member_Name_CN = Member_Name_CN.Text;
            g_Member.Member_Name_EN = Member_Name_EN.Text;

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

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

            g_Member.Member_Months = null;
            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 (g_Member.Member_Months == null)
                            g_Member.Member_Months = new List<int>();

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

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

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

            b_Member.Update_Member(g_Member);
            ResponseSuccess("更新资料成功");
        }