Exemple #1
0
        /// <summary>
        /// 保存按钮点击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnSave_Click(object sender, EventArgs e)
        {
            TempHelp_Info tempHelpInfo = new TempHelp_Info();
            tempHelpInfo.Name = txtName.Text;
            tempHelpInfo.IdCard = txtIdCard.Text;
            tempHelpInfo.Bz_Approver = cbApprover.Checked ? 1 : 0;
            tempHelpInfo.Bz_BaoZhang = cbBaoZhang.Checked ? 1 : 0;
            // tempHelpInfo.Bz_Cz = cbCz.Checked ? 1 : 0;
            tempHelpInfo.Bz_Master = cbMaster.Checked ? 1 : 0;
            tempHelpInfo.StreetId = int.Parse(drpStreet.SelectedValue);
            tempHelpInfo.CommunityId = int.Parse(drpCommunity.SelectedValue);
            tempHelpInfo.Address = txtAddress.Text;
            tempHelpInfo.Home = txtHome.Text;
            tempHelpInfo.Tel1 = txtTel1.Text;
            tempHelpInfo.Tel2 = txtTel2.Text;
            tempHelpInfo.House = txtHouse.Text;
            tempHelpInfo.Square = txtSquare.Text;
            tempHelpInfo.Sex = drpSex.SelectedItem.Text;
            tempHelpInfo.Birth = DateTime.Parse(txtBirth.Text);
            tempHelpInfo.ClassId = int.Parse(drpClass.SelectedValue);
            tempHelpInfo.JobId = int.Parse(drpJob.SelectedValue);
            tempHelpInfo.Health = txtHealth.Text;
            tempHelpInfo.Car = txtCar.Text;
            tempHelpInfo.Bz_Retire = cbRetire.Checked ? 1 : 0;
            tempHelpInfo.AppReason = txtAppReason.Value.ToString();
            int MyId;
            if (!int.TryParse(txtFamNum.Text.ToString(), out MyId))
            {
                MessageBox.Show(this, "手动户编号不能为空");
                return;
            }
            else
            {
                tempHelpInfo.MyFid = MyId;
            }
            if (cbRetire.Checked)
            {
                if (txtRetire.Text == "")
                {
                    MessageBox.Show(this, "已退休人员的退休日期不能为空!");
                    return;
                }
                tempHelpInfo.RetireTime = DateTime.Parse(txtRetire.Text);
            }
            else
            {
                tempHelpInfo.RetireTime = null;
            }
            tempHelpInfo.Bz_Dead = cbDead.Checked ? 1 : 0;
            if (cbDead.Checked)
            {
                if (txtDead.Text == "")
                {
                    MessageBox.Show(this, "已死亡人员的死亡日期不能为空!");
                    return;
                }
                tempHelpInfo.DeadTime = DateTime.Parse(txtDead.Text);
            }
            else
            {
                tempHelpInfo.DeadTime = null;
            }
            tempHelpInfo.Wage = txtWage.Text;
            DateTime oneTime = new DateTime();
            if (DateTime.TryParse(txtOneTime.Text, out oneTime))
            {
                tempHelpInfo.OneTime = oneTime;
            }
            else
            {
                tempHelpInfo.OneTime = DateTime.Now;
            }
            if (txtMoney.Text == "")
            {
                tempHelpInfo.Money = 0;
            }
            else
            {
                tempHelpInfo.Money = decimal.Parse(txtMoney.Text);
            }
            tempHelpInfo.State = cbState.Checked ? 0 : 1;
            if (hdId.Value == "0")//添加
            {
                if (hdDiBaoId.Value != "0")//如果是待入库表添加
                {
                    tempHelpInfo.BaseId = int.Parse(hdBaseId.Value);
                    tempHelpInfo.Fid = int.Parse(hdFid.Value);
                    if (Ctrl_Ass_TempHelp.AddTempHelpInfo(tempHelpInfo) > 0)
                    {
                        Ctrl_Base.UpdateBaseInfoWithTableName(tempHelpInfo.BaseId, "TempHelp", 2);
                        MessageBox.ShowAndRedirect(this, "添加成功!", ViewState["BackUrl"].ToString());
                    }
                    else
                        MessageBox.Show(this, "添加失败!");
                }
                else//直接添加
                {
                    if (hdFid.Value == "0")//添加一户
                    {
                        //写入基本表
                        BaseEntity BaseInfo = new BaseEntity();
                        BaseInfo.AppId_TempHelp = 0;//非审批途径进入基本表
                        BaseInfo.Bz_TempHelp = 2;//更改低保标记为在发
                        BaseInfo.Bz_Master = cbMaster.Checked ? 1 : 0;
                        BaseInfo.CommunityId = int.Parse(drpCommunity.SelectedValue);
                        BaseInfo.Home = txtHome.Text;
                        BaseInfo.IdCard = txtIdCard.Text;
                        BaseInfo.Name = txtName.Text;
                        BaseInfo.StreetId = int.Parse(drpStreet.SelectedValue);
                        BaseInfo.Fid = Ctrl_Counter.GetCounter_Fid();//获取Fid
                        tempHelpInfo.Fid = BaseInfo.Fid;
                        tempHelpInfo.AddTime = DateTime.Now.ToString("yyyy-MM-dd");
                        tempHelpInfo.BaseId = CommonHelp.AddBase(BaseInfo, "TempHelp");//信息写入基本表并返回基本表Id
                        if (Ctrl_Ass_TempHelp.AddTempHelpInfo(tempHelpInfo) > 0)
                        {
                            Ctrl_Base.UpdateBaseInfoWithTableName(tempHelpInfo.BaseId, "TempHelp", 2);
                            //MessageBox.ShowAndRedirect(this, "添加成功!是否继续添加家庭成员?", ViewState["BackUrl"].ToString());
                            //if (tempHelpInfo.Fid > 0)
                            //{
                            //    Page.ClientScript.RegisterStartupScript(this.GetType(), "js", "fnAddFamConfirm(" + tempHelpInfo.Fid + ",'" + ViewState["BackUrl"].ToString() + "');", true);
                            //}
                            MessageBox.ShowAndRedirect(this, "添加成功", "TempHelp_Fam.aspx?Fid=" + tempHelpInfo.Fid);
                        }
                        else
                            MessageBox.Show(this, "添加失败!");
                    }
                    else
                    {
                        //写入基本表
                        BaseEntity BaseInfo = new BaseEntity();
                        BaseInfo.AppId_TempHelp = 0;//非审批途径进入基本表
                        BaseInfo.Bz_DiBao = 2;//更改低保标记为在发
                        BaseInfo.Bz_Master = cbMaster.Checked ? 1 : 0;
                        BaseInfo.CommunityId = int.Parse(drpCommunity.SelectedValue);
                        BaseInfo.Home = txtHome.Text;
                        BaseInfo.IdCard = txtIdCard.Text;
                        BaseInfo.Name = txtName.Text;
                        BaseInfo.StreetId = int.Parse(drpStreet.SelectedValue);
                        BaseInfo.Fid = int.Parse(hdFid.Value);

                        tempHelpInfo.BaseId = Ctrl_Base.AddBase(BaseInfo, "TempHelpInfo");//信息写入基本表并返回基本表Id
                        tempHelpInfo.Fid = int.Parse(hdFid.Value);
                        if (Ctrl_Ass_TempHelp.AddTempHelpInfo(tempHelpInfo) > 0)
                        {
                            Ctrl_Base.UpdateBaseInfoWithTableName(tempHelpInfo.BaseId, "TempHelp", 2);
                            MessageBox.ShowAndRedirect(this, "添加成功!", ViewState["BackUrl"].ToString());

                            // Response.Write("<Script Language='JavaScript'>if ( window.confirm('添加成功,继续添加')) {  window.location.href='" + ViewState["BackUrl"].ToString() +"' } else {window.location.href='" + ViewState["BackUrl"].ToString() + "' };</script>");  //如果成功则继续添加,不成功则返回页面主页(相应户为单位)
                        }
                        else
                            MessageBox.Show(this, "添加失败!");
                    }
                }

            }
            else//修改
            {
                tempHelpInfo.Id = int.Parse(hdId.Value);
                tempHelpInfo.BaseId = int.Parse(hdBaseId.Value);
                tempHelpInfo.Fid = int.Parse(hdFid.Value);
                if (cbState.Checked && txtStopReason.Enabled)//如果停发
                {
                    if (string.IsNullOrEmpty(txtStopReason.Text))
                    {
                        MessageBox.Show(this, "停发原因不能为空!");
                        return;
                    }
                    Ctrl_Ass_TempHelp.AddStopReason(tempHelpInfo.Id, txtStopReason.Text);
                }
                if (Ctrl_Ass_TempHelp.UpdateTempHelp(tempHelpInfo))
                    MessageBox.ShowAndRedirect(this, "修改成功!", ViewState["BackUrl"].ToString());
                else
                    MessageBox.Show(this, "修改失败!");
            }
        }
Exemple #2
0
        /// <summary>
        /// 更新临时救助人员数据
        /// </summary>
        /// <param name="tempHelpInfo">临时救助人员信息实体</param>
        /// <returns>成功返回true 否则返回false</returns>
        public static bool UpdateTempHelp(TempHelp_Info tempHelpInfo)
        {
            bool iExecute = false;
            try
            {
                StringBuilder strSql = new StringBuilder();
                strSql.Append("Update TempHelp_Info set ");
                strSql.Append("BaseId=@BaseId,");
                strSql.Append("Fid=@Fid,");
                strSql.Append("TypeId=@TypeId,");
                strSql.Append("Bz_Approver=@Bz_Approver,");
                strSql.Append("Bz_Master=@Bz_Master,");
                strSql.Append("Bz_BaoZhang=@Bz_BaoZhang,");
                strSql.Append("Bz_Cz=@Bz_Cz,");
                strSql.Append("ClassId=@ClassId,");
                strSql.Append("Name=@Name,");
                strSql.Append("Sex=@Sex,");
                strSql.Append("IdCard=@IdCard,");
                strSql.Append("Birth=@Birth,");
                strSql.Append("StreetId=@StreetId,");
                strSql.Append("CommunityId=@CommunityId,");
                strSql.Append("Address=@Address,");
                strSql.Append("Home=@Home,");
                strSql.Append("Tel1=@Tel1,");
                strSql.Append("Tel2=@Tel2,");
                strSql.Append("House=@House,");
                strSql.Append("Square=@Square,");
                strSql.Append("Health=@Health,");
                strSql.Append("JobId=@JobId,");
                strSql.Append("Wage=@Wage,");

                strSql.Append("OneMoney=@OneMoney,");
                strSql.Append("OneMonth=@OneMonth,");
                strSql.Append("OneTime=@OneTime,");
                strSql.Append("Car=@Car,");
                strSql.Append("Bank=@Bank,");
                strSql.Append("CheckTime=@CheckTime,");
                strSql.Append("NextTime=@NextTime,");
                strSql.Append("Bz_Retire=@Bz_Retire,");
                strSql.Append("RetireTime=@RetireTime,");
                strSql.Append("Bz_Dead=@Bz_Dead,");
                strSql.Append("DeadTime=@DeadTime,");
                strSql.Append("Money=@Money,");
                strSql.Append("State=@State, ");
                strSql.Append(" MyFid=@MyFid,");
                strSql.Append(" AppReason=@AppReason");
                strSql.Append(" where Id=@Id");

                SqlParameter[] para = new SqlParameter[]
                {
                new SqlParameter("@BaseId",SqlDbType.Int),
                new SqlParameter("@Fid",SqlDbType.Int),
                new SqlParameter("@TypeId",SqlDbType.Int),
                new SqlParameter("@Bz_Approver",SqlDbType.Int),
                new SqlParameter("@Bz_Master",SqlDbType.Int),
                new SqlParameter("@Bz_BaoZhang",SqlDbType.Int),
                new SqlParameter("@Bz_Cz",SqlDbType.Int),
                new SqlParameter("@ClassId",SqlDbType.Int),
                new SqlParameter("@Name",SqlDbType.NVarChar,50),
                new SqlParameter("@Sex",SqlDbType.NVarChar,50),
                new SqlParameter("@IdCard",SqlDbType.NVarChar,50),
                new SqlParameter("@Birth",SqlDbType.DateTime),
                new SqlParameter("@StreetId",SqlDbType.Int),
                new SqlParameter("@CommunityId",SqlDbType.Int),
                new SqlParameter("@Address",SqlDbType.NVarChar,100),
                new SqlParameter("@Home",SqlDbType.NVarChar,100),
                new SqlParameter("@Tel1",SqlDbType.NVarChar,50),
                new SqlParameter("@Tel2",SqlDbType.NVarChar,50),
                new SqlParameter("@House",SqlDbType.NVarChar,50),
                new SqlParameter("@Square",SqlDbType.NVarChar,50),
                new SqlParameter("@Health",SqlDbType.NVarChar,50),
                new SqlParameter("@JobId",SqlDbType.Int),
                new SqlParameter("@Wage",SqlDbType.NVarChar,50),

                new SqlParameter("@OneMoney",SqlDbType.NVarChar,50),
                new SqlParameter("@OneMonth",SqlDbType.NVarChar,50),
                new SqlParameter("@OneTime",SqlDbType.DateTime),
                new SqlParameter("@Car",SqlDbType.NVarChar,50),
                new SqlParameter("@Bank",SqlDbType.NVarChar,50),
                new SqlParameter("@CheckTime",SqlDbType.DateTime),
                new SqlParameter("@NextTime",SqlDbType.DateTime),
                new SqlParameter("@Bz_Retire",SqlDbType.Int),
                new SqlParameter("@RetireTime",SqlDbType.DateTime),
                new SqlParameter("@Bz_Dead",SqlDbType.Int),
                new SqlParameter("@DeadTime",SqlDbType.DateTime),
                new SqlParameter("@Money",SqlDbType.Decimal),
                new SqlParameter("@State",SqlDbType.Int),
                new SqlParameter("@MyFid",SqlDbType.Int),
                new SqlParameter("@AppReason",SqlDbType.NVarChar,5000),
                new SqlParameter("@Id",SqlDbType.Int)

                };
                para[0].Value = tempHelpInfo.BaseId;
                para[1].Value = tempHelpInfo.Fid;
                para[2].Value = tempHelpInfo.TypeId;
                para[3].Value = tempHelpInfo.Bz_Approver;
                para[4].Value = tempHelpInfo.Bz_Master;
                para[5].Value = tempHelpInfo.Bz_BaoZhang;
                para[6].Value = tempHelpInfo.Bz_Cz;
                para[7].Value = tempHelpInfo.ClassId;
                para[8].Value = tempHelpInfo.Name;
                para[9].Value = tempHelpInfo.Sex;
                para[10].Value = tempHelpInfo.IdCard;
                para[11].Value = tempHelpInfo.Birth;
                para[12].Value = tempHelpInfo.StreetId;
                para[13].Value = tempHelpInfo.CommunityId;
                para[14].Value = tempHelpInfo.Address;
                para[15].Value = tempHelpInfo.Home;
                para[16].Value = tempHelpInfo.Tel1;
                para[17].Value = tempHelpInfo.Tel2;
                para[18].Value = tempHelpInfo.House;
                para[19].Value = tempHelpInfo.Square;
                para[20].Value = tempHelpInfo.Health;
                para[21].Value = tempHelpInfo.JobId;
                para[22].Value = tempHelpInfo.Wage;

                para[23].Value = tempHelpInfo.OneMoney;
                para[24].Value = tempHelpInfo.OneMonth;
                para[25].Value = tempHelpInfo.OneTime;
                para[26].Value = tempHelpInfo.Car;
                para[27].Value = tempHelpInfo.Bank;
                para[28].Value = tempHelpInfo.CheckTime;
                para[29].Value = tempHelpInfo.NextTime;
                para[30].Value = tempHelpInfo.Bz_Retire;
                para[31].Value = tempHelpInfo.RetireTime;
                para[32].Value = tempHelpInfo.Bz_Dead;
                para[33].Value = tempHelpInfo.DeadTime;
                para[34].Value = tempHelpInfo.Money;
                para[35].Value = tempHelpInfo.State;
                para[36].Value = tempHelpInfo.MyFid;
                para[37].Value = tempHelpInfo.AppReason;
                para[38].Value = tempHelpInfo.Id;

                int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), para);

                int rowsx = DbHelperSQL.ExecuteSql("Update TempHelp_Info set Money=" + tempHelpInfo.Money + ",State=" + tempHelpInfo.State + ",TypeId=" + tempHelpInfo.TypeId + " where Fid=" + tempHelpInfo.Fid);

                if (rows > 0)
                {
                    iExecute = true;
                }

            }
            catch (Exception e)
            {
                Log4Net.LogWrite("err", "Ctrl_Ass_TempHelp:UpdateTempHelp" + e.Message);
            }
            return iExecute;
        }
Exemple #3
0
        /// <summary>
        /// 添加一行临时救助信息
        /// </summary>
        /// <param name="tempHelpInfo">临时救助信息实体</param>
        /// <returns>成功返回1 否则返回0</returns>
        public static int AddTempHelpInfo(TempHelp_Info tempHelpInfo)
        {
            int iExecute = 0;
            try
            {
                StringBuilder strSql = new StringBuilder();
                strSql.Append("insert into TempHelp_Info (");
                strSql.Append("BaseId,Fid,TypeId,Bz_Approver,Bz_Master,Bz_BaoZhang,Bz_Cz,ClassId,Name,Sex,IdCard");
                strSql.Append(",Birth,StreetId,CommunityId,Address,Home,Tel1,Tel2,House,Square,Health,JobId,Wage");
                strSql.Append(",OneMoney,OneMonth,OneTime,Car,Bank");
                strSql.Append(",CheckTime,NextTime,Bz_Retire,RetireTime,Bz_Dead,DeadTime,Money,State,AppReason,MyFid,AddTime");
                strSql.Append(") values(");
                strSql.Append("@BaseId,@Fid,@TypeId,@Bz_Approver,@Bz_Master,@Bz_BaoZhang,@Bz_Cz,@ClassId,@Name,@Sex,@IdCard");
                strSql.Append(",@Birth,@StreetId,@CommunityId,@Address,@Home,@Tel1,@Tel2,@House,@Square,@Health,@JobId,@Wage");
                strSql.Append(",@OneMoney,@OneMonth,@OneTime,@Car,@Bank");
                strSql.Append(",@CheckTime,@NextTime,@Bz_Retire,@RetireTime,@Bz_Dead,@DeadTime,@Money,@State,@AppReason,@MyFid,@AddTime");
                strSql.Append(");select @@IDENTITY");
                SqlParameter[] para = new SqlParameter[]
                {
                new SqlParameter("@BaseId",SqlDbType.Int),
                new SqlParameter("@Fid",SqlDbType.Int),
                new SqlParameter("@TypeId",SqlDbType.Int),
                new SqlParameter("@Bz_Approver",SqlDbType.Int),
                new SqlParameter("@Bz_Master",SqlDbType.Int),
                new SqlParameter("@Bz_BaoZhang",SqlDbType.Int),
                new SqlParameter("@Bz_Cz",SqlDbType.Int),
                new SqlParameter("@ClassId",SqlDbType.Int),
                new SqlParameter("@Name",SqlDbType.NVarChar,50),
                new SqlParameter("@Sex",SqlDbType.NVarChar,50),
                new SqlParameter("@IdCard",SqlDbType.NVarChar,50),
                new SqlParameter("@Birth",SqlDbType.DateTime),
                new SqlParameter("@StreetId",SqlDbType.Int),
                new SqlParameter("@CommunityId",SqlDbType.Int),
                new SqlParameter("@Address",SqlDbType.NVarChar,100),
                new SqlParameter("@Home",SqlDbType.NVarChar,100),
                new SqlParameter("@Tel1",SqlDbType.NVarChar,50),
                new SqlParameter("@Tel2",SqlDbType.NVarChar,50),
                new SqlParameter("@House",SqlDbType.NVarChar,50),
                new SqlParameter("@Square",SqlDbType.NVarChar,50),
                new SqlParameter("@Health",SqlDbType.NVarChar,50),
                new SqlParameter("@JobId",SqlDbType.Int),
                new SqlParameter("@Wage",SqlDbType.NVarChar,50),
                new SqlParameter("@OneMoney",SqlDbType.NVarChar,50),
                new SqlParameter("@OneMonth",SqlDbType.NVarChar,50),
                new SqlParameter("@OneTime",SqlDbType.DateTime),
                new SqlParameter("@Car",SqlDbType.NVarChar,50),
                new SqlParameter("@Bank",SqlDbType.NVarChar,50),
                new SqlParameter("@CheckTime",SqlDbType.DateTime),
                new SqlParameter("@NextTime",SqlDbType.DateTime),
                new SqlParameter("@Bz_Retire",SqlDbType.Int),
                new SqlParameter("@RetireTime",SqlDbType.DateTime),
                new SqlParameter("@Bz_Dead",SqlDbType.Int),
                new SqlParameter("@DeadTime",SqlDbType.DateTime),
                new SqlParameter("@Money",SqlDbType.Int),
                new SqlParameter("@State",SqlDbType.Int),
                new SqlParameter("@AppReason",SqlDbType.NVarChar,10000),
                new SqlParameter("@MyFid",SqlDbType.Int),
                 new SqlParameter("@AddTime",SqlDbType.NVarChar,50),
                };
                para[0].Value = tempHelpInfo.BaseId;
                para[1].Value = tempHelpInfo.Fid;
                para[2].Value = tempHelpInfo.TypeId;
                para[3].Value = tempHelpInfo.Bz_Approver;
                para[4].Value = tempHelpInfo.Bz_Master;
                para[5].Value = tempHelpInfo.Bz_BaoZhang;
                para[6].Value = tempHelpInfo.Bz_Cz;
                para[7].Value = tempHelpInfo.ClassId;
                para[8].Value = tempHelpInfo.Name;
                para[9].Value = tempHelpInfo.Sex;
                para[10].Value = tempHelpInfo.IdCard;
                para[11].Value = tempHelpInfo.Birth;
                para[12].Value = tempHelpInfo.StreetId;
                para[13].Value = tempHelpInfo.CommunityId;
                para[14].Value = tempHelpInfo.Address;
                para[15].Value = tempHelpInfo.Home;
                para[16].Value = tempHelpInfo.Tel1;
                para[17].Value = tempHelpInfo.Tel2;
                para[18].Value = tempHelpInfo.House;
                para[19].Value = tempHelpInfo.Square;
                para[20].Value = tempHelpInfo.Health;
                para[21].Value = tempHelpInfo.JobId;
                para[22].Value = tempHelpInfo.Wage;

                para[23].Value = tempHelpInfo.OneMoney;
                para[24].Value = tempHelpInfo.OneMonth;
                para[25].Value = tempHelpInfo.OneTime;
                para[26].Value = tempHelpInfo.Car;
                para[27].Value = tempHelpInfo.Bank;
                para[28].Value = DateTime.Now;
                para[29].Value = DateTime.Now;
                para[30].Value = tempHelpInfo.Bz_Retire;
                para[31].Value = tempHelpInfo.RetireTime;
                para[32].Value = tempHelpInfo.Bz_Dead;
                para[33].Value = tempHelpInfo.DeadTime;
                para[34].Value = tempHelpInfo.Money;
                para[35].Value = tempHelpInfo.State;
                para[36].Value = tempHelpInfo.AppReason;
                para[37].Value = tempHelpInfo.MyFid;
                para[38].Value = tempHelpInfo.AddTime;

                object obj = DbHelperSQL.GetSingle(strSql.ToString(), para);
                if (obj != null)
                {
                    iExecute = Convert.ToInt32(obj);
                }

            }
            catch (Exception e)
            {
                Log4Net.LogWrite("err", "SysAccessData.SysManage.UserManage\\DacUserInfo\\GetPageUserInfoList" + e.Message);
            }
            return iExecute;
        }
Exemple #4
0
        /// <summary>
        ///  根据低保Id获临时救助信息
        /// </summary>
        /// <param name="Id">临时救助表Id</param>
        /// <returns></returns>
        public static TempHelp_Info GetTempHelpInfoById(int Id)
        {
            TempHelp_Info TempHelpInfo = new TempHelp_Info();
            try
            {
                StringBuilder strSql = new StringBuilder();
                strSql.Append("select A.Id,A.BaseId,A.Fid,A.TypeId,A.Bz_Approver,A.Bz_Master,A.Bz_BaoZhang");
                strSql.Append(",A.Bz_Cz,A.ClassId,A.Name,A.Sex,A.IdCard,A.Birth,A.StreetId,A.CommunityId");
                strSql.Append(",A.Address,A.Home,A.Tel1,A.Tel2,A.House,A.Square,A.Health,A.JobId,A.Money,A.Wage");
                strSql.Append(",A.OneMoney,A.OneMonth,A.OneTime");
                strSql.Append(",A.Car,A.Bank,A.CheckTime,A.NextTime,A.Bz_Retire,A.RetireTime,A.Bz_Dead,A.DeadTime,A.State,A.AppReason,A.MyFid,A.AddTime");
                strSql.Append(" FROM TempHelp_Info as A where A.Id=" + Id);

                DataSet ds = DbHelperSQL.Query(strSql.ToString());

                if (ds.Tables[0].Rows.Count > 0)
                {
                    if (ds.Tables[0].Rows[0]["Id"] != null && ds.Tables[0].Rows[0]["Id"].ToString() != "")
                    {
                        TempHelpInfo.Id = int.Parse(ds.Tables[0].Rows[0]["Id"].ToString());
                    }
                    if (ds.Tables[0].Rows[0]["BaseId"] != null && ds.Tables[0].Rows[0]["BaseId"].ToString() != "")
                    {
                        TempHelpInfo.BaseId = int.Parse(ds.Tables[0].Rows[0]["BaseId"].ToString());
                    }
                    if (ds.Tables[0].Rows[0]["Fid"] != null && ds.Tables[0].Rows[0]["Fid"].ToString() != "")
                    {
                        TempHelpInfo.Fid = int.Parse(ds.Tables[0].Rows[0]["Fid"].ToString());
                    }
                    if (ds.Tables[0].Rows[0]["TypeId"] != null && ds.Tables[0].Rows[0]["TypeId"].ToString() != "")
                    {
                        TempHelpInfo.TypeId = int.Parse(ds.Tables[0].Rows[0]["TypeId"].ToString());
                    }
                    if (ds.Tables[0].Rows[0]["Bz_Approver"] != null && ds.Tables[0].Rows[0]["Bz_Approver"].ToString() != "")
                    {
                        TempHelpInfo.Bz_Approver = int.Parse(ds.Tables[0].Rows[0]["Bz_Approver"].ToString());
                    }
                    if (ds.Tables[0].Rows[0]["Bz_Master"] != null && ds.Tables[0].Rows[0]["Bz_Master"].ToString() != "")
                    {
                        TempHelpInfo.Bz_Master = int.Parse(ds.Tables[0].Rows[0]["Bz_Master"].ToString());
                    }
                    if (ds.Tables[0].Rows[0]["Bz_BaoZhang"] != null && ds.Tables[0].Rows[0]["Bz_BaoZhang"].ToString() != "")
                    {
                        TempHelpInfo.Bz_BaoZhang = int.Parse(ds.Tables[0].Rows[0]["Bz_BaoZhang"].ToString());
                    }
                    if (ds.Tables[0].Rows[0]["Bz_Cz"] != null && ds.Tables[0].Rows[0]["Bz_Cz"].ToString() != "")
                    {
                        TempHelpInfo.Bz_Cz = int.Parse(ds.Tables[0].Rows[0]["Bz_Cz"].ToString());
                    }
                    if (ds.Tables[0].Rows[0]["ClassId"] != null && ds.Tables[0].Rows[0]["ClassId"].ToString() != "")
                    {
                        TempHelpInfo.ClassId = int.Parse(ds.Tables[0].Rows[0]["ClassId"].ToString());
                    }
                    if (ds.Tables[0].Rows[0]["Name"] != null && ds.Tables[0].Rows[0]["Name"].ToString() != "")
                    {
                        TempHelpInfo.Name = ds.Tables[0].Rows[0]["Name"].ToString();
                    }
                    if (ds.Tables[0].Rows[0]["Sex"] != null && ds.Tables[0].Rows[0]["Sex"].ToString() != "")
                    {
                        TempHelpInfo.Sex = ds.Tables[0].Rows[0]["Sex"].ToString();
                    }
                    if (ds.Tables[0].Rows[0]["IdCard"] != null && ds.Tables[0].Rows[0]["IdCard"].ToString() != "")
                    {
                        TempHelpInfo.IdCard = ds.Tables[0].Rows[0]["IdCard"].ToString();
                    }
                    if (ds.Tables[0].Rows[0]["Birth"] != null && ds.Tables[0].Rows[0]["Birth"].ToString() != "")
                    {
                        TempHelpInfo.Birth = DateTime.Parse(ds.Tables[0].Rows[0]["Birth"].ToString());
                    }
                    if (ds.Tables[0].Rows[0]["StreetId"] != null && ds.Tables[0].Rows[0]["StreetId"].ToString() != "")
                    {
                        TempHelpInfo.StreetId = int.Parse(ds.Tables[0].Rows[0]["StreetId"].ToString());
                    }
                    if (ds.Tables[0].Rows[0]["CommunityId"] != null && ds.Tables[0].Rows[0]["CommunityId"].ToString() != "")
                    {
                        TempHelpInfo.CommunityId = int.Parse(ds.Tables[0].Rows[0]["CommunityId"].ToString());
                    }
                    if (ds.Tables[0].Rows[0]["Address"] != null && ds.Tables[0].Rows[0]["Address"].ToString() != "")
                    {
                        TempHelpInfo.Address = ds.Tables[0].Rows[0]["Address"].ToString();
                    }
                    if (ds.Tables[0].Rows[0]["Home"] != null && ds.Tables[0].Rows[0]["Home"].ToString() != "")
                    {
                        TempHelpInfo.Home = ds.Tables[0].Rows[0]["Home"].ToString();
                    }
                    if (ds.Tables[0].Rows[0]["Tel1"] != null && ds.Tables[0].Rows[0]["Tel1"].ToString() != "")
                    {
                        TempHelpInfo.Tel1 = ds.Tables[0].Rows[0]["Tel1"].ToString();
                    }
                    if (ds.Tables[0].Rows[0]["Tel2"] != null && ds.Tables[0].Rows[0]["Tel2"].ToString() != "")
                    {
                        TempHelpInfo.Tel2 = ds.Tables[0].Rows[0]["Tel2"].ToString();
                    }
                    if (ds.Tables[0].Rows[0]["House"] != null && ds.Tables[0].Rows[0]["House"].ToString() != "")
                    {
                        TempHelpInfo.House = ds.Tables[0].Rows[0]["House"].ToString();
                    }
                    if (ds.Tables[0].Rows[0]["Square"] != null && ds.Tables[0].Rows[0]["Square"].ToString() != "")
                    {
                        TempHelpInfo.Square = ds.Tables[0].Rows[0]["Square"].ToString();
                    }
                    if (ds.Tables[0].Rows[0]["Health"] != null && ds.Tables[0].Rows[0]["Health"].ToString() != "")
                    {
                        TempHelpInfo.Health = ds.Tables[0].Rows[0]["Health"].ToString();
                    }
                    if (ds.Tables[0].Rows[0]["JobId"] != null && ds.Tables[0].Rows[0]["JobId"].ToString() != "")
                    {
                        TempHelpInfo.JobId = int.Parse(ds.Tables[0].Rows[0]["JobId"].ToString());
                    }
                    if (ds.Tables[0].Rows[0]["Money"] != null && ds.Tables[0].Rows[0]["Money"].ToString() != "")
                    {
                        TempHelpInfo.Money = decimal.Parse(ds.Tables[0].Rows[0]["Money"].ToString());
                    }
                    if (ds.Tables[0].Rows[0]["Wage"] != null && ds.Tables[0].Rows[0]["Wage"].ToString() != "")
                    {
                        TempHelpInfo.Wage = ds.Tables[0].Rows[0]["Wage"].ToString();
                    }
                    if (ds.Tables[0].Rows[0]["OneMoney"] != null && ds.Tables[0].Rows[0]["OneMoney"].ToString() != "")
                    {
                        TempHelpInfo.OneMoney = ds.Tables[0].Rows[0]["OneMoney"].ToString();
                    }
                    if (ds.Tables[0].Rows[0]["OneMonth"] != null && ds.Tables[0].Rows[0]["OneMonth"].ToString() != "")
                    {
                        TempHelpInfo.OneMonth = ds.Tables[0].Rows[0]["OneMonth"].ToString();
                    }
                    if (ds.Tables[0].Rows[0]["OneTime"] != null && ds.Tables[0].Rows[0]["OneTime"].ToString() != "")
                    {
                        TempHelpInfo.OneTime = DateTime.Parse(ds.Tables[0].Rows[0]["OneTime"].ToString());
                    }
                    if (ds.Tables[0].Rows[0]["Car"] != null && ds.Tables[0].Rows[0]["Car"].ToString() != "")
                    {
                        TempHelpInfo.Car = ds.Tables[0].Rows[0]["Car"].ToString();
                    }
                    if (ds.Tables[0].Rows[0]["Bank"] != null && ds.Tables[0].Rows[0]["Bank"].ToString() != "")
                    {
                        TempHelpInfo.Bank = ds.Tables[0].Rows[0]["Bank"].ToString();
                    }
                    if (ds.Tables[0].Rows[0]["CheckTime"] != null && ds.Tables[0].Rows[0]["CheckTime"].ToString() != "")
                    {
                        TempHelpInfo.CheckTime = DateTime.Parse(ds.Tables[0].Rows[0]["CheckTime"].ToString());
                    }
                    if (ds.Tables[0].Rows[0]["NextTime"] != null && ds.Tables[0].Rows[0]["NextTime"].ToString() != "")
                    {
                        TempHelpInfo.NextTime = DateTime.Parse(ds.Tables[0].Rows[0]["NextTime"].ToString());
                    }
                    if (ds.Tables[0].Rows[0]["Bz_Retire"] != null && ds.Tables[0].Rows[0]["Bz_Retire"].ToString() != "")
                    {
                        TempHelpInfo.Bz_Retire = int.Parse(ds.Tables[0].Rows[0]["Bz_Retire"].ToString());
                    }
                    if (ds.Tables[0].Rows[0]["RetireTime"] != null && ds.Tables[0].Rows[0]["RetireTime"].ToString() != "")
                    {
                        TempHelpInfo.RetireTime = DateTime.Parse(ds.Tables[0].Rows[0]["RetireTime"].ToString());
                    }
                    if (ds.Tables[0].Rows[0]["Bz_Dead"] != null && ds.Tables[0].Rows[0]["Bz_Dead"].ToString() != "")
                    {
                        TempHelpInfo.Bz_Dead = int.Parse(ds.Tables[0].Rows[0]["Bz_Dead"].ToString());
                    }
                    if (ds.Tables[0].Rows[0]["DeadTime"] != null && ds.Tables[0].Rows[0]["DeadTime"].ToString() != "")
                    {
                        TempHelpInfo.DeadTime = DateTime.Parse(ds.Tables[0].Rows[0]["DeadTime"].ToString());
                    }
                    if (ds.Tables[0].Rows[0]["State"] != null && ds.Tables[0].Rows[0]["State"].ToString() != "")
                    {
                        TempHelpInfo.State = int.Parse(ds.Tables[0].Rows[0]["State"].ToString());
                    }
                    if (ds.Tables[0].Rows[0]["AppReason"] != null && ds.Tables[0].Rows[0]["AppReason"].ToString() != "")
                    {
                        TempHelpInfo.AppReason = ds.Tables[0].Rows[0]["AppReason"].ToString();
                    }
                    if (ds.Tables[0].Rows[0]["MyFid"] != null && ds.Tables[0].Rows[0]["MyFid"].ToString() != "")
                    {
                        TempHelpInfo.MyFid = int.Parse(ds.Tables[0].Rows[0]["MyFid"].ToString());
                    }
                    if (ds.Tables[0].Rows[0]["AddTime"] != null && ds.Tables[0].Rows[0]["AddTime"].ToString() != "")
                    {
                        TempHelpInfo.AddTime = ds.Tables[0].Rows[0]["AddTime"].ToString();
                    }
                }

            }
            catch (Exception e)
            {
                Log4Net.LogWrite("err", "Ctrl_Ass_TempHelp:GetTempHelpInfoById" + e.Message);
            }
            return TempHelpInfo;
        }