コード例 #1
0
        public int AddUpdateDelete()
        {
            try
            {
                clsSqlHelper   objSql   = new clsSqlHelper(clsHelper.DBCONNTYPE.CRUDConnString);
                SqlParameter[] objParam = new SqlParameter[]
                {
                    new SqlParameter("@CompanyBusinessKey", CompanyBusinessKey),
                    new SqlParameter("@CompanyName", CompanyName),
                    new SqlParameter("@CompanyBusinessTitle", CompanyBusinessTitle),
                    new SqlParameter("@CompanyBusinessDescription", CompanyBusinessDescription),
                    new SqlParameter("@CompanyBusinessAddress", CompanyBusinessAddress),
                    new SqlParameter("@CompanyBusinessContact1", CompanyBusinessContact1),
                    new SqlParameter("@CompanyBusinessContact2", CompanyBusinessContact2),
                    new SqlParameter("@CompanyBusinessGstTinNo", CompanyBusinessGstTinNo),
                    new SqlParameter("@CompanyBusinessBankName", CompanyBusinessBankName),
                    new SqlParameter("@CompanyBusinessBankAcctNo", CompanyBusinessBankAcctNo),
                    new SqlParameter("@CompanyBusinessBankIFSCCode", CompanyBusinessBankIFSCCode),
                    new SqlParameter("@CompanyBusinessBankBranch", CompanyBusinessBankBranch),
                    new SqlParameter("@CompanyStateName", CompanyStateName),
                    new SqlParameter("@CompanyStateCode", CompanyStateCode),

                    new SqlParameter("@CompanyID", CompanyID),
                    new SqlParameter("@Action", Mode),
                };
                int result = objSql.ExecuteNonQuery("CompanyBusinessSave", objParam);
                return(result);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #2
0
ファイル: course.cs プロジェクト: satish2111/websitebackend
        private void dataload_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex >= 0 && e.ColumnIndex == dataload.Columns["Edit"].Index)
            {
                btnsave.Text = "Update";

                clsSqlHelper objDB = new clsSqlHelper(ConfigurationManager.ConnectionStrings["CN"].ConnectionString);
                Dictionary <string, object> dic = new Dictionary <string, object>();
                dic.Add("@pkcourseid", dataload.CurrentRow.Cells["ID"].Value.ToString());
                string qu = "SELECT pkcourseid  AS [ID],Course AS [Course],depositamount,active  FROM dbo.course WHERE pkcourseid=@pkcourseid";
                objDB.objExecuteQuery(qu, clsSqlHelper.QueryExcution.ExecuteReader, dic);
                if (objDB.dtrData.HasRows && objDB.dtrData.Read() && !objDB.dtrData.IsDBNull(0))
                {
                    values.Text        = objDB.dtrData.GetInt32(0).ToString();
                    txtcourse.Text     = objDB.dtrData.GetString(1);
                    pkidcourse         = int.Parse(values.Text);
                    txtdepositamt.Text = objDB.dtrData.GetDecimal(2).ToString();
                    bool active = Convert.ToBoolean(objDB.dtrData.GetString(3));
                    if (active)
                    {
                        chkactive.Checked = true;
                    }
                    else
                    {
                        chkactive.Checked = false;
                    }
                }
                firstpanel.Visible = false;
                dataload.Visible   = false;
                thirdpanel.Visible = true;
            }
        }
コード例 #3
0
 protected void ddSemester_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (ddSemester.SelectedIndex != -1)
     {
         txtcomments.Enabled = true;
         btuapply.Enabled    = true;
         btncancel.Enabled   = true;
         chkbook.Visible     = true;
         chkbook.Enabled     = true;
         lblBooks.Visible    = true;
         lblComments.Visible = true;
         txtcomments.Visible = true;
         btuapply.Visible    = true;
         btncancel.Visible   = true;
         clsSqlHelper objDb    = new clsSqlHelper(clsSettings.strsqlcon);
         string       Course1  = ddCourse.SelectedValue.ToString();
         string       Category = ddCategory.SelectedValue.ToString();
         string       semester = ddSemester.SelectedValue.ToString();
         Dictionary <string, object> objParam = new Dictionary <string, object>();
         objParam.Add("@Course1", Course1);
         objParam.Add("@Category", Category);
         objParam.Add("@semester", semester);
         string StrQuery = "SELECT pkidbooks,bookname FROM dbo.books WHERE fkidcategory=" + Category + " AND fkcourseid=" + Course1 + " AND fkidsemester=" + semester + " and ACTIVE='True'";
         if (objDb.objExecuteQuery(StrQuery, HelperLibrary.clsSqlHelper.QueryExcution.ExecuteDataAdapter, objParam))
         {
             chkbook.DataSource = objDb.objDataset.Tables[0];
             chkbook.DataBind();
             for (int i = 0; i < chkbook.Items.Count; i++)
             {
                 chkbook.Items[i].Selected = true;
             }
         }
     }
 }
コード例 #4
0
        protected void btuapply_Click(object sender, EventArgs e)
        {
            clsSqlHelper ObjDb = new clsSqlHelper(clsSettings.strsqlcon);
            Dictionary <string, object> DicParam = new Dictionary <string, object>();
            string Course1  = ddCourse.SelectedValue.ToString();
            string Category = ddCategory.SelectedValue.ToString();
            string semester = ddSemester.SelectedValue.ToString();
            string bookid   = "";
            string id       = Session["id"].ToString();

            //string bookid=
            DicParam.Add("@dk_Client_id", id);
            DicParam.Add("@fk_Course_id", Course1);
            DicParam.Add("@fk_Category_id", Category);
            DicParam.Add("@fk_Semester_Id", semester);
            for (int i = 0; i < chkbook.Items.Count; i++)
            {
                if (chkbook.Items[i].Selected)
                {
                    if (bookid == "")
                    {
                        bookid = chkbook.Items[i].Value.ToString();
                    }
                    else if (bookid != "")
                    {
                        bookid = bookid + ',' + chkbook.Items[i].Value.ToString();
                    }
                }
            }
            DicParam.Add("@fk_Book_id", bookid);
            DicParam.Add("@Comments", txtcomments.Text);
            ObjDb.objExecuteQuery("SpInserttblTransaction", HelperLibrary.clsSqlHelper.QueryExcution.storeProcedure, DicParam);
            Response.Write("<script LANGUAGE='JavaScript' >alert('Thank You For apply Book');window.location='Index.aspx';</script>");
        }
コード例 #5
0
 private void bookidname()
 {
     if (txtsemester.SelectedIndex > 0)
     {
         txtbook.DataSource = null;
         txtsemester.Text   = "";
         clsSqlHelper objDB = new clsSqlHelper(ConfigurationManager.ConnectionStrings["CN"].ConnectionString);
         Dictionary <string, object> dic = new Dictionary <string, object>();
         string qu = "SELECT pkidbooks as [id],bookname as [book] FROM dbo.books WHERE fkcourseid='" + txtcourse.SelectedValue + "' AND fkidcategory='" + txtcategory.SelectedValue + "' AND fkidsemester='" + txtsemester.SelectedValue + "'";
         if (objDB.objExecuteQuery(qu, clsSqlHelper.QueryExcution.ExecuteDataAdapter))
         {
             txtbook.DataSource    = objDB.objDataset.Tables[0];
             txtbook.ValueMember   = "id";
             txtbook.DisplayMember = "book";
         }
         DataRow dr = objDB.objDataset.Tables[0].NewRow();
         dr["id"]   = 0;
         dr["book"] = "-Select Book-";
         objDB.objDataset.Tables[0].Rows.InsertAt(dr, 0);
         txtbook.SelectedIndex = 0;
         txtbook.Focus();
     }
     if (txtsemester.SelectedIndex == 0)
     {
         txtbook.DataSource    = null;
         txtbook.Text          = "";
         datadetail.DataSource = null;
         datadetail.Rows.Clear();
         datadetail.Columns.Clear();
     }
 }
コード例 #6
0
ファイル: login.aspx.cs プロジェクト: NitinHsharma/Sindhu
        public ClsReturnValue basie(string username, string password)
        {
            ClsReturnValue objReturn   = new ClsReturnValue();
            clsSqlHelper   objDBEnging = new clsSqlHelper(clsSettings.strsqlcon);

            try
            {
                string StrQuery = "INSERT dbo.books(fkcourseid,bookname,publishyear,writename,barcode,fkemloyeeid,lastupdate)VALUES (@fkcourseid,@bookname,@publishyear,@writename,@barcode,@fkemloyeeid,@lastupdate)";
                Dictionary <string, object> DicData = new Dictionary <string, object>();
                DicData.Add("@username", username);
                DicData.Add("@password", password);
                objDBEnging.objExecuteQuery(StrQuery, clsSqlHelper.QueryExcution.ExecuteNonQuery, DicData);
                objReturn.blnSuccess  = true;
                objReturn.strResponse = "|Data Saved|";
                return(objReturn);
            }
            catch (Exception ex)
            {
                objReturn.blnSuccess   = false;
                objReturn.strException = "|Error =" + ex.ToString() + "|";
                return(objReturn);
            }
            finally
            {
                objDBEnging.blnCloseConnection();
            }
        }
コード例 #7
0
ファイル: semester.cs プロジェクト: satish2111/websitebackend
        private void dataload_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex >= 0 && e.ColumnIndex == dataload.Columns["Edit"].Index)
            {
                btnsave.Text = "Update";
                clsSqlHelper objDB = new clsSqlHelper(ConfigurationManager.ConnectionStrings["CN"].ConnectionString);
                values.Text      = dataload.CurrentRow.Cells["ID"].Value.ToString();
                txtsemester.Text = dataload.CurrentRow.Cells["Semester"].Value.ToString();
                string SubQuery = "SELECT a.fkcourse AS [idcourse],c.course AS [course],a.fkidcategory AS[idcategory],b.category AS[category],a.active FROM dbo.semester a JOIN dbo.category b ON a.fkidcategory=b.pkidcategory JOIN dbo.course c ON c.pkcourseid=a.fkcourse WHERE a.pkidsemester='" + values.Text + "'";
                if (objDB.objExecuteQuery(SubQuery, clsSqlHelper.QueryExcution.ExecuteDataAdapter))
                {
                    txtcourse.DataSource      = objDB.objDataset.Tables[0];
                    txtcourse.ValueMember     = "idcourse";
                    txtcourse.DisplayMember   = "Course";
                    txtcategory.DataSource    = objDB.objDataset.Tables[0];
                    txtcategory.ValueMember   = "idcategory";
                    txtcategory.DisplayMember = "category";

                    bool active = Convert.ToBoolean(objDB.objDataset.Tables[0].Rows[0][4]);
                    if (active)
                    {
                        chkactive.Checked = true;
                    }
                    else
                    {
                        chkactive.Checked = false;
                    }
                }
                txtcourse.DropDownStyle = ComboBoxStyle.DropDown;
                firstpanel.Visible      = false;
                dataload.Visible        = false;
                thirdpanel.Visible      = true;
            }
        }
コード例 #8
0
        protected void btufirst_Click(object sender, EventArgs e)
        {
            clsSqlHelper ObjBD = new clsSqlHelper(clsSettings.strsqlcon);
            Dictionary <string, object> DicData = new Dictionary <string, object>();

            DicData.Add("@emailid ", txtUserEmail.Text.Trim());
            if (ObjBD.objExecuteQuery("SpEmailIdAlready", HelperLibrary.clsSqlHelper.QueryExcution.storeProcedure, DicData))
            {
                DataTable dt = new DataTable();
                dt = ObjBD.objDataset.Tables[0];
                if (Convert.ToInt32(dt.Rows[0][0]) != -99 && txtPassword.Text == txtConfirmPassword.Text)
                {
                    first.Visible  = false;
                    second.Visible = true;
                    third.Visible  = false;
                }
                else if (Convert.ToInt32(dt.Rows[0][0]) == -99 && txtPassword.Text == txtConfirmPassword.Text)
                {
                    Response.Write("<script>alert('Email ID is Already Exist');</script>");
                    txtUserEmail.Focus();
                    return;
                }
                else if (Convert.ToInt32(dt.Rows[0][0]) != -99 && txtPassword.Text != txtConfirmPassword.Text)
                {
                    Response.Write("<script>alert('The password and its confirm are not the same');</script>");
                    txtPassword.Text        = string.Empty;
                    txtConfirmPassword.Text = string.Empty;
                    txtPassword.Focus();
                    return;
                }
            }
        }
コード例 #9
0
ファイル: login.cs プロジェクト: satish2111/websitebackend
 private void BtnLogin_Click(object sender, EventArgs e)
 {
     if (txtusername.Text.Trim().Length != 0 && txtpassword.Text.Trim().Length != 0)
     {
         clsSqlHelper objDB = new clsSqlHelper(ConfigurationManager.ConnectionStrings["CN"].ConnectionString);
         Dictionary <string, object> dic = new Dictionary <string, object>();
         dic.Add("@username", txtusername.Text);
         dic.Add("@password", txtpassword.Text);
         string qu = "SELECT pkemployeeid,firstname+' '+lastname FROM dbo.signup WHERE username=@username AND password=@password";
         objDB.objExecuteQuery(qu, clsSqlHelper.QueryExcution.ExecuteReader, dic);
         if (objDB.dtrData.HasRows && objDB.dtrData.Read() && !objDB.dtrData.IsDBNull(0))
         {
             int    id   = objDB.dtrData.GetInt32(0);
             string name = objDB.dtrData.GetString(1);
             this.Hide();
             home home = new home();
             home.namef = name;
             home.idf   = id;
             home.Show();
         }
         else
         {
             AutoClosingMessage.AutoClosingMessageBox.Show("Invalid Username or Password", "Error", 3000);
             txtpassword.Clear();
         }
     }
     else
     {
         AutoClosingMessage.AutoClosingMessageBox.Show("Enter Username And Password", "Error", 3000);
         txtpassword.Clear();
     }
 }
コード例 #10
0
ファイル: Login.aspx.cs プロジェクト: NitinHsharma/Sindhu
 public static void isLogin(string Param1, string Param2)
 {
     try
     {
         clsSqlHelper objDBEngine            = new clsSqlHelper(clsSettings.strsqlcon);
         string       strQuery               = "SELECT firstname+''+lastname FROM dbo.signup WHERE usename=@usename AND password=@password";
         Dictionary <string, object> dicData = new Dictionary <string, object>();
         dicData.Add("@usename", Param1);
         dicData.Add("@password", Param2);
         objDBEngine.objExecuteQuery(strQuery, clsSqlHelper.QueryExcution.ExecuteReader, dicData);
         if (objDBEngine.dtrData.HasRows && objDBEngine.dtrData.Read())
         {
             //return objDBEngine.dtrData.GetString(0);
         }
         else
         {
             //return null;
         }
         //objDB.objExecuteQuery(
     }
     catch (Exception)
     {
         throw;
     }
 }
コード例 #11
0
 public int AddUpdateDelete()
 {
     try
     {
         clsSqlHelper   objSql   = new clsSqlHelper(clsHelper.DBCONNTYPE.CRUDConnString);
         SqlParameter[] objParam = new SqlParameter[]
         {
             new SqlParameter("@UserID", UserID),
             new SqlParameter("@UserFirstName", UserFirstName),
             new SqlParameter("@UserLastName", UserLastName),
             new SqlParameter("@UserName", UserName),
             new SqlParameter("@UserPassword", UserPassword),
             new SqlParameter("@UserEmail", UserEmail),
             new SqlParameter("@UserAddress", UserAddress),
             new SqlParameter("@UserStateFKey", UserStateFKey),
             new SqlParameter("@UserCityFKey", UserCityFKey),
             new SqlParameter("@UserAreaFKey", UserAreaFKey),
             new SqlParameter("@UserPhone", UserPhone),
             new SqlParameter("@UserRollFKey", UserRollFKey),
             new SqlParameter("@UserIsActive", UserIsActive),
             new SqlParameter("@Action", Mode),
             new SqlParameter("@CompanyID", CompanyID),
         };
         int result = objSql.ExecuteNonQuery("UserMasterSave", objParam);
         return(result);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #12
0
        public int AddUpdateDelete()
        {
            try
            {
                clsSqlHelper   objSql   = new clsSqlHelper(clsHelper.DBCONNTYPE.CRUDConnString);
                SqlParameter[] objParam = new SqlParameter[]
                {
                    new SqlParameter("@ItemMasterKey", ItemMasterKey),
                    new SqlParameter("@ItemMasterName", ItemMasterName),
                    new SqlParameter("@ItemMasterGroupFKey", ItemMasterGroupFKey),
                    new SqlParameter("@ItemMasterRate", ItemMasterRate),
                    new SqlParameter("@ItemMasterDescription", ItemMasterDescription),
                    new SqlParameter("@ItemMasterStock", ItemMasterStock),
                    new SqlParameter("@ItemMasterImage", ItemMasterImage),
                    new SqlParameter("@ItemWeight", ItemWeight),
                    new SqlParameter("@ItemMasterHsnCode", ItemMasterHsnCode),


                    new SqlParameter("@CompanyID", CompanyID),
                    new SqlParameter("@UserID", UserID),
                    new SqlParameter("@Action", Mode)
                };
                int result = Convert.ToInt32(objSql.ExecuteScalar("ItemMasterSave", objParam));
                return(result);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #13
0
        private void dataloadforapply()
        {
            Dvgbooks.DataSource = null;
            Dvgbooks.Columns.Clear();
            Dvgbooks.Rows.Clear();
            Dictionary <string, object> dic = new Dictionary <string, object>();
            clsSqlHelper objDB = new clsSqlHelper(ConfigurationManager.ConnectionStrings["CN"].ConnectionString);

            dic.Add("@bookname", txtbook.Text);
            if (objDB.objExecuteQuery("Sp_admin_book_apply", clsSqlHelper.QueryExcution.storeProcedure, dic))
            {
                DataTable dt = new DataTable();
                dt = objDB.objDataset.Tables[0];
                Dvgbooks.DataSource = dt;
            }
            Dvgbooks.Columns["Book Id"].Visible = false;
            Dvgbooks.Columns["Barcode"].Visible = false;
            Dvgbooks.Columns["Qty"].Width       = 40;
            DataGridViewCheckBoxColumn dgvCmb = new DataGridViewCheckBoxColumn();

            dgvCmb.ValueType  = typeof(bool);
            dgvCmb.Name       = "Chk";
            dgvCmb.HeaderText = "Approved";
            Dvgbooks.Columns.Add(dgvCmb);
            DataGridViewColumn column364 = dataload.Columns["Chk"];

            Dvgbooks.Columns["Semester"].Width       = 80;
            Dvgbooks.Columns["Chk"].Width            = 60;
            Dvgbooks.Columns["Write Name"].Visible   = false;
            Dvgbooks.Columns["Publish Year"].Visible = false;
        }
コード例 #14
0
        private void dataload_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            Dictionary <string, object> dic = new Dictionary <string, object>();
            clsSqlHelper objDB = new clsSqlHelper(ConfigurationManager.ConnectionStrings["CN"].ConnectionString);

            if (e.RowIndex >= 0 && dataload.Columns.Contains("Booksview") && e.ColumnIndex == dataload.Columns["Booksview"].Index)
            {
                Book_ID = dataload.CurrentRow.Cells["Tran_ID"].Value.ToString();
                dic.Add("@fk_Req_Id", Book_ID);
                Bookapply(dic, objDB);
            }

            else if (e.RowIndex >= 0 && dataload.Columns.Contains("Details") && e.ColumnIndex == dataload.Columns["Details"].Index)
            {
                btnhidesearch.Visible = false;
                detail(int.Parse(dataload.CurrentRow.Cells["Client_ID"].Value.ToString()));
                firstpanel.Visible  = false;
                dataload.Visible    = false;
                secondpanel.Visible = false;
                thirdpanel.Visible  = true;
            }
            else if (e.RowIndex >= 0 && dataload.Columns.Contains("picture") && e.ColumnIndex == dataload.Columns["picture"].Index)
            {
                bookdetail.Enabled = false;
                int     values = int.Parse(dataload.CurrentRow.Cells["Client_ID"].Value.ToString());
                picture o      = new picture(values);
                o.Show();
            }
        }
コード例 #15
0
        public DataSet SearchJobMasterItemJobPaymentReport()
        {
            try
            {
                clsSqlHelper   objSql    = new clsSqlHelper(clsHelper.DBCONNTYPE.GetConnString);
                SqlParameter[] objParams = new SqlParameter[]
                {
                    new SqlParameter("@JobMasterJobPersionFKey", JobMasterJobPersionFKey),
                    new SqlParameter("@JobMasterJobPersionFKeyAddress", JobMasterJobPersionFKeyAddress),
                    new SqlParameter("@FromDate", FromDate),
                    new SqlParameter("@ToDate", ToDate),
                    new SqlParameter("@JobMasterType", JobMasterType),

                    new SqlParameter("@UserID", UserID),
                    new SqlParameter("@CompanyID", CompanyID),
                    new SqlParameter("@Action", Mode)
                };
                DataSet ds = objSql.ExecuteDataSet("JobMasterItemJobPaymentReport", objParams);
                return(ds);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #16
0
        protected void Login_Click(object sender, EventArgs e)
        {
            clsSqlHelper objBD = new clsSqlHelper(clsSettings.strsqlcon);

            try
            {
                string StrQuery = "SELECT firstname+' '+lastname,pkclient FROM dbo.client WHERE username=@username AND password=@password";
                Dictionary <string, object> DicData = new Dictionary <string, object>();
                DicData.Add("@username", txtusername.Text);
                DicData.Add("@password", txtpassword.Text);
                objBD.objExecuteQuery(StrQuery, HelperLibrary.clsSqlHelper.QueryExcution.ExecuteReader, DicData);
                if (objBD.dtrData.HasRows && objBD.dtrData.Read() && !objBD.dtrData.IsDBNull(0))
                {
                    Session["name"] = objBD.dtrData.GetString(0);
                    Session["id"]   = objBD.dtrData.GetInt32(1);
                    Response.Redirect("Index.aspx", false);
                }
                else
                {
                    Response.Write("<script>alert('Invalid Username or Password');</script>");
                }
            }
            catch (Exception ex)
            {
                string j = ex.ToString();
            }
            finally
            {
                objBD.blnCloseConnection();
            }
        }
コード例 #17
0
        protected void inputsubmit_Click(object sender, EventArgs e)
        {
            ClsReturnValue objReturn   = new ClsReturnValue();
            clsSqlHelper   objDBEnging = new clsSqlHelper(clsSettings.strsqlcon);

            try
            {
                string StrQuery = "";
                Dictionary <string, object> DicData = new Dictionary <string, object>();
                DicData.Add("@firstname", inputName.Text);
                DicData.Add("@moblie", inputnumber);
                DicData.Add("@emailid", emailid);
                DicData.Add("@username", username);
                DicData.Add("@password", input);
                objDBEnging.objExecuteQuery(StrQuery, clsSqlHelper.QueryExcution.ExecuteNonQuery, DicData);
                objReturn.blnSuccess  = true;
                objReturn.strResponse = "|Data Saved|";
                return(objReturn);
            }
            catch (Exception ex)
            {
                objReturn.blnSuccess   = false;
                objReturn.strException = "|Error =" + ex.ToString() + "|";
                return(objReturn);
            }
            finally
            {
                objDBEnging.blnCloseConnection();
            }
        }
コード例 #18
0
        public void datagridload()
        {
            dataload.DataSource = null;
            dataload.Rows.Clear();
            dataload.Columns.Clear();
            clsSqlHelper objDB = new clsSqlHelper(ConfigurationManager.ConnectionStrings["CN"].ConnectionString);

            if (objDB.objExecuteQuery("Sp_admin_currentstock", clsSqlHelper.QueryExcution.storeProcedure))
            {
                DataTable dt = new DataTable();
                dt = objDB.objDataset.Tables[0];
                dataload.DataSource = dt;
            }
            dataload.ReadOnly            = true;
            dataload.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
            dataload.AlternatingRowsDefaultCellStyle.BackColor = Color.LightYellow;
            dataload.ClearSelection();
            //

            dataload.Columns["Srno"].DisplayIndex     = 0;
            dataload.Columns["Course"].DisplayIndex   = 1;
            dataload.Columns["Category"].DisplayIndex = 2;
            dataload.Columns["Semester"].DisplayIndex = 3;
            dataload.Columns["Books"].DisplayIndex    = 4;
            dataload.Columns["Qty"].DisplayIndex      = 5;
            dataload.Columns["status"].DisplayIndex   = 6;
        }
コード例 #19
0
ファイル: student.cs プロジェクト: satish2111/websitebackend
        public void datagridload()
        {
            dataload.DataSource = null;
            dataload.Rows.Clear();
            dataload.Columns.Clear();
            string       type;
            clsSqlHelper objDB = new clsSqlHelper(ConfigurationManager.ConnectionStrings["CN"].ConnectionString);
            Dictionary <string, object> dic = new Dictionary <string, object>();

            if (secondpanel.Visible == false)
            {
                txtfromdate.Value = DateTime.Now;
                txttodate.Value   = DateTime.Now.AddDays(+1);
                type = "SELECTALL";
                dic.Add("@stardate", Convert.ToDateTime(txtfromdate.Value).ToString("yyyy-MM-dd"));
                dic.Add("@enddate", Convert.ToDateTime(txttodate.Value).ToString("yyyy-MM-dd"));
                dic.Add("@StatementType", type);
            }
            else
            {
                if (txtsearch.Text.Trim().Length == 0 && txtsearchlastname.Text.Trim().Length == 0)
                {
                    type = "SELECTALL";
                    dic.Add("@stardate", Convert.ToDateTime(txtfromdate.Value).ToString("yyyy-MM-dd"));
                    dic.Add("@enddate", Convert.ToDateTime(txttodate.Value).ToString("yyyy-MM-dd"));
                    dic.Add("@StatementType", type);
                }
                else if (txtsearch.Text.Trim().Length != 0 || txtsearchlastname.Text.Trim().Length != 0)
                {
                    type = "SELECTONE";
                    dic.Add("@firstname", txtsearch.Text);
                    dic.Add("@lastname", txtsearchlastname.Text);
                    dic.Add("@StatementType", type);
                }
            }
            if (objDB.objExecuteQuery("Sp_admin_client_view", clsSqlHelper.QueryExcution.storeProcedure, dic))
            {
                DataTable dt = new DataTable();
                dt = objDB.objDataset.Tables[0];
                dataload.DataSource = dt;
            }
            dataload.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
            dataload.AlternatingRowsDefaultCellStyle.BackColor = Color.LightYellow;
            dataload.ClearSelection();

            var col5 = new DataGridViewButtonColumn();

            col5.HeaderText = "Edit";
            col5.Name       = "Edit";
            col5.Text       = "Edit";
            col5.UseColumnTextForButtonValue = true;
            dataload.Columns.AddRange(new DataGridViewColumn[] { col5 });

            //var col6 = new DataGridViewButtonColumn();
            //col6.HeaderText = "PDF";
            //col6.Name = "PDF";
            //col6.Text = "PDF";
            //col6.UseColumnTextForButtonValue = true;
            //dataload.Columns.AddRange(new DataGridViewColumn[] { col6 });
        }
コード例 #20
0
        private void searchcourseidname()
        {
            txtsearchcourse.DataSource = null;
            clsSqlHelper objDB = new clsSqlHelper(ConfigurationManager.ConnectionStrings["CN"].ConnectionString);
            Dictionary <string, object> dic = new Dictionary <string, object>();
            string qu = "SELECT pkcourseid  AS [ID],Course AS [Course]  FROM dbo.course";

            if (objDB.objExecuteQuery(qu, clsSqlHelper.QueryExcution.ExecuteDataAdapter))
            {
                txtsearchcourse.DataSource    = objDB.objDataset.Tables[0];
                txtsearchcourse.ValueMember   = "ID";
                txtsearchcourse.DisplayMember = "Course";
            }
            DataRow dr = objDB.objDataset.Tables[0].NewRow();

            dr["ID"]     = 0;
            dr["Course"] = "-Select Course-";
            objDB.objDataset.Tables[0].Rows.InsertAt(dr, 0);
            txtsearchcourse.SelectedIndex = 0;
            if (txtsearchcourse.SelectedIndex == 0)
            {
                txtsearchcategory.DataSource = null;
                txtsearchcategory.Text       = "";
                txtsearchsemester.DataSource = null;
                txtsearchsemester.Text       = "";
                txtsearchbook.DataSource     = null;
                txtsearchbook.Text           = "";
            }
        }
コード例 #21
0
ファイル: category.cs プロジェクト: satish2111/websitebackend
 private void dataload_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex >= 0 && e.ColumnIndex == dataload.Columns["Edit"].Index)
     {
         btnsave.Text = "Update";
         clsSqlHelper objDB = new clsSqlHelper(ConfigurationManager.ConnectionStrings["CN"].ConnectionString);
         values.Text      = dataload.CurrentRow.Cells["ID"].Value.ToString();
         txtcategory.Text = dataload.CurrentRow.Cells["Category"].Value.ToString();
         pkidcategory     = int.Parse(values.Text);
         string qu = "SELECT b.course AS [Coures],b.pkcourseid,a.active  FROM dbo.category a JOIN dbo.course b ON a.fkcourseid=b.pkcourseid WHERE a.pkidcategory=" + pkidcategory + "";
         if (objDB.objExecuteQuery(qu, clsSqlHelper.QueryExcution.ExecuteDataAdapter))
         {
             txtcourse.DataSource    = objDB.objDataset.Tables[0];
             txtcourse.DisplayMember = "Coures";
             txtcourse.ValueMember   = "pkcourseid";
             bool active = Convert.ToBoolean(objDB.objDataset.Tables[0].Rows[0][2]);
             if (active)
             {
                 chkactive.Checked = true;
             }
             else
             {
                 chkactive.Checked = false;
             }
         }
         firstpanel.Visible = false;
         dataload.Visible   = false;
         thirdpanel.Visible = true;
     }
 }
コード例 #22
0
        private void dataload_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex >= 0 && e.ColumnIndex == dataload.Columns["Edit"].Index)
            {
                btnsave.Text = "Update";
            }
            //else if (e.RowIndex >= 0 && e.ColumnIndex == dataload.Columns["Delete"].Index)
            //{
            //    btnsave.Text = "Delete";
            //}

            clsSqlHelper objDB = new clsSqlHelper(ConfigurationManager.ConnectionStrings["CN"].ConnectionString);
            Dictionary <string, object> dic = new Dictionary <string, object>();

            dic.Add("@username", dataload.CurrentRow.Cells["USERNAME"].Value.ToString());
            string qu = "SELECT  pkemployeeid,firstname ,middlename ,lastname ,username ,password FROM dbo.signup WHERE username=@username";

            objDB.objExecuteQuery(qu, clsSqlHelper.QueryExcution.ExecuteReader, dic);
            if (objDB.dtrData.HasRows && objDB.dtrData.Read() && !objDB.dtrData.IsDBNull(0))
            {
                values.Text        = objDB.dtrData.GetInt32(0).ToString();
                txtfirstname.Text  = objDB.dtrData.GetString(1);
                txtmiddlename.Text = objDB.dtrData.GetString(2);
                txtlastname.Text   = objDB.dtrData.GetString(3);
                txtusername.Text   = objDB.dtrData.GetString(4);
                txtpassword.Text   = objDB.dtrData.GetString(5);
            }
            firstpanel.Visible = false;
            dataload.Visible   = false;
            thirdpanel.Visible = true;
        }
コード例 #23
0
        public void name()
        {
            clsSqlHelper objDB = new clsSqlHelper(ConfigurationManager.ConnectionStrings["CN"].ConnectionString);
            Dictionary <string, object> dic = new Dictionary <string, object>();
            string strQuery = "";

            if (clientid != 0)
            {
                strQuery = "SELECT pkclient AS [Id],(firstname+' '+middlename+' '+lastname)AS NAME FROM dbo.client WHERE pkclient='" + clientid + "'";
            }
            else
            {
                strQuery = "SELECT pkclient AS [Id],(firstname+' '+middlename+' '+lastname)AS NAME FROM dbo.client";
            }
            if (objDB.objExecuteQuery(strQuery, clsSqlHelper.QueryExcution.ExecuteDataAdapter))
            {
                txtname.DataSource    = objDB.objDataset.Tables[0];
                txtname.ValueMember   = "ID";
                txtname.DisplayMember = "NAME";
            }
            if (clientid == 0)
            {
                DataRow dr = objDB.objDataset.Tables[0].NewRow();
                dr["ID"]   = 0;
                dr["NAME"] = "-Select Course-";
                objDB.objDataset.Tables[0].Rows.InsertAt(dr, 0);
                txtname.SelectedIndex = 0;
            }
            else
            {
                txtname.SelectedIndex = 0;
            }
        }
コード例 #24
0
ファイル: books.cs プロジェクト: satish2111/websitebackend
 private void semesteridname()
 {
     if (txtcategory.SelectedIndex > 0)
     {
         txtsemester.DataSource = null;
         txtsemester.Text       = "";
         clsSqlHelper objDB = new clsSqlHelper(ConfigurationManager.ConnectionStrings["CN"].ConnectionString);
         Dictionary <string, object> dic = new Dictionary <string, object>();
         string qu = "SELECT pkidsemester as id,semester FROM dbo.semester WHERE fkcourse='" + txtcourse.SelectedValue + "' AND fkidcategory='" + txtcategory.SelectedValue + "'";
         if (objDB.objExecuteQuery(qu, clsSqlHelper.QueryExcution.ExecuteDataAdapter))
         {
             txtsemester.DataSource    = objDB.objDataset.Tables[0];
             txtsemester.ValueMember   = "id";
             txtsemester.DisplayMember = "semester";
         }
         DataRow dr = objDB.objDataset.Tables[0].NewRow();
         dr["id"]       = 0;
         dr["semester"] = "-Select Semester-";
         objDB.objDataset.Tables[0].Rows.InsertAt(dr, 0);
         txtsemester.SelectedIndex = 0;
         txtsemester.Focus();
     }
     else if (txtcategory.SelectedIndex == 0)
     {
         txtsemester.DataSource = null;
         txtsemester.Text       = "";
         txtbooks.Text          = "";
     }
 }
コード例 #25
0
        public int AddUpdateDelete()
        {
            try
            {
                clsSqlHelper   objSql   = new clsSqlHelper(clsHelper.DBCONNTYPE.CRUDConnString);
                SqlParameter[] objParam = new SqlParameter[]
                {
                    new SqlParameter("@CategoryMasterCatKey", CategoryMasterCatKey),
                    new SqlParameter("@CategoryMasterCatName", CategoryMasterCatName),
                    new SqlParameter("@CategoryMasterCatVal", CategoryMasterCatVal),
                    new SqlParameter("@CategoryMasterCatIsActive", CategoryMasterCatIsActive),
                    new SqlParameter("@CategoryMasterHsnCode", CategoryMasterHsnCode),


                    new SqlParameter("@CompanyID", CompanyID),
                    new SqlParameter("@UserID", UserID),
                    new SqlParameter("@Action", Mode)
                };

                int result = objSql.ExecuteNonQuery("CategoryMasterSave", objParam);
                return(result);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #26
0
ファイル: books.cs プロジェクト: satish2111/websitebackend
        private void btnadd_Click(object sender, EventArgs e)
        {
            firstpanel.Visible  = false;
            secondpanel.Visible = false;
            thirdpanel.Visible  = true;
            dataload.Visible    = false;
            btnsave.Text        = "Save";
            clsSqlHelper objDB = new clsSqlHelper(ConfigurationManager.ConnectionStrings["CN"].ConnectionString);
            Dictionary <string, object> dic = new Dictionary <string, object>();
            string StrQuery = "SELECT MAX(pkidbooks) FROM dbo.books";

            objDB.objExecuteQuery(StrQuery, clsSqlHelper.QueryExcution.ExecuteReader, dic);
            if (objDB.dtrData.HasRows && objDB.dtrData.Read() && !objDB.dtrData.IsDBNull(0))
            {
                values.Text = (objDB.dtrData.GetInt32(0) + 1).ToString();
            }
            else
            {
                values.Text = "1";
            }
            txtcourse.DataSource   = null;
            txtcourse.Text         = "";
            txtcategory.DataSource = null;
            txtcategory.Text       = "";
            txtsemester.DataSource = null;
            txtsemester.Text       = "";
            courseidname();
            txtcourse.Enabled   = true;
            txtcategory.Enabled = true;
            txtsemester.Enabled = true;
            btnsave.Enabled     = true;
            chkactive.Checked   = true;
            number = 1;
        }
コード例 #27
0
ファイル: books.cs プロジェクト: satish2111/websitebackend
        private void data()
        {
            clsSqlHelper objDB = new clsSqlHelper(ConfigurationManager.ConnectionStrings["CN"].ConnectionString);
            Dictionary <string, object> dic = new Dictionary <string, object>();
            string idsem = "";
            string sub   = "SELECT fkidsemester FROM dbo.books WHERE pkidbooks=@pkidbooks";

            dic.Add("@pkidbooks", dataload.CurrentRow.Cells["Book ID"].Value.ToString());
            objDB.objExecuteQuery(sub, clsSqlHelper.QueryExcution.ExecuteReader, dic);
            if (objDB.dtrData.HasRows && objDB.dtrData.Read() && !objDB.dtrData.IsDBNull(0))
            {
                idsem = objDB.dtrData.GetInt32(0).ToString();
            }
            string SubQuery = "SELECT a.pkidsemester AS [semester_Id],a.semester as [Semester],a.fkcourse AS [course_ID], b.course AS[Course],a.fkidcategory AS [Category_ID] ,c.category AS[Category] FROM dbo.semester a JOIN dbo.course b ON a.fkcourse=b.pkcourseid JOIN dbo.category c ON a.fkidcategory=c.pkidcategory WHERE a.pkidsemester='" + idsem + "'";

            if (objDB.objExecuteQuery(SubQuery, clsSqlHelper.QueryExcution.ExecuteDataAdapter))
            {
                txtcourse.DataSource      = objDB.objDataset.Tables[0];
                txtcourse.ValueMember     = "course_ID";
                txtcourse.DisplayMember   = "Course";
                txtcategory.DataSource    = objDB.objDataset.Tables[0];
                txtcategory.ValueMember   = "Category_ID";
                txtcategory.DisplayMember = "Category";
                txtsemester.DataSource    = objDB.objDataset.Tables[0];
                txtsemester.DisplayMember = "Semester";
                txtsemester.ValueMember   = "semester_Id";
            }
        }
コード例 #28
0
        public int AddUpdateDelete()
        {
            try
            {
                clsSqlHelper   objSql   = new clsSqlHelper(clsHelper.DBCONNTYPE.CRUDConnString);
                SqlParameter[] objParam = new SqlParameter[]
                {
                    new SqlParameter("@CustomerID", CustomerID),
                    new SqlParameter("@CustomerName", CustomerName),
                    new SqlParameter("@CustomerAddress", CustomerAddress),
                    new SqlParameter("@CustomerStateFKey", CustomerStateFKey),
                    new SqlParameter("@CustomerCityFKey", CustomerCityFKey),
                    new SqlParameter("@CustomerAreaFKey", CustomerAreaFKey),
                    new SqlParameter("@CustomerContactNo", CustomerContactNo),
                    new SqlParameter("@CustomerEmail", CustomerEmail),
                    new SqlParameter("@CustomerGSTNo", CustomerGSTNo),
                    new SqlParameter("@CustomerCSTNo", CustomerCSTNo),
                    new SqlParameter("@CustomerIsActive", CustomerIsActive),
                    new SqlParameter("@CustomerGSTDate", CustomerGSTDate),
                    new SqlParameter("@CustomerCSTDate", CustomerCSTDate),
                    new SqlParameter("@CustomerContactPerson", CustomerContactPerson),
                    new SqlParameter("@CustomerPanNo", CustomerPanNo),

                    new SqlParameter("@UserID", UserID),
                    new SqlParameter("@CompanyID", CompanyID),
                    new SqlParameter("@Action", Mode)
                };
                int result = objSql.ExecuteNonQuery("CustomerMasterSave", objParam);
                return(result);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #29
0
        public List <clsCustomerMasterMember> GetCustomer()
        {
            List <clsCustomerMasterMember> objList = new List <clsCustomerMasterMember>();

            try
            {
                clsSqlHelper   objSql    = new clsSqlHelper(clsHelper.DBCONNTYPE.GetConnString);
                SqlParameter[] objParams = new SqlParameter[]
                {
                    new SqlParameter("@CustomerID", CustomerID),

                    new SqlParameter("@UserID", UserID),
                    new SqlParameter("@CompanyID", CompanyID),
                    new SqlParameter("@Action", Mode)
                };

                DataSet ds = objSql.ExecuteDataSet("CustomerMasterGet", objParams);

                if (ds != null)
                {
                    clsCustomerMasterMember objCustomer = new clsCustomerMasterMember();

                    #region Customer
                    if (ds.Tables.Count > 0)
                    {
                        foreach (DataRow r in ds.Tables[1].Rows)
                        {
                            objCustomer.CustomerID        = Convert.ToInt32(r["CustomerID"] ?? -1);
                            objCustomer.CustomerName      = (r["CustomerName"] ?? "").ToString();
                            objCustomer.CustomerAddress   = (r["CustomerAddress"] ?? "").ToString();
                            objCustomer.CustomerStateFKey = Convert.ToInt32(r["CustomerStateFKey"] ?? -1);
                            objCustomer.CustomerCityFKey  = Convert.ToInt32(r["CustomerCityFKey"] ?? -1);
                            objCustomer.CustomerAreaFKey  = Convert.ToInt32(r["CustomerAreaFKey"] ?? -1);
                            objCustomer.CustomerContactNo = (r["CustomerContactNo"] ?? "").ToString();
                            objCustomer.CustomerEmail     = (r["CustomerEmail"] ?? "").ToString();
                            objCustomer.CustomerGSTNo     = (r["CustomerGSTNo"] ?? "").ToString();
                            objCustomer.CustomerCSTNo     = (r["CustomerCSTNo"] ?? "").ToString();
                            objCustomer.CustomerIsActive  = Convert.ToInt32(r["CustomerActive"] ?? 0);
                            objCustomer.CompanyID         = Convert.ToInt32(r["CompanyID"] ?? 0);
                            objCustomer.CustomerGSTDate   = (r["CustomerGSTDate"] ?? "").ToString();
                            objCustomer.CustomerCSTDate   = (r["CustomerCSTDate"] ?? "").ToString();
                            objCustomer.CustomerDetai     = (r["CustomerDetai"] ?? "").ToString();
                            objCustomer.CustomerPanNo     = (r["CustomerPanNo"] ?? "").ToString();
                            objList.Add(objCustomer);
                        }
                    }

                    #endregion
                }

                return(objList);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #30
0
ファイル: books.cs プロジェクト: satish2111/websitebackend
 private void btnsave_Click(object sender, EventArgs e)
 {
     if (txtcourse.Text.Trim().Length != 0 && txtcategory.Text.Trim().Length != 0 && txtsemester.Text.Trim().Length != 0 && txtbooks.Text.Trim().Length != 0 && txtpublishyear.Text.Trim().Length != 0 && txtwritename.Text.Trim().Length != 0)
     {
         barcodemake();
         clsSqlHelper objDB = new clsSqlHelper(ConfigurationManager.ConnectionStrings["CN"].ConnectionString);
         Dictionary <string, object> dic = new Dictionary <string, object>();
         dic.Add("@fkcourseid", txtcourse.SelectedValue);
         dic.Add("@bookname", txtbooks.Text);
         dic.Add("@publishyear", txtpublishyear.Text);
         dic.Add("@writename", txtwritename.Text);
         dic.Add("@barcode", barcode);
         dic.Add("@fkemployeeid", fkemployeeid);
         dic.Add("@fkidcategory", txtcategory.SelectedValue);
         dic.Add("@fkidsemester", txtsemester.SelectedValue);
         bool active = chkactive.Checked;
         if (active == true)
         {
             dic.Add("@isactive", "True");
         }
         else
         {
             dic.Add("@isactive", "False");
         }
         if (btnsave.Text == "Save")
         {
             dic.Add("@StatementType", "insert");
         }
         else if (btnsave.Text == "Update")
         {
             dic.Add("@StatementType", "update");
             dic.Add("@pkidbooks", pkidbook);
         }
         if (objDB.objExecuteQuery("Sp_admin_book_insert_update", clsSqlHelper.QueryExcution.storeProcedure, dic))
         {
             DataTable dt = new DataTable();
             dt = objDB.objDataset.Tables[0];
             if (Convert.ToInt32(dt.Rows[0][0]) == 0)
             {
                 AutoClosingMessage.AutoClosingMessageBox.Show("Data Saved", "Message", 3000);
             }
             else
             {
                 AutoClosingMessage.AutoClosingMessageBox.Show("Data Already Saved " + Environment.NewLine + " Book ID:-" + dt.Rows[0][0].ToString() + "", "Message", 5000);
             }
             datagridload();
             ClearTextBoxes(this);
             savecancel();
         }
     }
     else
     {
         AutoClosingMessage.AutoClosingMessageBox.Show("Please Fill All Detail", "Message", 3000);
         return;
     }
 }