private void AddRIPresident()
    {
        try
        {
            RIPresident rip = new RIPresident();

            try
            {
                rip.District_no = int.Parse(txtDistNo.Text.Trim().ToString());
            }
            catch { rip.District_no = 0; }
            try
            {
                rip.Participant = int.Parse(txtParticepant.Text.Trim().ToString());
            }
            catch
            {
                rip.Participant = 0;
            }
            rip.Description = txtData.Content;

            rip.Year       = DDLYear.SelectedItem.Text.Trim().ToString();
            rip.Fname      = txtFName.Text.Trim().ToString();
            rip.Mname      = txtMName.Text.Trim().ToString();
            rip.Lname      = txtLName.Text.Trim().ToString();
            rip.Club_name  = txtClubName.Text.Trim().ToString();
            rip.District   = txtDistrict.Text.Trim().ToString();// Location
            rip.Country    = txtCountry.Text.Trim().ToString();
            rip.Theme      = txtTheme.Text.Trim().ToString();
            rip.Convention = txtConvention.Text.Trim().ToString();

            SaveImages img = new SaveImages();

            string pimg = img.AddImages(FileUploadPhoto.PostedFile, "RIPresidentPhotos");
            rip.President_image = pimg;

            string theme_logo = img.AddImages(FileUploadPhoto.PostedFile, "RIPresidentLogo");
            rip.Theme_logo = theme_logo;

            string convention_image = img.AddImages(FileUploadPhoto.PostedFile, "RIPresidentLogo");
            rip.Convention_image = convention_image;

            int exe = rip.AddRIPresident();

            if (exe > 0)
            {
                clear();
                string jv = "<script>alert('Record Added Successfully');</script>";
                ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "alert", jv, false);
            }
        }
        catch { }
    }
    private void UpdateRIPresident(int id)
    {
        try
        {
            RIPresident rip = new RIPresident();
            try
            {
                rip.District_no = int.Parse(txtDistNo.Text.Trim().ToString());
            }
            catch { rip.District_no = 0; }
            try
            {
                rip.Participant = int.Parse(txtParticepant.Text.Trim().ToString());
            }
            catch
            {
                rip.Participant = 0;
            }
            rip.Description = txtData.Content;

            rip.Id         = id;
            rip.Year       = DDLYear.SelectedItem.Text.Trim().ToString();
            rip.Fname      = txtFName.Text.Trim().ToString();
            rip.Mname      = txtMName.Text.Trim().ToString();
            rip.Lname      = txtLName.Text.Trim().ToString();
            rip.Club_name  = txtClubName.Text.Trim().ToString();
            rip.District   = txtDistrict.Text.Trim().ToString();
            rip.Country    = txtCountry.Text.Trim().ToString();
            rip.Theme      = txtTheme.Text.Trim().ToString();
            rip.Convention = txtConvention.Text.Trim().ToString();

            SaveImages img = new SaveImages();

            string pimg = img.AddImages(FileUploadPhoto.PostedFile, "RIPresidentPhotos");
            rip.President_image = pimg;

            string theme_logo = img.AddImages(FileUploadPhoto.PostedFile, "RIPresidentLogo");
            rip.Theme_logo = theme_logo;

            string convention_image = img.AddImages(FileUploadPhoto.PostedFile, "RIPresidentLogo");
            rip.Convention_image = convention_image;

            int exe = rip.UpdateRIPresident();
            if (exe > 0)
            {
                clear();
                showmsg("Record updated successfully !", "view_ri_president.aspx");
            }
        }
        catch { }
    }
示例#3
0
    private void AddSponser()
    {
        int    maxOrdNo = GetMaxOrdNo();
        string path     = "";

        try
        {
            DBconnection obj = new DBconnection();
            obj.SetCommandSP = "z_AddSponser_Dist";

            SaveImages img = new SaveImages();
            path = img.AddImages(FileUpload1.PostedFile, "Sponsers_Logo");

            obj.AddParam("@start_date", DateTime.Parse(StartDate.SelectedDate.ToString()));
            obj.AddParam("@end_date", DateTime.Parse(EndDate.SelectedDate.ToString()));

            obj.AddParam("@title", txtTitle.Text.ToString());
            obj.AddParam("@url", txtURL.Text.ToString());
            obj.AddParam("@status", DDLStatus.SelectedItem.Text.Trim().ToString());
            obj.AddParam("@logo", path);
            obj.AddParam("@display_order", maxOrdNo + 1);


            int exe = obj.ExecuteNonQuery();

            if (exe > 0)
            {
                clear();
                string jv = "<script>alert('Record has been added successfully');</script>";
                ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "alert", jv, false);
            }
        }
        catch { }
    }
示例#4
0
    private void UpdateSponser(int id)
    {
        string path = "";

        try
        {
            DBconnection obj = new DBconnection();
            obj.SetCommandSP = "z_UpdateSponser_Dist";

            if (FileUpload1.PostedFile != null)
            {
                path = Session["logo"].ToString();
            }
            else
            {
                SaveImages img = new SaveImages();
                path = img.AddImages(FileUpload1.PostedFile, "Sponsers_Logo");
            }

            obj.AddParam("@id", id);
            obj.AddParam("@start_date", DateTime.Parse(StartDate.SelectedDate.ToString()));
            obj.AddParam("@end_date", DateTime.Parse(EndDate.SelectedDate.ToString()));
            obj.AddParam("@title", txtTitle.Text.ToString());
            obj.AddParam("@url", txtURL.Text.ToString());
            obj.AddParam("@status", DDLStatus.SelectedItem.Text.Trim().ToString());
            obj.AddParam("@logo", path);

            int exe = obj.ExecuteNonQuery();

            if (exe > 0)
            {
                clear();

                showmsg("Record has been updated successfully !", "view_sponsors.aspx");
            }
        }
        catch { }
    }
示例#5
0
    private void UpdateBulletin(int id)
    {
        string path, mast_head = "";

        try
        {
            DBconnection obj = new DBconnection();
            obj.SetCommandSP = "z_UpdateBulletin";

            SaveImages img = new SaveImages();
            path      = img.AddImages(FileUpload1.PostedFile, "Bulletin");
            mast_head = img.AddImages(FileUpload2.PostedFile, "Bulletin");


            try
            {
                if (path == "")
                {
                    obj.AddParam("@bulletin", Session["Bulletin"].ToString());
                }
                else
                {
                    obj.AddParam("@bulletin", path);
                }
            }
            catch { obj.AddParam("@bulletin", ""); }

            try
            {
                if (mast_head == "")
                {
                    obj.AddParam("@mast_head", Session["MastHead"].ToString());
                }
                else
                {
                    obj.AddParam("@mast_head", mast_head);
                }
            }
            catch { obj.AddParam("@mast_head", ""); }

            obj.AddParam("@id", id);
            obj.AddParam("@title", txtTitle.Text.ToString());
            obj.AddParam("@frequency", rbtnFrequency.SelectedItem.Text.ToString());
            obj.AddParam("@status", DDLStatus.SelectedItem.Text.Trim().ToString());

            int i = int.Parse(rbtnFor.SelectedValue.ToString());
            if (i == 0)
            {
                obj.AddParam("@DistrictClubID", 0);
            }

            else
            {
                int cid = int.Parse(DDLClubName.SelectedValue.ToString());
                obj.AddParam("@DistrictClubID", cid);
            }



            int exe = obj.ExecuteNonQuery();

            if (exe > 0)
            {
                clear();

                showmsg("Record updated successfully !", "view_bulletin.aspx");
                //    string jv = "<script>alert('Record Added Successfully');</script>";
                //    ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "alert", jv, false);
            }
        }
        catch { }
    }
示例#6
0
    private void AddBulletin()
    {
        string path, mast_head = "";

        try
        {
            DBconnection obj = new DBconnection();
            obj.SetCommandSP = "z_AddBulletin";

            obj.AddParam("@added_by", "Admin");

            int i = int.Parse(rbtnFor.SelectedValue.ToString());
            if (i == 0)
            {
                obj.AddParam("@DistrictClubID", 0);
            }

            else
            {
                int cid = int.Parse(DDLClubName.SelectedValue.ToString());
                obj.AddParam("@DistrictClubID", cid);
            }

            SaveImages img = new SaveImages();
            path      = img.AddImages(FileUpload1.PostedFile, "Bulletin");
            mast_head = img.AddImages(FileUpload2.PostedFile, "Bulletin");


            //try
            //{
            //    foreach (UploadedFile file in RadAsyncUpload1.UploadedFiles)
            //    {
            //        fileSize = file.ContentLength;
            //        file_name = file.FileName;
            //        file_name = file_name.Substring(file_name.LastIndexOf("\\") + 1);
            //        string imageTime = System.DateTime.Now.ToString();
            //        imageTime = imageTime.Replace("/", "");
            //        imageTime = imageTime.Replace("-", "");
            //        imageTime = imageTime.Replace(":", "");
            //        imageTime = imageTime.Replace(" ", "");
            //        ext = file_name.Substring(file_name.LastIndexOf("."));
            //        file_name = file_name.Substring(0, file_name.LastIndexOf("."));
            //        file_name = file_name + "_" + imageTime + ext;
            //        path = Server.MapPath("~/Bulletin/");
            //        path = path + "/" + file_name;
            //        file.SaveAs(path);
            //    }
            //}
            //catch { }

            obj.AddParam("@title", txtTitle.Text.ToString());
            obj.AddParam("@frequency", rbtnFrequency.SelectedItem.Text.ToString());
            obj.AddParam("@status", DDLStatus.SelectedItem.Text.Trim().ToString());
            obj.AddParam("@bulletin", path);
            obj.AddParam("@mast_head", mast_head);



            int exe = obj.ExecuteNonQuery();

            if (exe > 0)
            {
                clear();
                string jv = "<script>alert('Record Added Successfully');</script>";
                ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "alert", jv, false);
            }
        }
        catch { }
    }