Example #1
0
        public DataSet GetBook_BL(EWA_AddBook objEWA)
        {
            DL_AddBook objDL = new DL_AddBook();
            DataSet    ds    = objDL.GetBook_DL(objEWA);

            return(ds);
        }
Example #2
0
        public int CheckBookName_DL(EWA_AddBook objEWA)
        {
            DataSet ds  = new DataSet();
            int     cnt = 0;

            try
            {
                prmList    = new string[6];
                prmList[0] = "@Action";
                prmList[1] = "CheckBookName";
                prmList[2] = "@BookName";
                prmList[3] = objEWA.BookName.ToString();
                prmList[4] = "@OrgId";
                prmList[5] = objEWA.OrgId.ToString();

                ds = ObjHelper.FillControl(prmList, "SP_LibAddBook");
                if (ds.Tables[0].Rows.Count > 0)
                {
                    cnt = Convert.ToInt32(ds.Tables[0].Rows[0][0].ToString());
                }
            }
            catch (Exception ex)
            {
            }
            return(cnt);
        }
Example #3
0
        public int BookAction_DL(EWA_AddBook objEWA)
        {
            int flag = 0;

            try
            {
                cmd             = new SqlCommand("SP_LibAddBook", con);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@Action", objEWA.Action);
                cmd.Parameters.AddWithValue("@BookId", objEWA.BookId);
                cmd.Parameters.AddWithValue("@BookName", objEWA.BookName);
                cmd.Parameters.AddWithValue("@GroupId", objEWA.GroupId);
                cmd.Parameters.AddWithValue("@Publisher", objEWA.Publisher);
                cmd.Parameters.AddWithValue("@Author", objEWA.Author);
                cmd.Parameters.AddWithValue("@PublishingYear", objEWA.PublishingYear);
                cmd.Parameters.AddWithValue("@Edition", objEWA.Edition);
                cmd.Parameters.AddWithValue("@Price", objEWA.Price);
                cmd.Parameters.AddWithValue("@OrgId", objEWA.OrgId);
                cmd.Parameters.AddWithValue("@UserId", objEWA.UserId);
                cmd.Parameters.AddWithValue("@barcode", objEWA.barcode);
                cmd.Parameters.AddWithValue("@IsActive", objEWA.IsActive);
                cmd.Parameters.AddWithValue("@qty", objEWA.qty);
                con.Open();
                flag = cmd.ExecuteNonQuery();
                con.Close();
            }
            catch (Exception)
            {
            }
            return(flag);
        }
Example #4
0
        private void BindGrid()
        {
            BL_AddBook  objBL  = new BL_AddBook();
            EWA_AddBook objEWA = new EWA_AddBook();

            objEWA.OrgId = Convert.ToInt32(Session["OrgId"]);

            DataSet ds = objBL.GetBook_BL(objEWA);

            if (ds.Tables[0].Rows.Count > 0)
            {
                GridView1.DataSource = ds;
                GridView1.DataBind();
            }
            else
            {
                Response.Write("<script>alert('Record Not Found...!')</script>");
            }
        }
Example #5
0
        public DataSet GetBook_DL(EWA_AddBook objEWA)
        {
            DataSet ds = new DataSet();

            try
            {
                prmList    = new string[4];
                prmList[0] = "@Action";
                prmList[1] = "GetData";
                prmList[2] = "OrgId";
                prmList[3] = objEWA.OrgId.ToString();

                ds = ObjHelper.FillControl(prmList, "SP_LibAddBook");
                if (ds.Tables[0].Rows.Count <= 0)
                {
                    DataTable dt = new DataTable();
                    dt.Columns.Add("BookId");
                    dt.Columns.Add("BookCode");
                    dt.Columns.Add("BookName");
                    dt.Columns.Add("GroupId");
                    dt.Columns.Add("GroupName");
                    dt.Columns.Add("Publisher");
                    //dt.Columns.Add("barcode");
                    dt.Columns.Add("Author");
                    dt.Columns.Add("PublishingYear");
                    dt.Columns.Add("Edition");
                    dt.Columns.Add("Price");
                    dt.Columns.Add("qty");
                    //dt.Rows.Add();
                    //dt.Rows.Add();
                    //dt.Rows.Add();
                    //ds.Tables.RemoveAt(0);
                    //ds.Tables.Add(dt);
                }
            }
            catch (Exception ex)
            {
            }
            return(ds);
        }
Example #6
0
        public int CheckBookName_BL(EWA_AddBook objEWA)
        {
            int cnt = objDL.CheckBookName_DL(objEWA);

            return(cnt);
        }
Example #7
0
        public int BookAction_BL(EWA_AddBook objEWA)
        {
            int flag = objDL.BookAction_DL(objEWA);

            return(flag);
        }
        private void Action(string strAction)
        {
            try
            {
                objEWA                = new EWA_AddBook();
                objEWA.Action         = strAction;
                objEWA.BookId         = Convert.ToInt32(ViewState["BookId"].ToString());
                objEWA.BookName       = txtBookName.Text.ToString();
                objEWA.BookCode       = Convert.ToString(ViewState["BookCode"]).ToString();
                objEWA.GroupId        = Convert.ToInt32(ddlGroupName.SelectedValue.ToString());
                objEWA.Author         = txtAuthor.Text.ToString();
                objEWA.Publisher      = txtPublisher.Text.ToString();
                objEWA.barcode        = txtBarcode.Text;
                objEWA.PublishingYear = txtPublishYear.Text.ToString();
                objEWA.Edition        = txtEdition.Text.ToString();
                objEWA.Price          = Convert.ToDouble(txtPrice.Text.ToString());
                objEWA.OrgId          = orgId;
                objEWA.UserId         = Convert.ToInt32(Session["UserCode"].ToString());
                objEWA.IsActive       = "true";
                objEWA.qty            = Convert.ToInt32(txtquntity.Text);

                if (strAction == "Save" || strAction == "Update")
                {
                    if (CheckBookName(objEWA) > 0)
                    {
                        msgBox.ShowMessage("Record Already Exist !!!", "Information", UserControls.MessageBox.MessageStyle.Information);
                        return;
                    }
                }
                int flag = objBL.BookAction_BL(objEWA);
                if (flag > 0)
                {
                    if (strAction == "Save")
                    {
                        msgBox.ShowMessage("Record Saved Successfully !!!", "Saved", UserControls.MessageBox.MessageStyle.Successfull);
                    }
                    else if (strAction == "Update")
                    {
                        msgBox.ShowMessage("Record Updated Successfully !!!", "Updated", UserControls.MessageBox.MessageStyle.Successfull);
                    }
                    else if (strAction == "Delete")
                    {
                        msgBox.ShowMessage("Record Deleted Successfully !!!", "Deleted", UserControls.MessageBox.MessageStyle.Successfull);
                    }
                    ClearCntrl();
                    DisableCntrl();
                    GetBook();
                }
                else
                {
                    if (strAction == "Save")
                    {
                        msgBox.ShowMessage("already exists cann't  Save !!!", "Critical", UserControls.MessageBox.MessageStyle.Critical);
                    }
                    else if (strAction == "Update")
                    {
                        msgBox.ShowMessage("Unable to  Update !!!", "Critical", UserControls.MessageBox.MessageStyle.Critical);
                    }
                    else if (strAction == "Delete")
                    {
                        msgBox.ShowMessage("Unable to  Delete !!!", "Critical", UserControls.MessageBox.MessageStyle.Critical);
                    }
                }
            }
            catch (Exception)
            {
            }
        }
        private int CheckBookName(EWA_AddBook objEWA)
        {
            int cnt = objBL.CheckBookName_BL(objEWA);

            return(cnt);
        }