private int UpdateData()
        {
            int SkinPackage_ID = Convert.ToInt32(ddlPackageList.SelectedValue);
            string SkinBackground_Name = txtTitle.Text;
            string SkinBackground_Url = txtUrl.Text;
            bool bStatus = ChkBoxStatus.Checked;
            int SkinBackground_Discontinued = 0;
            if (bStatus == true)
            {
                SkinBackground_Discontinued = 1;
            }
            else
            {
                SkinBackground_Discontinued = 0;
            }


            /*** UPLOAD *************************************************************************************************************/
            string dir_path = "~/" + System.Configuration.ConfigurationManager.AppSettings["upload_image_dir"] + "/background_images/";
            HttpPostedFile icon_file = FileInput.PostedFile;
            string SkinBackground_FileName = "";
            if (icon_file.ContentLength > 0)
            {
                ModuleClass module_obj = new ModuleClass();
                module_obj.deleteFile(txtFileName.Text, dir_path);
               
                SkinBackground_FileName = module_obj.GetEncodeString(System.IO.Path.GetFileName(icon_file.FileName));                   
                string savePath = Server.MapPath(dir_path + SkinBackground_FileName);
                icon_file.SaveAs(savePath);
            }
            else
            {
                SkinBackground_FileName = txtFileName.Text;
            }
            /************************************************************************************************************************/

            SkinBackgrounds background_obj = new SkinBackgrounds();
            int i = background_obj.Update(_idx, SkinPackage_ID, SkinBackground_Name,SkinBackground_FileName, SkinBackground_Url, SkinBackground_Discontinued);            
            return i;
        }
         public string[] GetBackgroundList()
         {
             SkinBackgrounds background_obj = new SkinBackgrounds();    
             string SkinType="0";
             int SkinPackageId=2;
             int SkinBackground_Discontinued =1;
             int Qty=6;

             DataTable dt = background_obj.GetListBySkinTypeSkinPackageIdDiscontinuedWithQty(SkinType, SkinPackageId, SkinBackground_Discontinued, Qty);

             System.Collections.Generic.List<string> list = new System.Collections.Generic.List<string>();

             foreach (DataRow row in dt.Rows)
             {

                 list.Add(row["SkinBackground_FileName"].ToString());
             }

             return list.ToArray();

             //string[] strArray = new string[] { "s5_background1.jpg", "s5_background2.jpg", "s5_background3.jpg" };
             //return strArray;
         }
        private void LoadData()
        {
            SkinBackgrounds background_obj = new SkinBackgrounds();
            DataTable dt = background_obj.GetDetails(_idx);
            txtTitle.Text = dt.Rows[0]["SkinBackground_Name"].ToString();
            string dir_img = System.Configuration.ConfigurationManager.AppSettings["upload_image_dir"];
            imgPhoto.ImageUrl = "~/" + dir_img + "/background_images/" + dt.Rows[0]["SkinBackground_FileName"].ToString();
            txtFileName.Text = dt.Rows[0]["SkinBackground_FileName"].ToString();
            txtUrl.Text = dt.Rows[0]["SkinBackground_Url"].ToString();
            ChkBoxStatus.Checked = Convert.ToBoolean(dt.Rows[0]["SkinBackground_Discontinued"].ToString());

            string ApplicationId = dt.Rows[0]["ApplicationId"].ToString();
            LoadApplicationList2DDL(ApplicationId);            

            string SkinType= dt.Rows[0]["SkinType"].ToString();
            LoadSkinTypeList2DDL(SkinType);

            string SkinPackage_ID = dt.Rows[0]["SkinPackage_ID"].ToString();
            LoadPackageList2DDL(SkinPackage_ID);
        }