Beispiel #1
0
    public List <OtherSystemLinkInfo> getSystemLinkDetailList()
    {
        List <OtherSystemLinkInfo> result = new List <OtherSystemLinkInfo>();
        OtherSystemLinkInfo        tmp;
        string sql = "select ID, name, link from OtherSystemLink";

        dbAccess.open();

        try
        {
            System.Data.DataTable dt = dbAccess.select(sql);
            foreach (System.Data.DataRow row in dt.Rows)
            {
                tmp    = new OtherSystemLinkInfo();
                tmp.ID = Convert.ToInt32(row["ID"]);
                //tmp.CreateBy = Convert.ToInt32(row["CreateBy"]);
                //tmp.CreateDate = Convert.ToDateTime(row["CreateDate"]);
                tmp.Link = Convert.ToString(row["Link"]);
                tmp.Name = Convert.ToString(row["Name"]);
                result.Add(tmp);
            }
            return(result);
        }
        catch
        {
            throw;
        }
        finally
        {
            dbAccess.close();
        }
    }
Beispiel #2
0
    public void save(OtherSystemLinkInfo info)
    {
        string sql = "insert into OtherSystemLink (Name, Link, CreateDate, CreateBy) values (@Name, @Link, getDate(), @CreateBy)";
        Dictionary <string, object> dict = new Dictionary <string, object>();

        dict.Add("Name", info.Name);
        dict.Add("Link", info.Link);
        dict.Add("CreateBy", info.CreateBy);

        dbAccess.open();

        try
        {
            dbAccess.update(sql, dict);
        }
        catch
        {
            throw;
        }
        finally
        {
            dbAccess.close();
        }
    }
Beispiel #3
0
    public void update(OtherSystemLinkInfo info)
    {
        string sql = "update OtherSystemLink set name = @Name, link=@Link where [ID] = @ID;";
        Dictionary <string, object> dict = new Dictionary <string, object>();

        dict.Add("Name", info.Name);
        dict.Add("Link", info.Link);
        dict.Add("ID", info.ID);

        dbAccess.open();

        try
        {
            dbAccess.update(sql, dict);
        }
        catch
        {
            throw;
        }
        finally
        {
            dbAccess.close();
        }
    }