/// <summary> /// 返回添加工会职工视图 /// </summary> /// <returns></returns> public ActionResult AddMbs(KeHu model) { SQLHelper sqlh = new SQLHelper(); const string AddMbssql = @"INSERT INTO dbo.TB_KeHu ( Address, BianHao,IDCard,LeiXing,LianXIFangShi,PassWord,ShengRi,XingMing) VALUES ( @Address, @BianHao, @IDCard, @LeiXing, @LianXIFangShi, @PassWord, @ShengRi, @XingMing ) "; SqlParameter[] para = new SqlParameter[] { new SqlParameter("Address", model.Address), new SqlParameter("BianHao", model.BianHao), new SqlParameter("IDCard", model.IDCard), new SqlParameter("LeiXing", model.LeiXing), new SqlParameter("LianXIFangShi", model.LianXIFangShi), new SqlParameter("PassWord", model.PassWord), new SqlParameter("ShengRi", model.ShengRi), new SqlParameter("XingMing", model.XingMing) }; sqlh.ExecData(AddMbssql, para); return(RedirectToAction("ScanUnionMembersIndex", "UnionMembers")); }
public ActionResult Insert(KeHu entity) { if (ModelState.IsValid) { entity.CreatedBy = GetCurrentUserName(); entity.CreatedDate = DateTime.Now; _service.AddKeHu(entity); _service.Save(); this.GetCmp <Window>("windowKeHu").Hide(); this.GetCmp <Store>("storeKeHu").Reload(); return(this.Direct()); } return(this.Direct()); }
public ActionResult Update(KeHu entity) { if (ModelState.IsValid) { entity.LastModifiedBy = GetCurrentUserName(); entity.LastModifiedDate = DateTime.Now; _service.UpdateKeHu(entity); _service.Save(); var window = this.GetCmp <Window>("windowKeHu"); window.Hide(); this.GetCmp <Store>("storeKeHu").Reload(); return(this.Direct()); } return(this.Direct()); }
public ActionResult EditMembersSave(KeHu model) { const string EditMembersSaveSql = @"UPDATE dbo.TB_KeHu SET BianHao=@BianHao, PassWord=@PassWord, XingMing=@XingMing, ShengRi=@ShengRi, Address=@Address, IDCard=@IDCard, LianXIFangShi=@LianXIFangShi, LeiXing=@LeiXing WHERE ID=@ID" ; using (DbConnection conn = DbFactory.CreateConnection()) { var result = conn.Execute(EditMembersSaveSql, model) > 0; } return(RedirectToAction("ScanUnionMembersIndex", "UnionMembers")); }
public void tianjia() { //各项信息填写完成后,把客户信息利用LINQ技术输入到KeHu表 linqKeHuDataContext kh = new linqKeHuDataContext(); KeHu newkh = new KeHu(); newkh.Kh_XingMing = txtXM.Text; newkh.Kh_XingBie = RadioButtonList1.SelectedValue; newkh.Kh_DianHua = txtDH.Text; newkh.Kh_JingJiRenId = Convert.ToInt32(Session["Yg_Id"].ToString()); newkh.Kh_ShenFenZheng = txtSF.Text; newkh.Kh_BeiZhu = txtBZ.Text; newkh.Kh_TianJiaShiJian = DateTime.Now; //提交插入新客户请求 kh.KeHu.InsertOnSubmit(newkh); //执行插入新客户 kh.SubmitChanges(); //提示插入新客户成功 Response.Write("<Script language=javascript>"); Response.Write("window.alert('添加客户成功!');"); Response.Write("window.location='KeHuTJ.aspx"); Response.Write("'</script>"); }
partial void DeleteKeHu(KeHu instance);
partial void UpdateKeHu(KeHu instance);
partial void InsertKeHu(KeHu instance);