亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? bookmanager.cs

?? asp.net 做的個(gè)人圖書站點(diǎn)應(yīng)用
?? CS
?? 第 1 頁 / 共 2 頁
字號(hào):
    //                }
    //            }
    //            return book;
    //        }
    //    }
    //}
    //增加類別
    public static void AddBookClass(string name, string remark,byte [] orginal)
    {
        using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["BookShow"].ConnectionString))
        {
            using (SqlCommand command = new SqlCommand("AddCategory", connection))
            {
                command.CommandType = CommandType.StoredProcedure;
                command.Parameters.Add(new SqlParameter("@name", name));
                command.Parameters.Add(new SqlParameter("@remark", remark));
                command .Parameters .Add (new SqlParameter("@image",ResizeImageFile(orginal,100)));
                connection.Open();
                command.ExecuteNonQuery();
            }
        }
    }
    //增加圖書
    public static void AddBook(string BookName,int CategoryID,byte[]orginal,string ISDN,string BookTips)
    {        
        MembershipUser user=Membership.GetUser ();
        
        using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["BookShow"].ConnectionString))
        {
            using (SqlCommand command = new SqlCommand("AddBook", connection))
            {
               command.CommandType = CommandType.StoredProcedure;
               command .Parameters .Add (new SqlParameter ("@BookName",BookName ));
               command.Parameters.Add(new SqlParameter("@CategoryID", CategoryID));
               command.Parameters.Add(new SqlParameter("@BookImageS", ResizeImageFile(orginal, 100)));
               command.Parameters.Add(new SqlParameter("@BookImageL", ResizeImageFile(orginal, 250)));
               command.Parameters.Add(new SqlParameter("@ISBN", ISDN ));
               command .Parameters .Add (new SqlParameter ("@UserID",user .UserName .ToString ()));
               command.Parameters.Add(new SqlParameter("@BookTips", BookTips));
               command.Parameters.Add(new SqlParameter("@AddDateTime", DateTime.Now));
               connection.Open();
               command.ExecuteNonQuery();
            }
        }
    }
    //修改圖書
    public static void EditBook(int BookID,string BookName, int CategoryID, byte[] orginal, string ISDN, string BookTips)
    {
        
        using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["BookShow"].ConnectionString))
        {
            using (SqlCommand command = new SqlCommand("EditBook", connection))
            {
                command.CommandType = CommandType.StoredProcedure;
                command.Parameters.Add(new SqlParameter("@BookID", BookID));
                command.Parameters.Add(new SqlParameter("@BookName", BookName));
                command.Parameters.Add(new SqlParameter("@CategoryID", CategoryID));
                command.Parameters.Add(new SqlParameter("@BookImageS", ResizeImageFile(orginal, 100)));
                command.Parameters.Add(new SqlParameter("@BookImageL", ResizeImageFile(orginal, 250)));
                command.Parameters.Add(new SqlParameter("@ISBN", ISDN));
                command.Parameters.Add(new SqlParameter("@BookTips", BookTips));
              
                connection.Open();
                command.ExecuteNonQuery();
            }
        }
    }
    //移除類別
    public static void RemoveCategory(int CategoryID)
    {
        using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["BookShow"].ConnectionString))
        {
            using (SqlCommand command = new SqlCommand("RemoveCategory", connection))
            {  
                command.CommandType = CommandType.StoredProcedure;
                command.Parameters.Add(new SqlParameter("@categoryID", CategoryID));
                connection.Open();
                command.ExecuteNonQuery();
            }
        }
    }
    //移除圖書
    public static void RemoveBook(int BookID)
    {
        using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["BookShow"].ConnectionString))
        {
            using (SqlCommand command = new SqlCommand("RemoveBook", connection))
            {
                command.CommandType = CommandType.StoredProcedure;
                command.Parameters.Add(new SqlParameter("@BookID", BookID));
                connection.Open();
                command.ExecuteNonQuery();
            }
        }
    }
    //獲得圖書封面圖像
    public static Stream GetBookImage(int bookid, ImageSize size)
    {
       using ( SqlConnection connection = new SqlConnection (ConfigurationManager .ConnectionStrings ["BookShow"].ConnectionString ))
       {
           using (SqlCommand command = new SqlCommand ("GetBookImage",connection ))
           {
               command.CommandType = CommandType.StoredProcedure;
               command.Parameters.Add(new SqlParameter("@BookID", bookid));
               command .Parameters .Add (new SqlParameter ("@size",(int)size));
               connection.Open();
               object result = command.ExecuteScalar();
               try
               {
                   return new MemoryStream((byte[])result);
               }
               catch 
               {
                   return null;
               }
           }
       }
        
    }
    //獲得類別圖片
    public static Stream GetClassImage(int categoryid, ImageSize size)
    {
       using (SqlConnection connection = new SqlConnection (ConfigurationManager.ConnectionStrings["BookShow"].ConnectionString ))
       {
           using(SqlCommand  command = new SqlCommand ("GetClassImage",connection ))
           {
               command .CommandType=CommandType.StoredProcedure;
               command .Parameters .Add (new SqlParameter ("@categoryid",categoryid ));
               connection .Open ();
               object result=command .ExecuteScalar();
               try
               {
                   return new MemoryStream ((byte[])result );
               }
               catch 
               {return null;}

           }
       }
    }
    //當(dāng)無圖像時(shí),獲得無圖像封面
    public static Stream GetImage(ImageSize size)
    {
        string path =HttpContext.Current .Server.MapPath("~/Images/");
        switch (size)
        {
            case ImageSize .Small :
                path += "placeholder-100.jpg";
                break;
            case ImageSize .Large:
                path += "placeholder-600.jpg";
                break;
            default :
                path += "placeholder-600.jpg";
                break;
        }
       
        return new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read);
    }
    //計(jì)算維度, 當(dāng)高比寬高時(shí),按高為基礎(chǔ)計(jì)算比例,當(dāng)寬更大時(shí),剛以寬為基礎(chǔ)
    private static Size CalculateDimensions(Size oldSize, int targetSize)
    {
        Size newSize = new Size();
        if (oldSize.Height > oldSize.Width)
        {
            newSize.Width = (int)(oldSize.Width * ((float)targetSize / (float)oldSize.Height));
            newSize.Height = targetSize;
        }
        else
        {
            newSize.Width = targetSize;
            newSize.Height = (int)(oldSize.Height * ((float)targetSize / (float)oldSize.Width));
        }
        return newSize;
    }
    //比例緞縮放圖像。
    private static byte[] ResizeImageFile(byte[] imageFile, int targetSize)
    {
        using (System.Drawing.Image oldImage = System.Drawing.Image.FromStream(new MemoryStream(imageFile)))
        {
            Size newSize = CalculateDimensions(oldImage.Size, targetSize);
            using (Bitmap newImage = new Bitmap(newSize.Width ,newSize.Height ,System .Drawing .Imaging.PixelFormat.Format24bppRgb))
            {
                using (Graphics canvas = Graphics.FromImage(newImage))
                {
                    canvas.SmoothingMode = SmoothingMode.AntiAlias;
                    canvas.InterpolationMode = InterpolationMode.HighQualityBicubic;
                    canvas.PixelOffsetMode = PixelOffsetMode.HighQuality;
                    canvas .DrawImage(oldImage ,new Rectangle(new Point (0,0),newSize ));
                    MemoryStream m = new MemoryStream ();
                    newImage.Save (m,System .Drawing .Imaging .ImageFormat.Jpeg );
                    return  m.GetBuffer ();
                }
            }
            }

    }
    //修改類別
    public static void EidtCategory(string CategoryName, string CategoryRemark, byte[] orginal, int CategoryID)
    {
        using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["BookShow"].ConnectionString))
        { 
            using (SqlCommand  command = new SqlCommand ("EidtCategory",connection ))
            {
                command.CommandType = CommandType.StoredProcedure;
                command.Parameters .Add (new SqlParameter("@CategoryID",CategoryID));
                command.Parameters.Add(new SqlParameter("@CategoryName", CategoryName));
                command.Parameters.Add(new SqlParameter("@CategoryRemark", CategoryRemark));
                command.Parameters.Add(new SqlParameter("@CategoryImage",ResizeImageFile (orginal ,100)));
                connection.Open();
                command.ExecuteNonQuery();
            }
        }
            
    }
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产cao| 麻豆国产精品一区二区三区| 欧美一区三区二区| 国产91色综合久久免费分享| 亚洲成人你懂的| 国产精品久久久久一区| 精品三级在线看| 欧美性生活一区| a美女胸又www黄视频久久| 免费美女久久99| 亚洲国产欧美在线| 国产精品久久久久天堂| 精品久久久久久久一区二区蜜臀| 色一情一乱一乱一91av| 国产成人av电影| 国产麻豆精品在线观看| 奇米亚洲午夜久久精品| 亚洲一区国产视频| 亚洲伦理在线免费看| 国产亚洲精品免费| 精品国产第一区二区三区观看体验| 欧美亚洲综合一区| 在线免费不卡视频| 91在线云播放| 99re视频精品| 成人国产精品免费| 国产精一区二区三区| 精品一区二区三区香蕉蜜桃| 亚洲成人777| 亚洲国产日韩在线一区模特| 亚洲婷婷国产精品电影人久久| 国产欧美日韩亚州综合| 久久婷婷久久一区二区三区| 欧美一级国产精品| 91精品欧美一区二区三区综合在 | 91在线精品秘密一区二区| 国产久卡久卡久卡久卡视频精品| 狠狠网亚洲精品| 国内精品在线播放| 国产成人无遮挡在线视频| 国模冰冰炮一区二区| 国产美女一区二区三区| 国产尤物一区二区| 丰满亚洲少妇av| 成人aa视频在线观看| 播五月开心婷婷综合| 97久久精品人人澡人人爽| caoporn国产精品| 日本道免费精品一区二区三区| 色婷婷综合久久久中文字幕| 在线观看日产精品| 538在线一区二区精品国产| 欧美狂野另类xxxxoooo| 欧美一区二区三区在线观看| 欧美r级电影在线观看| 久久综合色播五月| 国产精品全国免费观看高清 | 亚洲亚洲精品在线观看| 亚洲成av人片在线| 美女精品一区二区| 成人综合婷婷国产精品久久| 91在线看国产| 欧美一级欧美三级| 久久亚洲精精品中文字幕早川悠里 | 欧美日韩专区在线| 91精品国产综合久久蜜臀| 日韩欧美aaaaaa| 中文字幕欧美国产| 夜夜揉揉日日人人青青一国产精品 | 国产欧美精品一区二区三区四区 | 国产一区二区主播在线| 从欧美一区二区三区| 在线观看视频一区| 日韩精品一区二区三区在线观看| 久久久一区二区三区| 亚洲视频狠狠干| 久久精品久久综合| 成人免费av资源| 欧美精品久久天天躁| 国产欧美精品一区二区色综合| 亚洲激情av在线| 九一九一国产精品| 91免费精品国自产拍在线不卡| 91精品国产一区二区三区香蕉 | 午夜精品久久久久久久蜜桃app| 开心九九激情九九欧美日韩精美视频电影| 高清不卡一二三区| 欧美一区二区在线观看| 国产精品麻豆网站| 免费亚洲电影在线| 99riav久久精品riav| 精品美女被调教视频大全网站| 亚洲麻豆国产自偷在线| 九九九精品视频| 在线影视一区二区三区| 久久久精品影视| 婷婷久久综合九色综合绿巨人| 成人午夜电影久久影院| 欧美一区二区免费| 一区二区三区免费看视频| 国产精品一级片在线观看| 欧美日韩在线综合| 亚洲欧洲av一区二区三区久久| 美女视频黄 久久| 欧美日韩久久一区二区| 中文字幕一区二区三区在线播放| 蜜桃av一区二区| 在线观看欧美黄色| 亚洲欧洲日韩综合一区二区| 国产呦精品一区二区三区网站 | 国产精品毛片高清在线完整版| 美日韩一区二区三区| 在线观看亚洲精品| 亚洲色图色小说| 丰满白嫩尤物一区二区| 精品国产免费久久| 蜜桃一区二区三区在线| 欧美精品色一区二区三区| 亚洲另类在线制服丝袜| 精品视频1区2区3区| 欧美mv日韩mv国产网站app| 亚洲一本大道在线| 色八戒一区二区三区| 国产精品免费观看视频| 国产成人午夜视频| 久久综合久久鬼色中文字| 久久精品国产免费| 欧美巨大另类极品videosbest | 国产欧美日产一区| 国产很黄免费观看久久| 久久久99久久| 国产精品一区二区三区99| 精品不卡在线视频| 狠狠色伊人亚洲综合成人| 欧美一区二区三区四区视频| 午夜精品久久久久久久久久| 欧美精品在线观看播放| 日韩vs国产vs欧美| 日韩欧美精品在线| 久久99精品久久久久久国产越南 | 91精品国产美女浴室洗澡无遮挡| 99久久久精品免费观看国产蜜| 欧美激情在线看| 成人三级伦理片| 中文字幕在线不卡一区二区三区| 成人黄色综合网站| 自拍视频在线观看一区二区| 99久久国产综合色|国产精品| 国产精品久久久久影院色老大| 成人av午夜电影| 亚洲精品高清视频在线观看| 欧美亚洲愉拍一区二区| 婷婷久久综合九色国产成人| 91精品一区二区三区在线观看| 久久超级碰视频| 国产性色一区二区| 91在线一区二区| 亚洲bt欧美bt精品777| 精品卡一卡二卡三卡四在线| 国产.精品.日韩.另类.中文.在线.播放| 亚洲国产精品99久久久久久久久| 成人av先锋影音| 亚洲高清视频在线| 精品国产百合女同互慰| 成人免费看片app下载| 一片黄亚洲嫩模| 3d动漫精品啪啪| 国产精品性做久久久久久| 中文字幕视频一区二区三区久| 在线观看视频一区二区欧美日韩| 免费一区二区视频| 国产欧美日韩在线看| 91成人国产精品| 美日韩一区二区| 综合久久国产九一剧情麻豆| 一区二区久久久| 26uuu精品一区二区在线观看| 97精品国产露脸对白| 日韩精品一级二级| 国产精品美女久久久久久| 欧美人伦禁忌dvd放荡欲情| 国产福利91精品一区二区三区| 曰韩精品一区二区| 精品国产sm最大网站免费看| 91在线精品一区二区| 麻豆91精品视频| 综合在线观看色| 精品日韩99亚洲| 欧美亚洲另类激情小说| 国产精品一区二区久激情瑜伽| 亚洲自拍偷拍九九九| 久久免费电影网| 91精品国产91综合久久蜜臀| 成人综合婷婷国产精品久久蜜臀| 日本伊人色综合网| 亚洲人成网站影音先锋播放| 日韩精品一区国产麻豆| 在线日韩av片| 成人av网址在线| 久久机这里只有精品|