Beispiel #1
0
        public List <PEIS.Model.BusFeeReport> DataTableToList(DataTable dt)
        {
            List <PEIS.Model.BusFeeReport> list = new List <PEIS.Model.BusFeeReport>();
            int count = dt.Rows.Count;

            if (count > 0)
            {
                for (int i = 0; i < count; i++)
                {
                    PEIS.Model.BusFeeReport busFeeReport = new PEIS.Model.BusFeeReport();
                    if (dt.Rows[i]["ID_FeeReport"].ToString() != "")
                    {
                        busFeeReport.ID_FeeReport = int.Parse(dt.Rows[i]["ID_FeeReport"].ToString());
                    }
                    if (dt.Rows[i]["ID_Fee"].ToString() != "")
                    {
                        busFeeReport.ID_Fee = new int?(int.Parse(dt.Rows[i]["ID_Fee"].ToString()));
                    }
                    busFeeReport.FeeName   = dt.Rows[i]["FeeName"].ToString();
                    busFeeReport.ReportKey = dt.Rows[i]["ReportKey"].ToString();
                    busFeeReport.ImageUrl  = dt.Rows[i]["ImageUrl"].ToString();
                    busFeeReport.Note      = dt.Rows[i]["Note"].ToString();
                    if (dt.Rows[i]["Is_Banned"].ToString() != "")
                    {
                        if (dt.Rows[i]["Is_Banned"].ToString() == "1" || dt.Rows[i]["Is_Banned"].ToString().ToLower() == "true")
                        {
                            busFeeReport.Is_Banned = new bool?(true);
                        }
                        else
                        {
                            busFeeReport.Is_Banned = new bool?(false);
                        }
                    }
                    if (dt.Rows[i]["ID_Operator"].ToString() != "")
                    {
                        busFeeReport.ID_Operator = new int?(int.Parse(dt.Rows[i]["ID_Operator"].ToString()));
                    }
                    busFeeReport.Operator = dt.Rows[i]["Operator"].ToString();
                    if (dt.Rows[i]["OperateDate"].ToString() != "")
                    {
                        busFeeReport.OperateDate = new DateTime?(DateTime.Parse(dt.Rows[i]["OperateDate"].ToString()));
                    }
                    if (dt.Rows[i]["OperateType"].ToString() != "")
                    {
                        busFeeReport.OperateType = new int?(int.Parse(dt.Rows[i]["OperateType"].ToString()));
                    }
                    busFeeReport.BanDescribe = dt.Rows[i]["BanDescribe"].ToString();
                    list.Add(busFeeReport);
                }
            }
            return(list);
        }
Beispiel #2
0
        public bool Update(PEIS.Model.BusFeeReport model)
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append("update BusFeeReport set ");
            stringBuilder.Append("ID_Fee=@ID_Fee,");
            stringBuilder.Append("FeeName=@FeeName,");
            stringBuilder.Append("ReportKey=@ReportKey,");
            stringBuilder.Append("ImageUrl=@ImageUrl,");
            stringBuilder.Append("Note=@Note,");
            stringBuilder.Append("Is_Banned=@Is_Banned,");
            stringBuilder.Append("ID_Operator=@ID_Operator,");
            stringBuilder.Append("Operator=@Operator,");
            stringBuilder.Append("OperateDate=@OperateDate,");
            stringBuilder.Append("OperateType=@OperateType,");
            stringBuilder.Append("BanDescribe=@BanDescribe");
            stringBuilder.Append(" where ID_FeeReport=@ID_FeeReport");
            SqlParameter[] array = new SqlParameter[]
            {
                new SqlParameter("@ID_Fee", SqlDbType.Int, 4),
                new SqlParameter("@FeeName", SqlDbType.VarChar, 50),
                new SqlParameter("@ReportKey", SqlDbType.VarChar, 50),
                new SqlParameter("@ImageUrl", SqlDbType.VarChar, 256),
                new SqlParameter("@Note", SqlDbType.VarChar, 2000),
                new SqlParameter("@Is_Banned", SqlDbType.Bit, 1),
                new SqlParameter("@ID_Operator", SqlDbType.Int, 4),
                new SqlParameter("@Operator", SqlDbType.VarChar, 30),
                new SqlParameter("@OperateDate", SqlDbType.DateTime),
                new SqlParameter("@OperateType", SqlDbType.Int, 4),
                new SqlParameter("@BanDescribe", SqlDbType.VarChar, 50),
                new SqlParameter("@ID_FeeReport", SqlDbType.Int, 4)
            };
            array[0].Value  = model.ID_Fee;
            array[1].Value  = model.FeeName;
            array[2].Value  = model.ReportKey;
            array[3].Value  = model.ImageUrl;
            array[4].Value  = model.Note;
            array[5].Value  = model.Is_Banned;
            array[6].Value  = model.ID_Operator;
            array[7].Value  = model.Operator;
            array[8].Value  = model.OperateDate;
            array[9].Value  = model.OperateType;
            array[10].Value = model.BanDescribe;
            array[11].Value = model.ID_FeeReport;
            int num = DbHelperSQL.ExecuteSql(stringBuilder.ToString(), array);

            return(num > 0);
        }
Beispiel #3
0
        public int Add(PEIS.Model.BusFeeReport model)
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append("insert into BusFeeReport(");
            stringBuilder.Append("ID_Fee,FeeName,ReportKey,ImageUrl,Note,Is_Banned,ID_Operator,Operator,OperateDate,OperateType,BanDescribe)");
            stringBuilder.Append(" values (");
            stringBuilder.Append("@ID_Fee,@FeeName,@ReportKey,@ImageUrl,@Note,@Is_Banned,@ID_Operator,@Operator,@OperateDate,@OperateType,@BanDescribe)");
            stringBuilder.Append(";select @@IDENTITY");
            SqlParameter[] array = new SqlParameter[]
            {
                new SqlParameter("@ID_Fee", SqlDbType.Int, 4),
                new SqlParameter("@FeeName", SqlDbType.VarChar, 50),
                new SqlParameter("@ReportKey", SqlDbType.VarChar, 50),
                new SqlParameter("@ImageUrl", SqlDbType.VarChar, 256),
                new SqlParameter("@Note", SqlDbType.VarChar, 2000),
                new SqlParameter("@Is_Banned", SqlDbType.Bit, 1),
                new SqlParameter("@ID_Operator", SqlDbType.Int, 4),
                new SqlParameter("@Operator", SqlDbType.VarChar, 30),
                new SqlParameter("@OperateDate", SqlDbType.DateTime),
                new SqlParameter("@OperateType", SqlDbType.Int, 4),
                new SqlParameter("@BanDescribe", SqlDbType.VarChar, 50)
            };
            array[0].Value  = model.ID_Fee;
            array[1].Value  = model.FeeName;
            array[2].Value  = model.ReportKey;
            array[3].Value  = model.ImageUrl;
            array[4].Value  = model.Note;
            array[5].Value  = model.Is_Banned;
            array[6].Value  = model.ID_Operator;
            array[7].Value  = model.Operator;
            array[8].Value  = model.OperateDate;
            array[9].Value  = model.OperateType;
            array[10].Value = model.BanDescribe;
            object single = DbHelperSQL.GetSingle(stringBuilder.ToString(), array);
            int    result;

            if (single == null)
            {
                result = 0;
            }
            else
            {
                result = Convert.ToInt32(single);
            }
            return(result);
        }
Beispiel #4
0
 protected void GetEditConclusionTypeInfo(int ID_FeeReport, ref VelocityContext vltContext)
 {
     if (ID_FeeReport > 0)
     {
         PEIS.Model.BusFeeReport model = PEIS.BLL.BusFeeReport.Instance.GetModel(ID_FeeReport);
         if (null != model)
         {
             vltContext.Put("ID_FeeReport", model.ID_FeeReport);
             vltContext.Put("ID_Fee", model.ID_Fee);
             vltContext.Put("FeeName", model.FeeName);
             vltContext.Put("Is_Banned", model.Is_Banned);
             vltContext.Put("Operator", model.Operator);
             vltContext.Put("ID_Operator", model.ID_Operator);
             vltContext.Put("Note", model.Note);
             vltContext.Put("OperateDate", model.OperateDate);
         }
     }
 }
Beispiel #5
0
 protected void GetEditFeeReportInfo(int ID_FeeReport, ref VelocityContext vltContext)
 {
     if (ID_FeeReport > 0)
     {
         PEIS.Model.BusFeeReport model = PEIS.BLL.BusFeeReport.Instance.GetModel(ID_FeeReport);
         if (null != model)
         {
             vltContext.Put("ID_FeeReport", model.ID_FeeReport);
             vltContext.Put("ID_Fee", model.ID_Fee);
             vltContext.Put("FeeName", model.FeeName);
             vltContext.Put("Is_Banned", model.Is_Banned);
             vltContext.Put("Operator", model.Operator);
             vltContext.Put("ID_BanOpr", model.ID_Operator);
             vltContext.Put("BanDescribe", model.BanDescribe);
             vltContext.Put("OperateDate", model.OperateDate);
             vltContext.Put("Note", model.Note);
             vltContext.Put("ImageUrl", model.ImageUrl);
             vltContext.Put("ReportKey", model.ReportKey);
         }
     }
 }
Beispiel #6
0
 public int SaveFeeReport(PEIS.Model.BusFeeReport FeeReportModel)
 {
     return(CommonConfig.dal.SaveFeeReport(FeeReportModel));
 }
Beispiel #7
0
 public bool Update(PEIS.Model.BusFeeReport model)
 {
     return(this.dal.Update(model));
 }
Beispiel #8
0
 public int Add(PEIS.Model.BusFeeReport model)
 {
     return(this.dal.Add(model));
 }
Beispiel #9
0
        public PEIS.Model.BusFeeReport GetModel(int ID_FeeReport)
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append("select  top 1 ID_FeeReport,ID_Fee,FeeName,ReportKey,ImageUrl,Note,Is_Banned,ID_Operator,Operator,OperateDate,OperateType,BanDescribe from BusFeeReport ");
            stringBuilder.Append(" where ID_FeeReport=@ID_FeeReport");
            SqlParameter[] array = new SqlParameter[]
            {
                new SqlParameter("@ID_FeeReport", SqlDbType.Int, 4)
            };
            array[0].Value = ID_FeeReport;
            PEIS.Model.BusFeeReport busFeeReport = new PEIS.Model.BusFeeReport();
            DataSet dataSet = DbHelperSQL.Query(stringBuilder.ToString(), array);

            PEIS.Model.BusFeeReport result;
            if (dataSet.Tables[0].Rows.Count > 0)
            {
                if (dataSet.Tables[0].Rows[0]["ID_FeeReport"].ToString() != "")
                {
                    busFeeReport.ID_FeeReport = int.Parse(dataSet.Tables[0].Rows[0]["ID_FeeReport"].ToString());
                }
                if (dataSet.Tables[0].Rows[0]["ID_Fee"].ToString() != "")
                {
                    busFeeReport.ID_Fee = new int?(int.Parse(dataSet.Tables[0].Rows[0]["ID_Fee"].ToString()));
                }
                busFeeReport.FeeName   = dataSet.Tables[0].Rows[0]["FeeName"].ToString();
                busFeeReport.ReportKey = dataSet.Tables[0].Rows[0]["ReportKey"].ToString();
                busFeeReport.ImageUrl  = dataSet.Tables[0].Rows[0]["ImageUrl"].ToString();
                busFeeReport.Note      = dataSet.Tables[0].Rows[0]["Note"].ToString();
                if (dataSet.Tables[0].Rows[0]["Is_Banned"].ToString() != "")
                {
                    if (dataSet.Tables[0].Rows[0]["Is_Banned"].ToString() == "1" || dataSet.Tables[0].Rows[0]["Is_Banned"].ToString().ToLower() == "true")
                    {
                        busFeeReport.Is_Banned = new bool?(true);
                    }
                    else
                    {
                        busFeeReport.Is_Banned = new bool?(false);
                    }
                }
                if (dataSet.Tables[0].Rows[0]["ID_Operator"].ToString() != "")
                {
                    busFeeReport.ID_Operator = new int?(int.Parse(dataSet.Tables[0].Rows[0]["ID_Operator"].ToString()));
                }
                busFeeReport.Operator = dataSet.Tables[0].Rows[0]["Operator"].ToString();
                if (dataSet.Tables[0].Rows[0]["OperateDate"].ToString() != "")
                {
                    busFeeReport.OperateDate = new DateTime?(DateTime.Parse(dataSet.Tables[0].Rows[0]["OperateDate"].ToString()));
                }
                if (dataSet.Tables[0].Rows[0]["OperateType"].ToString() != "")
                {
                    busFeeReport.OperateType = new int?(int.Parse(dataSet.Tables[0].Rows[0]["OperateType"].ToString()));
                }
                busFeeReport.BanDescribe = dataSet.Tables[0].Rows[0]["BanDescribe"].ToString();
                result = busFeeReport;
            }
            else
            {
                result = null;
            }
            return(result);
        }