예제 #1
0
        /// <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"));
        }
예제 #2
0
        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());
        }
예제 #3
0
        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());
        }
예제 #4
0
        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"));
        }
예제 #5
0
    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>");
    }
예제 #6
0
 partial void DeleteKeHu(KeHu instance);
예제 #7
0
 partial void UpdateKeHu(KeHu instance);
예제 #8
0
 partial void InsertKeHu(KeHu instance);