Example #1
0
 private void ShowInfo(int R_UserID, int R_RoleID)
 {
     Maticsoft.BLL.sys_UserRoles   bll   = new Maticsoft.BLL.sys_UserRoles();
     Maticsoft.Model.sys_UserRoles model = bll.GetModel(R_UserID, R_RoleID);
     this.lblR_UserID.Text = model.R_UserID.ToString();
     this.lblR_RoleID.Text = model.R_RoleID.ToString();
 }
Example #2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (!PageValidate.IsNumber(txtR_UserID.Text))
            {
                strErr += "用户ID与sys_User表中格式错误!\\n";
            }
            if (!PageValidate.IsNumber(txtR_RoleID.Text))
            {
                strErr += "用户所属角色ID与Sys_Ro格式错误!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            int R_UserID = int.Parse(this.txtR_UserID.Text);
            int R_RoleID = int.Parse(this.txtR_RoleID.Text);

            Maticsoft.Model.sys_UserRoles model = new Maticsoft.Model.sys_UserRoles();
            model.R_UserID = R_UserID;
            model.R_RoleID = R_RoleID;

            Maticsoft.BLL.sys_UserRoles bll = new Maticsoft.BLL.sys_UserRoles();
            bll.Add(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx");
        }
Example #3
0
 private void ShowInfo(int R_UserID,int R_RoleID)
 {
     Maticsoft.BLL.sys_UserRoles bll=new Maticsoft.BLL.sys_UserRoles();
     Maticsoft.Model.sys_UserRoles model=bll.GetModel(R_UserID,R_RoleID);
     this.lblR_UserID.Text=model.R_UserID.ToString();
     this.lblR_RoleID.Text=model.R_RoleID.ToString();
 }
Example #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         Maticsoft.BLL.sys_UserRoles bll=new Maticsoft.BLL.sys_UserRoles();
         int R_UserID = -1;
         if (Request.Params["id0"] != null && Request.Params["id0"].Trim() != "")
         {
             R_UserID=(Convert.ToInt32(Request.Params["id0"]));
         }
         int R_RoleID = -1;
         if (Request.Params["id1"] != null && Request.Params["id1"].Trim() != "")
         {
             R_RoleID=(Convert.ToInt32(Request.Params["id1"]));
         }
         #warning 代码生成提示:删除页面,请检查确认传递过来的参数是否正确
         // bll.Delete(R_UserID,R_RoleID);
     }
 }
Example #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         Maticsoft.BLL.sys_UserRoles bll = new Maticsoft.BLL.sys_UserRoles();
         int R_UserID = -1;
         if (Request.Params["id0"] != null && Request.Params["id0"].Trim() != "")
         {
             R_UserID = (Convert.ToInt32(Request.Params["id0"]));
         }
         int R_RoleID = -1;
         if (Request.Params["id1"] != null && Request.Params["id1"].Trim() != "")
         {
             R_RoleID = (Convert.ToInt32(Request.Params["id1"]));
         }
                         #warning 代码生成提示:删除页面,请检查确认传递过来的参数是否正确
         // bll.Delete(R_UserID,R_RoleID);
     }
 }
Example #6
0
        public void btnSave_Click(object sender, EventArgs e)
        {
            string strErr="";

            if(strErr!="")
            {
                MessageBox.Show(this,strErr);
                return;
            }
            int R_UserID=int.Parse(this.lblR_UserID.Text);
            int R_RoleID=int.Parse(this.lblR_RoleID.Text);

            Maticsoft.Model.sys_UserRoles model=new Maticsoft.Model.sys_UserRoles();
            model.R_UserID=R_UserID;
            model.R_RoleID=R_RoleID;

            Maticsoft.BLL.sys_UserRoles bll=new Maticsoft.BLL.sys_UserRoles();
            bll.Update(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this,"保存成功!","list.aspx");
        }
Example #7
0
        public void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            int R_UserID = int.Parse(this.lblR_UserID.Text);
            int R_RoleID = int.Parse(this.lblR_RoleID.Text);


            Maticsoft.Model.sys_UserRoles model = new Maticsoft.Model.sys_UserRoles();
            model.R_UserID = R_UserID;
            model.R_RoleID = R_RoleID;

            Maticsoft.BLL.sys_UserRoles bll = new Maticsoft.BLL.sys_UserRoles();
            bll.Update(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx");
        }
Example #8
0
        /// <summary>
        /// 点击确定按钮执行的方法
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Button1_Click(object sender, EventArgs e)
        {
            Maticsoft.BLL.sys_User sysUser_bll = new Maticsoft.BLL.sys_User();
            Maticsoft.Model.sys_User sysUser_model = sysUser_bll.GetModel(UserID);

            Maticsoft.BLL.record_UserBaseInfo record_UserBaseInfo_bll = new Maticsoft.BLL.record_UserBaseInfo();
            Maticsoft.Model.record_UserBaseInfo record_UserBaseInfo_model = record_UserBaseInfo_bll.GetModel(UserID);
            if (sysUser_model == null)
            {
                sysUser_model = new Maticsoft.Model.sys_User();
            }
            if (record_UserBaseInfo_model == null)
            {
                record_UserBaseInfo_model = new Maticsoft.Model.record_UserBaseInfo();
            }

            sysUser_model.U_IDCard = (string)Common.sink(this.U_IDCard.UniqueID, MethodType.Post, 0, 0, DataType.Str);
            sysUser_model.U_CName = (string)Common.sink(this.U_CName.UniqueID, MethodType.Post, 0, 0, DataType.Str);
            record_UserBaseInfo_model.U_Hometown = (string)Common.sink(this.U_Hometown.UniqueID, MethodType.Post, 0, 0, DataType.Str);
            record_UserBaseInfo_model.U_CurrentAddress = (string)Common.sink(this.U_CurrentAddress.UniqueID, MethodType.Post, 0, 0, DataType.Str);
            sysUser_model.U_Sex = Convert.ToInt32(this.U_Sex.SelectedValue);
            record_UserBaseInfo_model.U_NationID = Convert.ToInt32(this.U_NationID.SelectedValue);
            record_UserBaseInfo_model.U_MarriageStatus = Convert.ToInt32(this.U_MarriageStatus.SelectedValue);
            record_UserBaseInfo_model.U_BloodType = Convert.ToInt32(this.U_BloodType.SelectedValue);
            sysUser_model.U_MobileNo = (string)Common.sink(this.U_MobileNo.UniqueID, MethodType.Post, 0, 0, DataType.Str);
            record_UserBaseInfo_model.U_Committee = Convert.ToInt32(Common.sink(this.U_Committee.UniqueID, MethodType.Post, 0, 0, DataType.Str));
            record_UserBaseInfo_model.U_PermanentType = Convert.ToInt32(this.U_PermanentType.SelectedValue);
            record_UserBaseInfo_model.U_Education = Convert.ToInt32(this.U_Education.SelectedValue);
            record_UserBaseInfo_model.U_WorkingUnits = (string)Common.sink(this.U_WorkingUnits.UniqueID, MethodType.Post, 0, 0, DataType.Str);
            record_UserBaseInfo_model.U_WorkingContactName = (string)Common.sink(this.U_WorkingContactName.UniqueID, MethodType.Post, 0, 0, DataType.Str);
            record_UserBaseInfo_model.U_WorkingContactTel = (string)Common.sink(this.U_WorkingContactTel.UniqueID, MethodType.Post, 0, 0, DataType.Str);
            record_UserBaseInfo_model.U_PaymentType = this.U_PaymentType.SelectedValue;  //这里要改为多选
            record_UserBaseInfo_model.U_SocialNO = (string)Common.sink(this.U_SocialNO.UniqueID, MethodType.Post, 0, 0, DataType.Str);
            record_UserBaseInfo_model.U_MedicalNO = (string)Common.sink(this.U_MedicalNO.UniqueID, MethodType.Post, 0, 0, DataType.Str);
            record_UserBaseInfo_model.U_FamilyCode = (string)Common.sink(this.U_FamilyCode.UniqueID, MethodType.Post, 0, 0, DataType.Str);
            record_UserBaseInfo_model.U_RelationShip = Convert.ToInt32(this.U_RelationShip.SelectedValue);
            record_UserBaseInfo_model.U_ResponsibilityUserID = Convert.ToInt32(Common.sink(this.U_ResponsibilityUserID.UniqueID, MethodType.Post, 0, 0, DataType.Str));
            record_UserBaseInfo_model.U_AuditStatus = Convert.ToInt32(this.U_AuditStatus.SelectedValue);
            record_UserBaseInfo_model.U_FilingUnits = Convert.ToInt32(Common.sink(this.U_FilingUnits.UniqueID, MethodType.Post, 0, 0, DataType.Str));
            record_UserBaseInfo_model.U_FilingUserID = Convert.ToInt32(Common.sink(this.U_FilingUserID.UniqueID, MethodType.Post, 0, 0, DataType.Str));

            switch (CMD)
            {
                case "New":
                    CMD_Txt = "增加";
                    //如果是增加操作,就调用Add方法
                    if (!sysUser_bll.isExist(sysUser_model))
                    {
                        sysUser_model.U_Password = Common.md5(sysUser_model.U_IDCard, 32);  //初始密码为身份证号
                        string year = sysUser_model.U_IDCard.Substring(6, 4);
                        string month = sysUser_model.U_IDCard.Substring(10, 2);
                        string date = sysUser_model.U_IDCard.Substring(12, 2);
                        string result = year + "-" + month + "-" + date;
                        sysUser_model.U_LoginName = sysUser_model.U_IDCard;
                        sysUser_model.U_BirthDay = Convert.ToDateTime(result);
                        sysUser_model.U_DateTime = sysUser_model.U_LastDateTime = sysUser_model.U_WorkStartDate = sysUser_model.U_WorkEndDate = DateTime.Now;
                        sysUser_model.U_LastIP = Common.GetIPAddress();
                        sysUser_model.U_Type = 1;
                        sysUser_model.U_Status = 0;
                        record_UserBaseInfo_model.UserID = sysUser_bll.Add(sysUser_model);
                        record_UserBaseInfo_model.U_FlingTime = DateTime.Now;
                        record_UserBaseInfo_bll.Add(record_UserBaseInfo_model);
                        Maticsoft.BLL.sys_UserRoles sys_UserRoles_bll = new Maticsoft.BLL.sys_UserRoles();
                        Maticsoft.Model.sys_UserRoles sys_UserRoles_model = new Maticsoft.Model.sys_UserRoles();
                        sys_UserRoles_model.R_UserID = record_UserBaseInfo_model.UserID;
                        sys_UserRoles_model.R_RoleID = 1; //初始为普通用户
                    }
                    else
                    {
                        EventMessage.MessageBox(1, "操作失败", string.Format("个人健康档案号{0}已存在!", sysUser_model.U_IDCard), Icon_Type.Alert, Common.GetHomeBaseUrl("InfoManager.aspx?CMD=New"));
                    }
                    break;
                case "Edit":
                    CMD_Txt = "修改";
                    sysUser_bll.Update(sysUser_model);
                    record_UserBaseInfo_bll.Update(record_UserBaseInfo_model);
                    break;
            }
            All_Title_Txt = CMD_Txt + App_Txt;
                EventMessage.MessageBox(1, "操作成功", string.Format("{1}ID({0})成功!", UserID, All_Title_Txt), Icon_Type.OK, Common.GetHomeBaseUrl("default.aspx"));
        }