Exemplo n.º 1
0
        /// <summary>
        /// 添加一行低保信息
        /// </summary>
        /// <param name="DiBaoInfo">低保信息实体</param>
        /// <returns>成功返回1 否则返回0</returns>
        public static int AddDiBao(DiBao_Info DiBaoInfo)
        {
            int iExecute = 0;
            try
            {
                StringBuilder strSql = new StringBuilder();
                strSql.Append("insert into DiBao_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(",Wage1,Wage2,Wage3,Wage4,Wage5,Wage6,OneMoney,OneMonth,OneTime,Car,Bank");
                strSql.Append(",CheckTime,NextTime,Bz_Retire,RetireTime,Bz_Dead,DeadTime,Money,State,AppReason,MyFid");
                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(",@Wage1,@Wage2,@Wage3,@Wage4,@Wage5,@Wage6,@OneMoney,@OneMonth,@OneTime,@Car,@Bank");
                strSql.Append(",@CheckTime,@NextTime,@Bz_Retire,@RetireTime,@Bz_Dead,@DeadTime,@Money,@State,@AppReason,@MyFid");
                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("@Wage1",SqlDbType.NVarChar,50),
                new SqlParameter("@Wage2",SqlDbType.NVarChar,50),
                new SqlParameter("@Wage3",SqlDbType.NVarChar,50),
                new SqlParameter("@Wage4",SqlDbType.NVarChar,50),
                new SqlParameter("@Wage5",SqlDbType.NVarChar,50),
                new SqlParameter("@Wage6",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),
                };
                para[0].Value = DiBaoInfo.BaseId;
                para[1].Value = DiBaoInfo.Fid;
                para[2].Value = DiBaoInfo.TypeId;
                para[3].Value = DiBaoInfo.Bz_Approver;
                para[4].Value = DiBaoInfo.Bz_Master;
                para[5].Value = DiBaoInfo.Bz_BaoZhang;
                para[6].Value = DiBaoInfo.Bz_Cz;
                para[7].Value = DiBaoInfo.ClassId;
                para[8].Value = DiBaoInfo.Name;
                para[9].Value = DiBaoInfo.Sex;
                para[10].Value = DiBaoInfo.IdCard;
                para[11].Value = DiBaoInfo.Birth;
                para[12].Value = DiBaoInfo.StreetId;
                para[13].Value = DiBaoInfo.CommunityId;
                para[14].Value = DiBaoInfo.Address;
                para[15].Value = DiBaoInfo.Home;
                para[16].Value = DiBaoInfo.Tel1;
                para[17].Value = DiBaoInfo.Tel2;
                para[18].Value = DiBaoInfo.House;
                para[19].Value = DiBaoInfo.Square;
                para[20].Value = DiBaoInfo.Health;
                para[21].Value = DiBaoInfo.JobId;
                para[22].Value = DiBaoInfo.Wage;
                para[23].Value = DiBaoInfo.Wage1;
                para[24].Value = DiBaoInfo.Wage2;
                para[25].Value = DiBaoInfo.Wage3;
                para[26].Value = DiBaoInfo.Wage4;
                para[27].Value = DiBaoInfo.Wage5;
                para[28].Value = DiBaoInfo.Wage6;
                para[29].Value = DiBaoInfo.OneMoney;
                para[30].Value = DiBaoInfo.OneMonth;
                para[31].Value = DiBaoInfo.OneTime;
                para[32].Value = DiBaoInfo.Car;
                para[33].Value = DiBaoInfo.Bank;
                para[34].Value = DiBaoInfo.CheckTime;
                para[35].Value = DiBaoInfo.NextTime;
                para[36].Value = DiBaoInfo.Bz_Retire;
                para[37].Value = DiBaoInfo.RetireTime;
                para[38].Value = DiBaoInfo.Bz_Dead;
                para[39].Value = DiBaoInfo.DeadTime;
                para[40].Value = DiBaoInfo.Money;
                para[41].Value = DiBaoInfo.State;
                para[42].Value = DiBaoInfo.AppReason;
                para[43].Value = DiBaoInfo.MyFid;

                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;
        }
Exemplo n.º 2
0
        /// <summary>
        /// 更新低保人员数据
        /// </summary>
        /// <param name="DiBaoInfo">低保人员信息实体</param>
        /// <returns>成功返回true 否则返回false</returns>
        public static bool UpdateDiBao(DiBao_Info DiBaoInfo)
        {
            bool iExecute = false;
            try
            {
                StringBuilder strSql = new StringBuilder();
                strSql.Append("Update DiBao_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("Wage1=@Wage1,");
                strSql.Append("Wage2=@Wage2,");
                strSql.Append("Wage3=@Wage3,");
                strSql.Append("Wage4=@Wage4,");
                strSql.Append("Wage5=@Wage5,");
                strSql.Append("Wage6=@Wage6,");
                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("@Wage1",SqlDbType.NVarChar,50),
                new SqlParameter("@Wage2",SqlDbType.NVarChar,50),
                new SqlParameter("@Wage3",SqlDbType.NVarChar,50),
                new SqlParameter("@Wage4",SqlDbType.NVarChar,50),
                new SqlParameter("@Wage5",SqlDbType.NVarChar,50),
                new SqlParameter("@Wage6",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 = DiBaoInfo.BaseId;
                para[1].Value = DiBaoInfo.Fid;
                para[2].Value = DiBaoInfo.TypeId;
                para[3].Value = DiBaoInfo.Bz_Approver;
                para[4].Value = DiBaoInfo.Bz_Master;
                para[5].Value = DiBaoInfo.Bz_BaoZhang;
                para[6].Value = DiBaoInfo.Bz_Cz;
                para[7].Value = DiBaoInfo.ClassId;
                para[8].Value = DiBaoInfo.Name;
                para[9].Value = DiBaoInfo.Sex;
                para[10].Value = DiBaoInfo.IdCard;
                para[11].Value = DiBaoInfo.Birth;
                para[12].Value = DiBaoInfo.StreetId;
                para[13].Value = DiBaoInfo.CommunityId;
                para[14].Value = DiBaoInfo.Address;
                para[15].Value = DiBaoInfo.Home;
                para[16].Value = DiBaoInfo.Tel1;
                para[17].Value = DiBaoInfo.Tel2;
                para[18].Value = DiBaoInfo.House;
                para[19].Value = DiBaoInfo.Square;
                para[20].Value = DiBaoInfo.Health;
                para[21].Value = DiBaoInfo.JobId;
                para[22].Value = DiBaoInfo.Wage;
                para[23].Value = DiBaoInfo.Wage1;
                para[24].Value = DiBaoInfo.Wage2;
                para[25].Value = DiBaoInfo.Wage3;
                para[26].Value = DiBaoInfo.Wage4;
                para[27].Value = DiBaoInfo.Wage5;
                para[28].Value = DiBaoInfo.Wage6;
                para[29].Value = DiBaoInfo.OneMoney;
                para[30].Value = DiBaoInfo.OneMonth;
                para[31].Value = DiBaoInfo.OneTime;
                para[32].Value = DiBaoInfo.Car;
                para[33].Value = DiBaoInfo.Bank;
                para[34].Value = DiBaoInfo.CheckTime;
                para[35].Value = DiBaoInfo.NextTime;
                para[36].Value = DiBaoInfo.Bz_Retire;
                para[37].Value = DiBaoInfo.RetireTime;
                para[38].Value = DiBaoInfo.Bz_Dead;
                para[39].Value = DiBaoInfo.DeadTime;
                para[40].Value = DiBaoInfo.Money;
                para[41].Value = DiBaoInfo.State;
                para[42].Value = DiBaoInfo.MyFid;
                para[43].Value = DiBaoInfo.AppReason;
                para[44].Value = DiBaoInfo.Id;

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

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

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

            }
            catch (Exception e)
            {
                Log4Net.LogWrite("err", "SysAccessData.SysManage.UserManage\\DacUserInfo\\GetPageUserInfoList" + e.Message);
            }
            return iExecute;
        }
Exemplo n.º 3
0
        /// <summary>
        ///  根据低保Id获取低保信息
        /// </summary>
        /// <param name="Id">低保表Id</param>
        /// <returns></returns>
        public static DiBao_Info GetDiBaoInfoById(int Id)
        {
            DiBao_Info DiBaoInfo = new DiBao_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.Wage1,A.Wage2,A.Wage3,A.Wage4,A.Wage5,A.Wage6,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");
                //strSql.Append(",B.Name as Type,C.Name as Class,D.Name as StreetName,E.Name as CommunityName,F.Name as Job");
                //strSql.Append(" FROM DiBao_Info as A left join DiBao_Type as B on A.TypeId=B.Id");
                //strSql.Append(" left join DiBao_Class as C on A.ClassId=C.Id");
                //strSql.Append(" left join Area_Street as D on A.StreetId=D.Id");
                //strSql.Append(" left join Area_Community as E on A.CommunityId=E.Id");
                //strSql.Append(" left join DiBao_Job as F on A.JobId=F.Id");
                strSql.Append(" FROM DiBao_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() != "")
                    {
                        DiBaoInfo.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() != "")
                    {
                        DiBaoInfo.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() != "")
                    {
                        DiBaoInfo.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() != "")
                    {
                        DiBaoInfo.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() != "")
                    {
                        DiBaoInfo.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() != "")
                    {
                        DiBaoInfo.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() != "")
                    {
                        DiBaoInfo.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() != "")
                    {
                        DiBaoInfo.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() != "")
                    {
                        DiBaoInfo.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() != "")
                    {
                        DiBaoInfo.Name = ds.Tables[0].Rows[0]["Name"].ToString();
                    }
                    if (ds.Tables[0].Rows[0]["Sex"] != null && ds.Tables[0].Rows[0]["Sex"].ToString() != "")
                    {
                        DiBaoInfo.Sex = ds.Tables[0].Rows[0]["Sex"].ToString();
                    }
                    if (ds.Tables[0].Rows[0]["IdCard"] != null && ds.Tables[0].Rows[0]["IdCard"].ToString() != "")
                    {
                        DiBaoInfo.IdCard = ds.Tables[0].Rows[0]["IdCard"].ToString();
                    }
                    if (ds.Tables[0].Rows[0]["Birth"] != null && ds.Tables[0].Rows[0]["Birth"].ToString() != "")
                    {
                        DiBaoInfo.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() != "")
                    {
                        DiBaoInfo.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() != "")
                    {
                        DiBaoInfo.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() != "")
                    {
                        DiBaoInfo.Address = ds.Tables[0].Rows[0]["Address"].ToString();
                    }
                    if (ds.Tables[0].Rows[0]["Home"] != null && ds.Tables[0].Rows[0]["Home"].ToString() != "")
                    {
                        DiBaoInfo.Home = ds.Tables[0].Rows[0]["Home"].ToString();
                    }
                    if (ds.Tables[0].Rows[0]["Tel1"] != null && ds.Tables[0].Rows[0]["Tel1"].ToString() != "")
                    {
                        DiBaoInfo.Tel1 = ds.Tables[0].Rows[0]["Tel1"].ToString();
                    }
                    if (ds.Tables[0].Rows[0]["Tel2"] != null && ds.Tables[0].Rows[0]["Tel2"].ToString() != "")
                    {
                        DiBaoInfo.Tel2 = ds.Tables[0].Rows[0]["Tel2"].ToString();
                    }
                    if (ds.Tables[0].Rows[0]["House"] != null && ds.Tables[0].Rows[0]["House"].ToString() != "")
                    {
                        DiBaoInfo.House = ds.Tables[0].Rows[0]["House"].ToString();
                    }
                    if (ds.Tables[0].Rows[0]["Square"] != null && ds.Tables[0].Rows[0]["Square"].ToString() != "")
                    {
                        DiBaoInfo.Square = ds.Tables[0].Rows[0]["Square"].ToString();
                    }
                    if (ds.Tables[0].Rows[0]["Health"] != null && ds.Tables[0].Rows[0]["Health"].ToString() != "")
                    {
                        DiBaoInfo.Health = ds.Tables[0].Rows[0]["Health"].ToString();
                    }
                    if (ds.Tables[0].Rows[0]["JobId"] != null && ds.Tables[0].Rows[0]["JobId"].ToString() != "")
                    {
                        DiBaoInfo.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() != "")
                    {
                        DiBaoInfo.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() != "")
                    {
                        DiBaoInfo.Wage = ds.Tables[0].Rows[0]["Wage"].ToString();
                    }
                    if (ds.Tables[0].Rows[0]["Wage1"] != null && ds.Tables[0].Rows[0]["Wage1"].ToString() != "")
                    {
                        DiBaoInfo.Wage1 = ds.Tables[0].Rows[0]["Wage1"].ToString();
                    }
                    if (ds.Tables[0].Rows[0]["Wage2"] != null && ds.Tables[0].Rows[0]["Wage2"].ToString() != "")
                    {
                        DiBaoInfo.Wage2 = ds.Tables[0].Rows[0]["Wage2"].ToString();
                    }
                    if (ds.Tables[0].Rows[0]["Wage3"] != null && ds.Tables[0].Rows[0]["Wage3"].ToString() != "")
                    {
                        DiBaoInfo.Wage3 = ds.Tables[0].Rows[0]["Wage3"].ToString();
                    }
                    if (ds.Tables[0].Rows[0]["Wage4"] != null && ds.Tables[0].Rows[0]["Wage4"].ToString() != "")
                    {
                        DiBaoInfo.Wage4 = ds.Tables[0].Rows[0]["Wage4"].ToString();
                    }
                    if (ds.Tables[0].Rows[0]["Wage5"] != null && ds.Tables[0].Rows[0]["Wage5"].ToString() != "")
                    {
                        DiBaoInfo.Wage5 = ds.Tables[0].Rows[0]["Wage5"].ToString();
                    }
                    if (ds.Tables[0].Rows[0]["Wage6"] != null && ds.Tables[0].Rows[0]["Wage6"].ToString() != "")
                    {
                        DiBaoInfo.Wage6 = ds.Tables[0].Rows[0]["Wage6"].ToString();
                    }
                    if (ds.Tables[0].Rows[0]["OneMoney"] != null && ds.Tables[0].Rows[0]["OneMoney"].ToString() != "")
                    {
                        DiBaoInfo.OneMoney = ds.Tables[0].Rows[0]["OneMoney"].ToString();
                    }
                    if (ds.Tables[0].Rows[0]["OneMonth"] != null && ds.Tables[0].Rows[0]["OneMonth"].ToString() != "")
                    {
                        DiBaoInfo.OneMonth = ds.Tables[0].Rows[0]["OneMonth"].ToString();
                    }
                    if (ds.Tables[0].Rows[0]["OneTime"] != null && ds.Tables[0].Rows[0]["OneTime"].ToString() != "")
                    {
                        DiBaoInfo.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() != "")
                    {
                        DiBaoInfo.Car = ds.Tables[0].Rows[0]["Car"].ToString();
                    }
                    if (ds.Tables[0].Rows[0]["Bank"] != null && ds.Tables[0].Rows[0]["Bank"].ToString() != "")
                    {
                        DiBaoInfo.Bank = ds.Tables[0].Rows[0]["Bank"].ToString();
                    }
                    if (ds.Tables[0].Rows[0]["CheckTime"] != null && ds.Tables[0].Rows[0]["CheckTime"].ToString() != "")
                    {
                        DiBaoInfo.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() != "")
                    {
                        DiBaoInfo.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() != "")
                    {
                        DiBaoInfo.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() != "")
                    {
                        DiBaoInfo.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() != "")
                    {
                        DiBaoInfo.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() != "")
                    {
                        DiBaoInfo.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() != "")
                    {
                        DiBaoInfo.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() != "")
                    {
                        DiBaoInfo.AppReason = ds.Tables[0].Rows[0]["AppReason"].ToString();
                    }
                    if (ds.Tables[0].Rows[0]["MyFid"] != null && ds.Tables[0].Rows[0]["MyFid"].ToString() != "")
                    {
                        DiBaoInfo.MyFid = int.Parse(ds.Tables[0].Rows[0]["MyFid"].ToString());
                    }
                }

            }
            catch (Exception e)
            {
                Log4Net.LogWrite("err", "SysAccessData.SysManage.UserManage\\DacUserInfo\\GetPageUserInfoList" + e.Message);
            }
            return DiBaoInfo;
        }
Exemplo n.º 4
0
        /// <summary>
        /// 保存按钮点击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnSave_Click(object sender, EventArgs e)
        {
            DiBao_Info DiBaoInfo = new DiBao_Info();
            DiBaoInfo.Name = txtName.Text;
            DiBaoInfo.IdCard = txtIdCard.Text;
            DiBaoInfo.Bz_Approver = cbApprover.Checked ? 1 : 0;
            DiBaoInfo.Bz_BaoZhang = cbBaoZhang.Checked ? 1 : 0;
            DiBaoInfo.Bz_Cz = cbCz.Checked ? 1 : 0;
            DiBaoInfo.Bz_Master = cbMaster.Checked ? 1 : 0;
            DiBaoInfo.StreetId = int.Parse(drpStreet.SelectedValue);
            DiBaoInfo.CommunityId = int.Parse(drpCommunity.SelectedValue);
            DiBaoInfo.Address = txtAddress.Text;
            DiBaoInfo.Home = txtHome.Text;
            DiBaoInfo.Tel1 = txtTel1.Text;
            DiBaoInfo.Tel2 = txtTel2.Text;
            DiBaoInfo.House = txtHouse.Text;
            DiBaoInfo.Square = txtSquare.Text;
            DiBaoInfo.Sex = drpSex.SelectedItem.Text;
            DiBaoInfo.Birth = DateTime.Parse(txtBirth.Text);
            DiBaoInfo.TypeId = int.Parse(drpType.SelectedValue);
            DiBaoInfo.ClassId = int.Parse(drpClass.SelectedValue);
            DiBaoInfo.JobId = int.Parse(drpJob.SelectedValue);
            DiBaoInfo.Health = txtHealth.Text;
            DiBaoInfo.Car = txtCar.Text;
            DiBaoInfo.Bank = txtBank.Text;
            DiBaoInfo.Bz_Retire = cbRetire.Checked ? 1 : 0;
            DiBaoInfo.AppReason = txtAppReason.Value;
            DiBaoInfo.MyFid = int.Parse(txtFamNum.Text);
            if (cbRetire.Checked)
            {
                if (txtRetire.Text == "")
                {
                    MessageBox.Show(this, "已退休人员的退休日期不能为空!");
                    return;
                }
                DiBaoInfo.RetireTime = DateTime.Parse(txtRetire.Text);
            }
            else
            {
                DiBaoInfo.RetireTime = null;
            }
            DiBaoInfo.Bz_Dead = cbDead.Checked ? 1 : 0;
            if (cbDead.Checked)
            {
                if (txtDead.Text == "")
                {
                    MessageBox.Show(this, "已死亡人员的死亡日期不能为空!");
                    return;
                }
                DiBaoInfo.DeadTime = DateTime.Parse(txtDead.Text);
            }
            else
            {
                DiBaoInfo.DeadTime = null;
            }

            #region 判断时间输入是否合乎要求(在日历控件不好使的情况下判断)
            DateTime lTime;
            DateTime nTime;
            if (DateTime.TryParse(txtCheckTime.Text, out lTime))
            {
                DiBaoInfo.CheckTime = lTime;
            }
            else
            {
                MessageBox.Show(this, "上次检查时间不正确");
                return;
            }
            if (DateTime.TryParse(txtNextTime.Text, out nTime))
            {
                DiBaoInfo.NextTime = nTime;
            }
            else
            {
                MessageBox.Show(this, "下次检查时间不正确");
                return;
            }
            #endregion

            DiBaoInfo.Wage = txtWage.Text;
            DiBaoInfo.Wage1 = txtWage1.Text;
            DiBaoInfo.Wage2 = txtWage2.Text;
            DiBaoInfo.Wage3 = txtWage3.Text;
            DiBaoInfo.Wage4 = txtWage4.Text;
            DiBaoInfo.Wage5 = txtWage5.Text;
            DiBaoInfo.Wage6 = txtWage6.Text;
            DiBaoInfo.OneMoney = txtOneMoney.Text;
            DiBaoInfo.OneMonth = txtOneMonth.Text;
            DiBaoInfo.OneTime = null;//农村低保不含此项,赋null值
            if (txtMoney.Text == "")
            {
                DiBaoInfo.Money = 0;
            }
            else
            {
                DiBaoInfo.Money = decimal.Parse(txtMoney.Text);
            }
            DiBaoInfo.State = cbState.Checked ? 0 : 1;
            if (hdId.Value == "0")//添加
            {
                if (hdDiBaoId.Value != "0")//如果是待入库表添加
                {
                    DiBaoInfo.BaseId = int.Parse(hdBaseId.Value);
                    DiBaoInfo.Fid = int.Parse(hdFid.Value);
                    if (Ctrl_Ass_DiBao.AddDiBao(DiBaoInfo) > 0)
                    {
                        Ctrl_Base.UpdateBaseInfoWithTableName(DiBaoInfo.BaseId, "DiBao", 2);
                        MessageBox.ShowAndRedirect(this, "添加成功!", ViewState["BackUrl"].ToString());
                    }
                    else
                        MessageBox.Show(this, "添加失败!");
                }
                else//直接添加
                {
                    if (hdFid.Value == "0")//添加一户
                    {
                        //写入基本表
                        BaseEntity BaseInfo = new BaseEntity();
                        BaseInfo.AppId_DiShouRu = 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 = Ctrl_Counter.GetCounter_Fid();//获取Fid

                        DiBaoInfo.Fid = BaseInfo.Fid;
                        DiBaoInfo.BaseId = Ctrl_Base.AddBase(BaseInfo, "DiBao");//信息写入基本表并返回基本表Id

                        if (Ctrl_Ass_DiBao.AddDiBao(DiBaoInfo) > 0)
                        {
                            Ctrl_Base.UpdateBaseInfoWithTableName(DiBaoInfo.BaseId, "DiBao", 2);
                            MessageBox.ShowAndRedirect(this, "添加成功!", "DiBao_Fam_Nc.aspx?Fid=" + DiBaoInfo.Fid);
                        }
                        else
                            MessageBox.Show(this, "添加失败!");
                    }
                    else
                    {
                        //写入基本表
                        BaseEntity BaseInfo = new BaseEntity();
                        BaseInfo.AppId_DiShouRu = 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);

                        DiBaoInfo.BaseId = Ctrl_Base.AddBase(BaseInfo, "DiBao");//信息写入基本表并返回基本表Id
                        DiBaoInfo.Fid = int.Parse(hdFid.Value);
                        if (Ctrl_Ass_DiBao.AddDiBao(DiBaoInfo) > 0)
                        {
                            Ctrl_Base.UpdateBaseInfoWithTableName(DiBaoInfo.BaseId, "DiBao", 2);
                            //MessageBox.ShowAndRedirect(this, "添加成功!", ViewState["BackUrl"].ToString());
                            if (DiBaoInfo.Fid > 0)
                            {
                                //Page.ClientScript.RegisterStartupScript(this.GetType(), "js", "fnAddFamConfirm(" + DiBaoInfo.Fid + ",'" + ViewState["BackUrl"].ToString() + "');", true);
                                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//修改
            {
                DiBaoInfo.Id = int.Parse(hdId.Value);
                DiBaoInfo.BaseId = int.Parse(hdBaseId.Value);
                DiBaoInfo.Fid = int.Parse(hdFid.Value);
                if (cbState.Checked && txtStopReason.Enabled)//如果停发
                {
                    Ctrl_Ass_DiBao.AddStopReason(DiBaoInfo.Id, txtStopReason.Text);
                }
                if (Ctrl_Ass_DiBao.UpdateDiBao(DiBaoInfo))
                    MessageBox.ShowAndRedirect(this, "修改成功!", ViewState["BackUrl"].ToString());
                else
                    MessageBox.Show(this, "修改失败!");
            }
        }