예제 #1
0
        /// <summary>
        /// 获得新增费的集合
        /// </summary>
        /// <param name="role"></param>
        /// <returns></returns>
        public IList<XM_XZF> GetNACharge(XM_XZF xzf)
        {
            IList<XM_XZF> datalist = new List<XM_XZF>();
            string strWhere = string.Empty;
            if (!string.IsNullOrEmpty(xzf.XZDM)) strWhere += "XZDM = '" + xzf.XZDM + "' And ";
            if (!string.IsNullOrEmpty(xzf.ZJND)) strWhere += "ZJND = '" + xzf.ZJND + "' And ";
            if (!string.IsNullOrEmpty(xzf.DQND)) strWhere += "DQND = '" + xzf.DQND + "' And ";

            string strSql = "select * from XM_XZF where {0}  1 = 1  order by dqnd desc,zjnd";
            strSql = string.Format(strSql, strWhere);
            IDataReader dr = OracleHelper.ExecuteReader(strSql);
            while (dr.Read())
            {
                XM_XZF XZFEntity = new XM_XZF();
                XZFEntity.XZFID = Convert.ToInt32(dr["XZFID"]);
                XZFEntity.XZDM = dr["XZDM"].ToString();
                XZFEntity.ZJND = dr["ZJND"].ToString();
                XZFEntity.ZJSE = Convert.ToDecimal(dr["ZJSE"]);
                XZFEntity.XDWH = dr["XDWH"].ToString();
                XZFEntity.XDSJ = Convert.ToDateTime(dr["XDSJ"]);
                XZFEntity.DQND = dr["DQND"].ToString();
                datalist.Add(XZFEntity);
            }
            dr.Close();
            return datalist;
        }
예제 #2
0
        /// <summary>
        /// 新增费信息增删改
        /// </summary>
        /// <param name="xzf"></param>
        /// <returns></returns>
        public bool NACharge(XM_XZF xzf)
        {
            string strSql = string.Empty;
            switch (xzf.Action)
            {
                case ActionEnum.Insert:
                    if (xzf.DQND == "1")
                    {
                        UpdateDQND();
                    }
                    strSql = "Insert into XM_XZF(XZFID,XZDM,ZJND,ZJSE,XDWH,XDSJ,DQND) Values ('{1}'||{0},'{1}','{2}','{3}','{4}',to_date('{5}','yyyy-mm-dd hh24:mi:ss'),'{6}')";
                    strSql = string.Format(strSql, "SEQ_XZF.Nextval", xzf.XZDM, xzf.ZJND, xzf.ZJSE, xzf.XDWH, xzf.XDSJ, xzf.DQND);

                    break;
                case ActionEnum.Update:
                    if (xzf.DQND == "1")
                    {
                        UpdateDQND();
                    }
                    strSql = "Update XM_XZF Set ZJSE = '{1}',XDWH = '{2}',XDSJ=to_date('{3}','yyyy-mm-dd hh24:mi:ss'),DQND='{4}' Where ZJND = '{0}'";
                    strSql = string.Format(strSql, xzf.ZJND, xzf.ZJSE, xzf.XDWH, xzf.XDSJ, xzf.DQND);
                    break;
                case ActionEnum.Delete:
                    strSql = "delete from XM_XZF Where XZFID = '{0}'";
                    strSql = string.Format(strSql, xzf.ZJND);
                    break;
            }
            return OracleHelper.ExecuteCommand(strSql);
        }