void Bind(string id) { Model.member model = bllme.GetModel(id); GetSumJf(id.ToString()); CardNo.Value = model.Mid.ToString(); CategoryName.InnerText = GetTypeName(Convert.ToInt32(model.Mtype)); Name.InnerText = model.Name; UsableAmount.InnerText = czyue.ToString(); Amount.Value = Request.QueryString["desp"]; pwd.Value = model.Pwd; }
private void ShowInfo(int _id) { BLL.member bll = new BLL.member(); Model.member model = bll.GetModel(_id); ddlTown.SelectedValue = model.town.ToString(); ddlVillage.SelectedValue = model.village.ToString(); txtAddress.Text = model.address; txtNo.Text = model.no; txtNo.ReadOnly = true; txtName.Text = model.name; rblGender.SelectedValue = model.gender.ToString(); txtBirthday.Text = model.birthday.ToString(); ddlEducation.SelectedValue = model.education; txtIdCard.Text = model.id_card; txtAmount.Text = model.amount.ToString(); for (int i = 1; i < model.family.Count + 1; i++) { TextBox txtFamilyName = FindControl("txtFamilyName" + i) as TextBox; DropDownList ddlFamilyGender = FindControl("ddlFamilyGender" + i) as DropDownList; TextBox txtFamilyRel = FindControl("txtFamilyRel" + i) as TextBox; TextBox txtFamilyBir = FindControl("txtFamilyBir" + i) as TextBox; DropDownList ddlFamilyEdu = FindControl("ddlFamilyEdu" + i) as DropDownList; var current = model.family[i - 1]; txtFamilyName.Text = current.name; ddlFamilyGender.SelectedValue = current.gender; txtFamilyRel.Text = current.relationship; txtFamilyBir.Text = current.birthday; ddlFamilyEdu.SelectedValue = current.education; } }
private void ShowInfo(int _id) { BLL.member bll = new BLL.member(); Model.member model = bll.GetModel(_id); txtNo.Text = model.no; txtNo.ReadOnly = true; txtNo.Attributes.Remove("ajaxurl"); txtName.Text = model.name; rblType.SelectedValue = model.type.ToString(); rblGender.SelectedValue = model.gender.ToString(); ddlMemberLevel.SelectedValue = model.level.ToString(); txtTel.Text = model.tel; txtIdCard.Text = model.id_card; ddlTown.SelectedValue = model.town; ddlVillage.SelectedValue = model.village; txtAmount.Text = Utils.StrToDecimal(Utils.ObjectToStr(model.amount), 0).ToString(); txtCanAmount.Text = Utils.StrToDecimal(Utils.ObjectToStr(model.can_amount), 0).ToString(); txtYh.Text = Utils.StrToDecimal(Utils.ObjectToStr(model.yh_amount), 0).ToString(); txtPeigu.Text = Utils.StrToDecimal(Utils.ObjectToStr(model.peigu), 0).ToString(); txtDate.Text = model.date.Value.ToString("yyyy-MM-dd HH:mm:ss"); txtAddTime.Text = model.add_time.Value.ToString("yyyy-MM-dd HH:mm:ss"); txtRemark.Text = model.remark; txtImgUrl.Text = model.img_url; //绑定图片相册 rptAlbumList.DataSource = model.albums; rptAlbumList.DataBind(); rptCwList.DataSource = model.cw_albums; rptCwList.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { this.id = Utils.StrToInt(DTRequest.GetQueryString("id"), 0); action = DTRequest.GetQueryString("action"); BLL.member bll = new BLL.member(); Model.member model = bll.GetModel(id); if (!string.IsNullOrEmpty(model.shenfenzheng)) { txtShenFenZheng.Text = model.shenfenzheng; imgShenFenZheng.Src = model.shenfenzheng; } }
protected void btnSave_Click(object sender, EventArgs e) { Model.member model = bllme.GetModel(accout.Value); if (pwds.Value != model.Pwd) { ClientScript.RegisterStartupScript(ClientScript.GetType(), "myscript", "<script>alert('密码错误!');</script>"); } else { ClientScript.RegisterStartupScript(GetType(), "message", "<script language='javascript'>parent.document.getElementById('txt_hycard').value='1';parent.document.getElementById('btnAdds').click();</script>"); } }
void Bind(string id) { Model.member model = bllme.GetModel(id); GetSumJf(id.ToString()); CardNo.Value = model.Mid.ToString(); CategoryName.Value = GetTypeName(Convert.ToInt32(model.Mtype)); MemberName.Value = model.Name; //UsableAmount.Value = czyue.ToString(); //Amount.Value = Request.QueryString["desp"]; zjf.Value = sumjf.ToString(); xyjf.Value = duihua.ToString(); syjf.Value = shengyu.ToString(); }
private void Edit() { ShowFee.Style.Add("display", "none"); CAdd.Style.Add("display", "none"); ShowMd.Style.Add("display", "none"); divfa.InnerText = "编辑会员"; BtnSave.Value = "更新会员"; string id = Request.QueryString["id"]; Model.member modelmen = bll.GetModel(id); CCardNo.InnerText = modelmen.Mid.ToString(); MemberCardNo.Value = modelmen.Mid.ToString(); GetSumJf(modelmen.Mid.ToString()); Name.Value = modelmen.Name; Sex.SelectedValue = modelmen.Sex == true ? "1" : "0"; CardType.SelectedValue = modelmen.Zjtype.ToString(); CardNo.Value = modelmen.ZjNumber; CategoryId.SelectedValue = modelmen.Mtype.ToString(); Phone.Value = modelmen.Phone; BirthDay.Value = modelmen.Baithday.ToString(); Password.Attributes.Add("value", modelmen.Pwd); Love.Value = modelmen.Likes; Address.Value = modelmen.Address; Remark.Value = modelmen.Ramrek; OpenDate.InnerText = Convert.ToDateTime(modelmen.AddDate).ToString("yyyy-MM-dd"); Model.memberType modelty = bllmt.GetModel(Convert.ToInt32(modelmen.Mtype)); ExprieDate.InnerText = Convert.ToDateTime(modelmen.XqTime).ToString("yyyy-MM-dd"); StatusName.InnerText = GetState(Convert.ToInt32(modelmen.Statid)); TotalScore.InnerText = sumjf.ToString(); UsedScore.InnerHtml = duihua.ToString(); UsableScore.InnerHtml = shengyu.ToString(); FrozenScore.InnerHtml = dongjie.ToString(); TotalAmount.InnerHtml = czsum.ToString(); UsedAmount.InnerHtml = xfsum.ToString(); UsableAmount.InnerHtml = czyue.ToString(); ConsumeTimes.InnerHtml = xfnum.ToString(); ConsumeAmount.InnerHtml = xfall.ToString(); }
public ActionResult Index() { ViewData.Model = db.member.EntitySet; ViewBag.Model1 = db.member.ToList(); string[] items = new string[] { "one", "two", "three" }; ViewBag.Items = items; BLL.member bll_mem = new BLL.member(); Model.member model_mem = new member(); model_mem = bll_mem.GetModel(1); return(View(model_mem)); }
protected void Page_Load(object sender, EventArgs e) { this.keywords = DTRequest.GetQueryString("keywords"); this.choose_id = DTRequest.GetQueryString("choose_id"); this.lb_ids = DTRequest.GetQueryString("lb_ids"); this.type = DTRequest.GetQueryString("type"); string _action = DTRequest.GetQueryString("action"); if (!string.IsNullOrEmpty(_action) && _action == DTEnums.ActionEnum.Edit.ToString()) { this.action = DTEnums.ActionEnum.Edit.ToString();//修改类型 if (!int.TryParse(Request.QueryString["id"] as string, out this.id)) { JscriptMsg("传输参数不正确!", "back"); return; } if (!new BLL.daikuan().Exists(this.id)) { JscriptMsg("记录不存在或已被删除!", "back"); return; } } if (!Page.IsPostBack) { ChkAdminLevel("daikuan_list", DTEnums.ActionEnum.View.ToString()); //检查权限 //Model.daikuan model = GetAdminInfo(); //取得借款信息信息 ChanYeBind(); BLL.member bll = new BLL.member(); //选择会员 if (!string.IsNullOrEmpty(choose_id)) { txtMemberId.Text = choose_id; Model.member model = bll.GetModel(Utils.StrToInt(choose_id, 0)); txtName.Text = model.name; if (!string.IsNullOrWhiteSpace(model.gender)) { txtGender.Text = model.gender == "0" ? "男" : "女"; } txtLevel.Text = model.level; txtLevelName.Text = new BLL.member_level().GetName(Utils.StrToInt(model.level, 0));; txtIdCard.Text = model.id_card; txtMember.Text = model.no; txtTel.Text = model.tel; txtCanAmount.Text = model.can_amount.ToString(); txtMemberAmount.Text = model.amount.ToString(); } //互助联保人 if (type == "2") { if (!string.IsNullOrEmpty(lb_ids)) { var ids = lb_ids.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); var name = ""; foreach (var id in ids) { Model.member model = bll.GetModel(Utils.StrToInt(id, 0)); name += model.name + ","; } name = name.Substring(0, name.Length - 1); txtLbIds.Text = lb_ids; txtLbNames.Text = name; } } if (action == DTEnums.ActionEnum.Edit.ToString()) //修改 { ShowInfo(this.id); } } }
private bool DoEdit(int _id) { bool result = false; BLL.member bll = new BLL.member(); Model.member model = bll.GetModel(_id); model.town = ddlTown.SelectedValue.ToString(); model.village = ddlVillage.SelectedValue.ToString(); model.address = txtAddress.Text.Trim(); model.no = txtNo.Text.Trim(); model.name = txtName.Text.Trim(); model.gender = rblGender.SelectedValue.ToString(); model.birthday = txtBirthday.Text.Trim(); model.education = ddlEducation.SelectedValue.ToString(); model.id_card = txtIdCard.Text.Trim(); model.amount = Utils.StrToDecimal(txtAmount.Text, 0); model.add_time = Utils.StrToDateTime(txtAddTime.Text.Trim()); if (model.town == "0") { JscriptMsg("请填写所属乡镇!", ""); return(false); } if (model.village == "0") { JscriptMsg("请填写所属村庄!", ""); return(false); } if (string.IsNullOrEmpty(model.no)) { JscriptMsg("请填写会员编号!", ""); return(false); } if (string.IsNullOrEmpty(model.name)) { JscriptMsg("请填写姓名!", ""); return(false); } List <Model.member_family> ls = new List <Model.member_family>(); var familyModel = new Model.member_family(); if (!string.IsNullOrEmpty(txtFamilyName1.Text.Trim())) { familyModel.name = txtFamilyName1.Text.Trim(); familyModel.gender = ddlFamilyGender1.SelectedValue.ToString(); familyModel.relationship = txtFamilyRel1.Text.Trim(); familyModel.birthday = txtFamilyBir1.Text.Trim(); familyModel.education = ddlFamilyEdu1.SelectedValue.ToString(); ls.Add(familyModel); } if (!string.IsNullOrEmpty(txtFamilyName2.Text.Trim())) { familyModel.name = txtFamilyName2.Text.Trim(); familyModel.gender = ddlFamilyGender2.SelectedValue.ToString(); familyModel.relationship = txtFamilyRel2.Text.Trim(); familyModel.birthday = txtFamilyBir2.Text.Trim(); familyModel.education = ddlFamilyEdu2.SelectedValue.ToString(); ls.Add(familyModel); } if (!string.IsNullOrEmpty(txtFamilyName3.Text.Trim())) { familyModel.name = txtFamilyName3.Text.Trim(); familyModel.gender = ddlFamilyGender3.SelectedValue.ToString(); familyModel.relationship = txtFamilyRel3.Text.Trim(); familyModel.birthday = txtFamilyBir3.Text.Trim(); familyModel.education = ddlFamilyEdu3.SelectedValue.ToString(); ls.Add(familyModel); } model.family = ls; if (bll.Update(model)) { AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改协会会员:" + model.no); //记录日志 result = true; } return(result); }
private bool DoEdit(int _id) { bool result = false; BLL.member bll = new BLL.member(); Model.member model = bll.GetModel(_id); model.no = txtNo.Text.Trim(); model.name = txtName.Text.Trim(); model.type = rblType.SelectedValue.ToString(); model.level = ddlMemberLevel.SelectedValue.ToString(); model.gender = rblGender.SelectedValue.ToString(); model.id_card = txtIdCard.Text.Trim(); model.tel = txtTel.Text.Trim(); model.town = ddlTown.SelectedValue.ToString(); model.village = ddlVillage.SelectedValue.ToString(); model.amount = Utils.StrToDecimal(txtAmount.Text, 0); model.yh_amount = Utils.StrToDecimal(txtYh.Text, 0); model.peigu = Utils.StrToDecimal(txtPeigu.Text, 0); model.can_amount = model.amount * 10; model.no = txtNo.Text.Trim(); model.add_time = Utils.StrToDateTime(txtAddTime.Text.Trim()); model.date = Utils.StrToDateTime(txtDate.Text.Trim()); model.remark = txtRemark.Text.Trim(); model.img_url = txtImgUrl.Text.Trim(); if (model.peigu >= 3000) { model.can_amount = model.amount * 10 + model.peigu; } #region 保存相册==================== //检查是否有自定义图片 if (model.albums != null) { model.albums.Clear(); } string[] albumArr = Request.Form.GetValues("hid_photo_name"); string[] remarkArr = Request.Form.GetValues("hid_photo_remark"); string[] linkUrlArr = Request.Form.GetValues("hid_photo_link_url"); if (albumArr != null) { List <Model.member_albums> ls = new List <Model.member_albums>(); for (int i = 0; i < albumArr.Length; i++) { string[] imgArr = albumArr[i].Split('|'); int img_id = Utils.StrToInt(imgArr[0], 0); if (imgArr.Length == 3) { if (linkUrlArr != null && !string.IsNullOrEmpty(linkUrlArr[i]) && !string.IsNullOrEmpty(remarkArr[i])) { ls.Add(new Model.member_albums { id = img_id, member_id = _id, original_path = imgArr[1], thumb_path = imgArr[2], remark = remarkArr[i], link_url = linkUrlArr[i] }); } else if (linkUrlArr != null && !string.IsNullOrEmpty(remarkArr[i]) && string.IsNullOrEmpty(linkUrlArr[i])) { ls.Add(new Model.member_albums { id = img_id, member_id = _id, original_path = imgArr[1], thumb_path = imgArr[2], remark = remarkArr[i] }); } else if (linkUrlArr != null && !string.IsNullOrEmpty(linkUrlArr[i]) && string.IsNullOrEmpty(remarkArr[i])) { ls.Add(new Model.member_albums { id = img_id, member_id = _id, original_path = imgArr[1], thumb_path = imgArr[2], link_url = linkUrlArr[i] }); } else { ls.Add(new Model.member_albums { id = img_id, member_id = _id, original_path = imgArr[1], thumb_path = imgArr[2] }); } } } model.albums = ls; } #endregion if (bll.Update(model)) { AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改协会会员:" + model.no); //记录日志 result = true; } return(result); }