Ejemplo n.º 1
0
        public string JobCategoryAll(PropCategory objCategory)
        {
            SqlCommand cmd = new SqlCommand("proc_Category", objCon.Con);

            cmd.CommandType = CommandType.StoredProcedure;
            //cmd.Parameters.AddWithValue("@Action", "DropDown");
            //cmd.Parameters.AddWithValue("@status", objCategory.Flag);
            //cmd.Parameters.AddWithValue("@jobtypeID", objCategory.JobTypeValue);
            cmd.Parameters.AddWithValue("@Action", "View");
            cmd.Parameters.AddWithValue("@status", objCategory.Flag);
            SqlDataAdapter adpt = new SqlDataAdapter();
            DataSet        ds   = new DataSet();

            if (objCon.Con.State == ConnectionState.Open)
            {
            }
            else
            {
                objCon.Con.Open();
            }
            cmd.Connection     = objCon.Con;
            adpt.SelectCommand = cmd;
            adpt.Fill(ds, "JobCategoriesA");
            objCon.Con.Close();
            return(ds.GetXml());
        }
Ejemplo n.º 2
0
        /// <summary>
        /// This Method is used to Select data from tbl_category table
        /// </summary>
        /// <param name="objCategory">Action</param>
        /// <returns>1 for success and -1 for fail</returns>
        public string SelectCategory(PropCategory objCategory, string userName)
        {
            if (userName != null && userName != "")
            {
                SqlCommand cmd = new SqlCommand("proc_Category", objCon.Con);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@Action", "View");
                cmd.Parameters.AddWithValue("@status", objCategory.Flag);
                SqlDataAdapter adpt = new SqlDataAdapter();
                DataSet        ds   = new DataSet();
                if (objCon.Con.State == ConnectionState.Open)
                {
                }
                else
                {
                    objCon.Con.Open();
                }
                cmd.Connection     = objCon.Con;
                adpt.SelectCommand = cmd;
                adpt.Fill(ds, "Categories");
                objCon.Con.Close();
                return(ds.GetXml());
            }

            else
            {
                return("Not Valid");
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// This method will get associate Purchased Categories on the basis of jobtype
 /// </summary>
 /// <param name="objCategory"></param>
 /// <param name="userName"></param>
 /// <returns></returns>
 public string AssociatePurchasedCategory(PropCategory objCategory, string userName)
 {
     if (userName != null && userName != "")
     {
         SqlCommand cmd = new SqlCommand("proc_AllAssociateCategories", objCon.Con);
         cmd.CommandType = CommandType.StoredProcedure;
         cmd.Parameters.AddWithValue("@Action", "PurchasedCat");
         cmd.Parameters.AddWithValue("@associateID", Convert.ToInt32(userName));
         cmd.Parameters.AddWithValue("@jobType", objCategory.JobTypeValue);
         SqlDataAdapter adpt = new SqlDataAdapter();
         DataSet        ds   = new DataSet();
         if (objCon.Con.State == ConnectionState.Open)
         {
         }
         else
         {
             objCon.Con.Open();
         }
         cmd.Connection     = objCon.Con;
         adpt.SelectCommand = cmd;
         adpt.Fill(ds, "AssociateCategories");
         objCon.Con.Close();
         return(ds.GetXml());
     }
     else
     {
         return("Not Valid");
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 /// This Method is used to Delete data into tbl_category table
 /// </summary>
 /// <param name="objCategory">ID and Action</param>
 /// <returns>1 for success and -1 for fail</returns>
 public string DeleteCategory(PropCategory objCategory, string userName)
 {
     if (userName != null && userName != "")
     {
         SqlCommand cmd = new SqlCommand("proc_Category", objCon.Con);
         cmd.CommandType = CommandType.StoredProcedure;
         objCon.Con.Open();
         try
         {
             cmd.Parameters.AddWithValue("@ID", objCategory.IdValue);
             cmd.Parameters.AddWithValue("@Action", "Delete");
             return(cmd.ExecuteNonQuery().ToString());
         }
         catch (Exception showError)
         {
             throw showError;
         }
         finally
         {
             cmd.Dispose();
             objCon.Con.Close();
             objCon.Con.Dispose();
         }
     }
     else
     {
         return("Not Valid");
     }
 }
Ejemplo n.º 5
0
        protected void grdvViewPurchaseOrder_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow && grdvViewPurchaseOrder.EditIndex == e.Row.RowIndex)
            {
                PropCategory objcat = new PropCategory();
                DropDownList dd2    = (DropDownList)e.Row.FindControl("drpEditCategory");
                dd2.DataSource = BusinessNewPurchase.busSelectCategory(objcat);
                dd2.DataBind();

                PropSubCategory objsub = new PropSubCategory();
                DropDownList    dd3    = (DropDownList)e.Row.FindControl("drpEditSubCategory");
                dd3.DataSource = BusinessNewPurchase.busSelectSubCategoryGridview(objsub);
                dd3.DataBind();

                //propunit objUnit = new propunit();
                //DropDownList dd4 = (DropDownList)e.Row.FindControl("ddlUnit");
                //dd4.DataSource = BusinessNewPurchase.busSelectUnit(objUnit);
                //dd4.DataBind();

                PropSubSubCategory objsubsubsub = new PropSubSubCategory();
                DropDownList       dd5          = (DropDownList)e.Row.FindControl("drpEditSubSubCategory");
                dd5.DataSource = BusinessNewPurchase.buseditmodefillsubcat(objsubsubsub);
                dd5.DataBind();
            }
        }
Ejemplo n.º 6
0
        public string ViewSearchingCategories(int jobtype, string zipcode, string _action)
        {
            string str = string.Empty;
            BllSearchingCategories objInnerpage = new BllSearchingCategories();
            PropCategory           objProperty  = new PropCategory();

            objProperty.JobTypeValue = jobtype;
            str = objInnerpage.SearchSalesCategory(objProperty, zipcode, _action);
            return(str);
        }
Ejemplo n.º 7
0
        public string AssociatePurchasedCategory(int jobtype)
        {
            string       str          = string.Empty;
            PropCategory propCategory = new PropCategory();

            propCategory.JobTypeValue = jobtype;
            BllJobCategory objCategory = new BllJobCategory();

            str = objCategory.AssociatePurchasedCategory(propCategory, Session["associate"].ToString());
            return(str);
        }
Ejemplo n.º 8
0
        public string AllJobtypeWiseCategory(int flag)
        {
            string       str          = string.Empty;
            PropCategory propCategory = new PropCategory();

            propCategory.Flag = flag;
            BllJobCategory objCategory = new BllJobCategory();

            str = objCategory.AllJobCategory(propCategory);
            return(str);
        }
Ejemplo n.º 9
0
        public string JobtypeWiseCategory(int flag, int jobtype)
        {
            string       str          = string.Empty;
            PropCategory propCategory = new PropCategory();

            propCategory.Flag         = flag;
            propCategory.JobTypeValue = jobtype;
            BllJobCategory objCategory = new BllJobCategory();

            str = objCategory.JobCategory(propCategory);
            return(str);
        }
Ejemplo n.º 10
0
        public string SelectCategory(int flag)
        {
            string str = string.Empty;

            if (Session["admin"].ToString() != "" || Session["admin"].ToString() != null)
            {
                PropCategory propCategory = new PropCategory();
                propCategory.Flag = flag;
                BllJobCategory objCategory = new BllJobCategory();
                str = objCategory.RecordSelect(propCategory, Session["admin"].ToString());
                return(str);
            }
            else
            {
                return("Error in Authentication");
            }
        }
Ejemplo n.º 11
0
        /// <summary>
        /// This Method is used to Select data
        /// </summary>
        /// <param name="objCategory">Action</param>
        /// <returns>1 for success and -1 for fail</returns>
        public string RecordSelect(PropCategory objProperty, string UserName)
        {
            DllJobCategory objDal = new DllJobCategory();

            try
            {
                return(objDal.SelectCategory(objProperty, UserName));
            }
            catch (Exception info)
            {
                throw info;
            }
            finally
            {
                objDal = null;
            }
        }
        public string SearchSalesCategory(PropCategory objProperty, string zipcode, string _action)
        {
            DllSearchingCategories objDal = new DllSearchingCategories();

            try
            {
                return(objDal.SearchSalesCategory(objProperty, zipcode, _action));
            }
            catch (Exception info)
            {
                throw info;
            }
            finally
            {
                objDal = null;
            }
        }
Ejemplo n.º 13
0
        /// <summary>
        /// This method will get associate Purchased Categories on the basis of jobtype
        /// </summary>
        /// <param name="objProperty"></param>
        /// <param name="UserName"></param>
        /// <returns></returns>
        public string AssociatePurchasedCategory(PropCategory objProperty, string UserName)
        {
            DllJobCategory objDal = new DllJobCategory();

            try
            {
                return(objDal.AssociatePurchasedCategory(objProperty, UserName));
            }
            catch (Exception info)
            {
                throw info;
            }
            finally
            {
                objDal = null;
            }
        }
Ejemplo n.º 14
0
        public string AllJobCategory(PropCategory objProperty)
        {
            DllJobCategory objDal = new DllJobCategory();

            try
            {
                return(objDal.JobCategoryAll(objProperty));
            }
            catch (Exception info)
            {
                throw info;
            }
            finally
            {
                objDal = null;
            }
        }
Ejemplo n.º 15
0
 protected void ddlCategory_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (ddlCategory.SelectedIndex != 0)
     {
         ddlSubCat.Items.Clear();
         ddlSubSubCat.Items.Clear();
         ddlSubCat.Items.Add("-Select-");
         PropCategory obj = new PropCategory();
         obj.Id = Convert.ToInt32(ddlCategory.SelectedItem.Value.ToString());
         ddlSubCat.DataSource = BusinessNewPurchase.busSelectSubCategory(obj);
         ddlSubCat.DataBind();
     }
     else
     {
         ddlSubCat.Items.Clear();
         ddlSubCat.Items.Add("-Select-");
     }
 }
Ejemplo n.º 16
0
        protected void btnSubmitCat_Click(object sender, EventArgs e)
        {
            PropCategory newcat = new PropCategory();

            newcat.Name = txtPopCatName.Text;
            int op = BusinessNewPurchase.buspopCategory(newcat);


            if (op <= 0)
            {
                ClientScript.RegisterStartupScript(Page.GetType(), "test3", "<script>window.opener.location.reload(true);window.close();</script>");
            }

            else
            {
                Response.Write("Error in processing.Please Try Again!!");
            }
        }
Ejemplo n.º 17
0
        public string UpdateCategory(string Name, int ID)
        {
            string str = string.Empty;

            if (Session["admin"] != "" || Session["admin"].ToString() != null)
            {
                PropCategory propCategory = new PropCategory();
                propCategory.CategoryNameValue = Name;
                propCategory.IdValue           = ID;
                BllJobCategory objCategory = new BllJobCategory();
                str = objCategory.RecordUpdate(propCategory, Session["admin"].ToString());
                return(str);
            }
            else
            {
                return("Error in Authentication");
            }
        }
Ejemplo n.º 18
0
        public string InsertCategory(int jobType, string CategoryName)
        {
            string str = string.Empty;

            if (Session["admin"].ToString() != "" || Session["admin"].ToString() != null)
            {
                PropCategory propcat = new PropCategory();
                propcat.CategoryNameValue = CategoryName;
                propcat.JobTypeValue      = jobType;
                // propcat.CategoryImage = CateImage;
                BllJobCategory objCategory = new BllJobCategory();
                str = objCategory.RecordInsert(propcat, Session["admin"].ToString());
                return(str);
            }
            else
            {
                return("Error in Authentication");
            }
        }
Ejemplo n.º 19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["data"] != null)//session checking
            {
                if (!IsPostBack)
                {
                    PropItem objItem = new PropItem();
                    ddlItemName.DataSource = BusinessNewPurchase.busSelectItem(objItem);
                    ddlItemName.DataBind();//data binding

                    PropCategory objcat = new PropCategory();
                    ddlCategory.DataSource = BusinessNewPurchase.busSelectCategory(objcat);
                    ddlCategory.DataBind();

                    PropVendor objVendor = new PropVendor();
                    ddlSupplierName.DataSource = BusinessNewPurchase.busSelectVendor(objVendor);
                    ddlSupplierName.DataBind();

                    PropDestination objDes = new PropDestination();
                    DdlSite.DataSource = BusinessNewPurchase.busFillDestination(objDes);
                    DdlSite.DataBind();

                    //propunit objUnit = new propunit();
                    //drplUnit.DataSource = BusinessNewPurchase.busSelectUnit(objUnit);
                    //drplUnit.DataBind();

                    addItem.Attributes.Add("onclick", "openPopUp('PopUpItem.aspx')");

                    AddVendor.Attributes.Add("onclick", "openPopUpVendor('PopUpVendor.aspx')");
                }
                Label1.Text = "";
            }
            else
            {
                Response.Redirect("~/Login.aspx");//page redirection
            }
        }
Ejemplo n.º 20
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["data"] != null)//session checking
            {
                if (!IsPostBack)
                {
                    PropItem objItem = new PropItem();
                    ddlSearchItemName.DataSource = BusinessNewPurchase.busSelectItem(objItem);
                    ddlSearchItemName.DataBind();

                    PropCategory objcat = new PropCategory();
                    ddlCategory.DataSource = BusinessNewPurchase.busSelectCategory(objcat);
                    ddlCategory.DataBind();

                    PropVendor objVendor = new PropVendor();
                    ddlSearchVenderName.DataSource = BusinessNewPurchase.busSelectVendor(objVendor);
                    ddlSearchVenderName.DataBind();
                }
            }
            else
            {
                Response.Redirect("~/Login.aspx");
            }
        }
        public string SearchSalesCategory(PropCategory objCategory, string zipcode, string _action)
        {
            SqlCommand cmd = new SqlCommand("proc_GetSearchingCategory", objCon.Con);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@Action", _action);
            cmd.Parameters.AddWithValue("@jobType", objCategory.JobTypeValue);
            cmd.Parameters.AddWithValue("@zipCode", zipcode);
            SqlDataAdapter adpt = new SqlDataAdapter();
            DataSet        ds   = new DataSet();

            if (objCon.Con.State == ConnectionState.Open)
            {
            }
            else
            {
                objCon.Con.Open();
            }
            cmd.Connection     = objCon.Con;
            adpt.SelectCommand = cmd;
            adpt.Fill(ds, "SearchCategories");
            objCon.Con.Close();
            return(ds.GetXml());
        }
Ejemplo n.º 22
0
 public static DataSet searchbycategory(PropCategory obj4)
 {
     return(DBManager.ExecuteDataset("spSelectCategory", obj4.Name));
 }
Ejemplo n.º 23
0
 public static DataSet selectSubCategory(PropCategory objsub)
 {
     return(DBManager.ExecuteDataset("spFillSubCategory", objsub.Id));
 }
Ejemplo n.º 24
0
 public static DataSet busSelectSubCategory(PropCategory objSub)
 {
     return(DalItemPurchase.selectSubCategory(objSub));
 }
Ejemplo n.º 25
0
 public static int buspopCategory(PropCategory objCategory)
 {
     return(DalItemPurchase.InsertpopCategory(objCategory));
 }
Ejemplo n.º 26
0
 public PropCategory(PropCategory elementType)
 {
     Value = elementType.Value;
 }
Ejemplo n.º 27
0
 public static DataSet busSearchCategory(PropCategory obj5)
 {
     return(DalSearching.searchbycategory(obj5));
 }
Ejemplo n.º 28
0
 public static int InsertpopCategory(PropCategory objcat)
 {
     return(DBManager.ExecuteNonQuery("spPopInserCategoryName", objcat.Name));
 }