Example #1
0
        private void bindClass()
        {
            dataclass      dc = new dataclass();
            SqlConnection  sc = dc.con();
            SqlDataAdapter da = new SqlDataAdapter(" select (CLS_DESC +' '+ SEC_DESC) as Class ,* from View_fillfeecollection order by SEC_ID ", sc);
            DataSet        ds = new DataSet();

            da.Fill(ds);
            DataRow row = ds.Tables[0].NewRow();

            row["Class"]  = "-Select-";
            row["SEC_ID"] = 0;
            ds.Tables[0].Rows.InsertAt(row, 0);

            cmbClass.DataSource    = ds.Tables[0];
            cmbClass.DisplayMember = "Class";
            cmbClass.ValueMember   = "SEC_ID";
            //dataclass dc = new dataclass();
            //SqlConnection sc = dc.con();
            //SqlDataAdapter da = new SqlDataAdapter(" select * from class-t", sc);
            //DataSet ds = new DataSet();
            //da.Fill(ds);
            //DataRow row = ds.Tables[0].NewRow();
            //row["CLS_DESC"] = "Select";
            //row["CLS_ID"] = 0;
            //ds.Tables[0].Rows.InsertAt(row, 0);

            //cmbClass.DataSource = ds.Tables[0];
            //cmbClass.DisplayMember = "CLS_DESC";
            //cmbClass.ValueMember = "CLS_ID";
        }
        public string Edit(dataclass db)
        {
            var obj = DB.myDB.FindIndex(a => a.ID == db.ID);

            DB.myDB[obj] = db;
            Sync();
            return("Edited");
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                dataclass e1 = new dataclass();

                Response.BinaryWrite(e1.HPhoto(Request.QueryString["id"].ToString()));
            }
        }
Example #4
0
        private void GetProductDetails(string sql)
        {
            string           ConnectionString = ConfigurationManager.ConnectionStrings["ConString"].ConnectionString.ToString();
            MySqlConnection  connection       = new MySqlConnection(ConnectionString);
            MySqlDataAdapter adpt             = new MySqlDataAdapter(sql, connection);
            dataclass        dc = new dataclass();
            DataTable        dt = new DataTable();

            dt = dc.GetDataSet("", "");
        }
Example #5
0
        private void LoadGrid()
        {
            dataclass      dc = new dataclass();
            SqlConnection  sc = dc.con();
            SqlDataAdapter da = new SqlDataAdapter("select * from CASTE_T where CASTE_DESC like '" + txtstatename.Text + "%' ORDER BY CASTE_DESC", sc);
            DataSet        ds = new DataSet();

            da.Fill(ds);
            dataGridView1.DataSource = ds.Tables[0];
        }
Example #6
0
        private void LoadGrid()
        {
            dataclass     dc = new dataclass();
            SqlConnection sc = dc.con();


            SqlDataAdapter da = new SqlDataAdapter("select CLS_DESC,CLS_SEQUENCE,CLS_ID from CLASS_T where CLS_DESC like '" + txtClassname.Text + "%' ORDER BY CLS_SEQUENCE", sc);
            DataSet        ds = new DataSet();

            da.Fill(ds);
            dataGridView1.DataSource = ds.Tables[0];
        }
        protected void Button3_Click(object sender, EventArgs e)
        {
            dataclass e1 = new dataclass();

            e1.craft_delete(TextBox1.Text);
            TextBox1.Text   = "";
            TextBox2.Text   = "";
            TextBox3.Text   = "";
            TextBox4.Text   = "";
            Button1.Visible = true;
            Button2.Visible = false;
            Button3.Visible = false;
        }
        protected void Button3_Click(object sender, EventArgs e)
        {
            dataclass e1 = new dataclass();

            e1.item_delete(TextBox1.Text);
            GridView1.DataSource = e1.getitem();
            GridView1.DataBind();
            TextBox1.Text   = "";
            TextBox2.Text   = "";
            Button1.Visible = true;
            Button2.Visible = false;
            Button3.Visible = false;
        }
Example #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            HiddenField1.Value = (string)Session["uname"];
            if (HiddenField1.Value != (string)Session["uname"])
            {
                Response.Redirect("log.aspx");
            }
            dataclass d1 = new dataclass();


            GridView1.DataSource = d1.getreport();
            GridView1.DataBind();
        }
Example #10
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            DateTime       dt11   = Convert.ToDateTime(dateTimePicker1.Value, System.Globalization.CultureInfo.InvariantCulture);
            DateTime       dt12   = Convert.ToDateTime(dateTimePicker2.Value, System.Globalization.CultureInfo.InvariantCulture);
            dataclass      dc     = new dataclass();
            SqlConnection  conn   = dc.con();
            SqlDataAdapter objCmd = new SqlDataAdapter("select * from View_chequebounce where  CBdate  between '" + dt11.ToString("MM/dd/yyyy") + "' and'" + dt12.ToString("MM/dd/yyyy") + "'", conn);
            DataSet        dt     = new DataSet();

            objCmd.Fill(dt);
            if (dt.Tables.Count > 0)
            {
                ExportDataSetToExcel(dt);
            }
        }
Example #11
0
        private void txtsequence_Leave(object sender, EventArgs e)
        {
            btnUpdate.Enabled = true;
            dataclass      dc = new dataclass();
            SqlConnection  sc = dc.con();
            SqlDataAdapter da = new SqlDataAdapter(" select * from Class_T where CLS_SEQUENCE='" + txtsequence.Text + "' ", sc);
            DataTable      dt = new DataTable();

            da.Fill(dt);
            if (dt.Rows.Count > 0)
            {
                MyMessageBox.ShowBox(" This Sequence is Already Exists!!!");
                btnUpdate.Enabled = false;
            }
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            dataclass d1 = new dataclass();
            DataTable d2 = d1.getdate(TextBox1.Text);
            {
                if (d2.Rows.Count > 0)
                {

                    GridView1.DataSource = d1.getdate(TextBox1.Text);
                    GridView1.DataBind();
                }
                else
                    Response.Write("<script>alert('No data found on this date!')</script>");
                TextBox1.Text = "";
            }
        }
Example #13
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         HiddenField1.Value = (string)Session["uname"];
         if (HiddenField1.Value != (string)Session["uname"])
         {
             Response.Redirect("log.aspx");
         }
         dataclass e1 = new dataclass();
         GridView3.DataSource = e1.heliitem();
         GridView3.DataBind(); Button1.Visible = true;
         Button2.Visible = false;
         Button3.Visible = false;
     }
 }
Example #14
0
        private void bindExam()
        {
            dataclass      dc = new dataclass();
            SqlConnection  sc = dc.con();
            SqlDataAdapter da = new SqlDataAdapter(" select * from EXAMINATION_T", sc);
            DataSet        ds = new DataSet();

            da.Fill(ds);
            DataRow row = ds.Tables[0].NewRow();

            row["EXAM_DESC"] = "Select";
            row["EXAM_ID"]   = 0;
            ds.Tables[0].Rows.InsertAt(row, 0);

            cmbExam.DataSource    = ds.Tables[0];
            cmbExam.DisplayMember = "EXAM_DESC";
            cmbExam.ValueMember   = "EXAM_ID";
        }
Example #15
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            dataclass     dd = new dataclass();
            SqlConnection sc = dd.con();

            if (txtclassid.Text == "")
            {
                MyMessageBox.ShowBox("Please Click to Detail Row!!!");
                return;
            }
            if (txtClassname.Text == "")
            {
                MyMessageBox.ShowBox("Class Should not be blank...");
            }
            else
            {
                SqlCommand    com = new SqlCommand("update_Class_T '" + txtclassid.Text + "','" + txtClassname.Text + "','" + txtsequence.Text + "'", sc);
                SqlDataReader dr;
                sc.Open();
                try
                {
                    dr = com.ExecuteReader();
                    if (dr.RecordsAffected > 0)
                    {
                        MyMessageBox.ShowBox("Class Updated...");
                        Cancil_form();
                        LoadGrid();
                    }
                    else
                    {
                        MyMessageBox.ShowBox("This Class Name already exist");
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
                finally
                {
                    sc.Close();
                }
            }
        }
Example #16
0
        private void bindclass()
        {
            dataclass      dc = new dataclass();
            SqlConnection  sc = dc.con();
            SqlDataAdapter da = new SqlDataAdapter(" select SEC_ID, (CLS_DESC + SEC_DESC) as Class  from CLASS_T ct,SECTION_T st where ct.CLS_ID =st.SEC_CLS_ID order by ct.CLS_ID ", sc);
            DataSet        ds = new DataSet();

            da.Fill(ds);
            DataRow row = ds.Tables[0].NewRow();

            row["SEC_ID"] = 0;
            row["Class"]  = "Select";

            ds.Tables[0].Rows.InsertAt(row, 0);

            cmbclass.DataSource    = ds.Tables[0];
            cmbclass.DisplayMember = "Class";
            cmbclass.ValueMember   = "SEC_ID";
        }
Example #17
0
 public object CreateView(dataclass db)
 {
     if (db.ID == null)
     {
         string        ID     = WebConfigurationManager.AppSettings["id"];
         int           conID  = Convert.ToInt32(ID);
         Configuration config = WebConfigurationManager.OpenWebConfiguration("~");
         //System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
         conID++;
         config.AppSettings.Settings["id"].Value = conID.ToString();
         config.Save(ConfigurationSaveMode.Modified);
         ConfigurationManager.RefreshSection("appSettings");
         db.ID = "ITM00" + ID;
         DB.myDB.Add(db);
         Sync();
         return(db);
     }
     return(db);
 }
Example #18
0
        private void btn_create_Click(object sender, EventArgs e)
        {
            DateTime      dt1 = Convert.ToDateTime(DateTime.Now, System.Globalization.CultureInfo.InvariantCulture);
            dataclass     dd  = new dataclass();
            SqlConnection sc  = dd.con();
            string        str = sc.DataSource.ToString();

            if (txtClassname.Text == "")
            {
                MyMessageBox.ShowBox("Class name should not be blank");
                return;
            }
            //SqlCommand com = new SqlCommand("Insert_Class_T '" + txtClassname.Text + "','" + txtsequence.Text + "','" + sms.Form1.GlobalLoginUserName.ToString() + "','" + dt1 + "','" + sc.WorkstationId + "'", sc);
            SqlCommand    com = new SqlCommand("Insert_Class_T '" + txtClassname.Text + "','" + txtsequence.Text + "'", sc);
            SqlDataReader dr;

            sc.Open();
            try
            {
                dr = com.ExecuteReader();
                if (dr.RecordsAffected > 0)
                {
                    MyMessageBox.ShowBox("Class Created...");
                    Cancil_form();
                    LoadGrid();
                }
                else
                {
                    MyMessageBox.ShowBox("This Class and Sequence Name already exist");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                sc.Close();
            }
        }
Example #19
0
        private void btn_delete_Click(object sender, EventArgs e)
        {
            DialogResult dialogResult = MessageBox.Show("Are You Sure Delete Test!!!", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (dialogResult == DialogResult.Yes)
            {
                try
                {
                    dataclass     dc   = new dataclass();
                    SqlConnection conn = dc.con();
                    if (txtclassid.Text == "")
                    {
                        MyMessageBox.ShowBox("Please Click to Detail Row!!!");
                        return;
                    }
                    SqlCommand    objCmd = new SqlCommand("DELETE_CLASS_T " + txtclassid.Text + "", conn);
                    SqlDataReader dr;
                    objCmd.Connection.Open();
                    dr = objCmd.ExecuteReader(CommandBehavior.CloseConnection);
                    if (dr.RecordsAffected > 0)
                    {
                        MyMessageBox.ShowBox(" Class Deleted Successfully!!!");
                        Cancil_form();
                        InitGrid();
                    }
                    else
                    {
                        MyMessageBox.ShowBox(" Class Already Used!!!");
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
            else if (dialogResult == DialogResult.No)
            {
                //do something else
            }
        }
Example #20
0
        private void btn_create_Click(object sender, EventArgs e)

        {
            DateTime      dt1 = Convert.ToDateTime(DateTime.Now, System.Globalization.CultureInfo.InvariantCulture);
            dataclass     dd  = new dataclass();
            SqlConnection sc  = dd.con();
            string        str = sc.DataSource.ToString();

            if (txtstatename.Text == "")
            {
                MyMessageBox.ShowBox("Caste Should not be blank...");
            }
            else
            {
                SqlCommand    com = new SqlCommand("Insert_caste '" + txtstatename.Text + "'", sc);
                SqlDataReader dr;
                sc.Open();
                try
                {
                    dr = com.ExecuteReader();
                    if (dr.RecordsAffected > 0)
                    {
                        MyMessageBox.ShowBox("Caste Created...");
                        Cancil_form();
                        LoadGrid();
                    }
                    else
                    {
                        MyMessageBox.ShowBox("This Caste Name already exist");
                    }
                }
                catch (Exception ex)
                { }
                finally
                {
                    sc.Close();
                }
            }
        }
Example #21
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            dataclass e1 = new dataclass();

            Byte[]         imgByte = null;
            HttpPostedFile File    = FileUpload1.PostedFile;

            if (File.ContentLength > 0)
            {
                imgByte = new Byte[File.ContentLength];
                File.InputStream.Read(imgByte, 0, File.ContentLength);
            }
            e1.heli_insert(TextBox1.Text, TextBox2.Text, TextBox3.Text, imgByte, TextBox4.Text);
            GridView3.DataSource = e1.heliitem();
            GridView3.DataBind();
            TextBox1.Text   = "";
            TextBox2.Text   = "";
            TextBox3.Text   = "";
            TextBox4.Text   = ""; Button1.Visible = true;
            Button2.Visible = false;
            Button3.Visible = false;
        }