private void FillRegData()
    {
        using (category obj = new category())
        {
            DataSet ds = new DataSet();
            obj._id = Convert.ToInt64(Request.QueryString["id"].ToString());
            ds      = obj.category_selectbyid();

            if (ds.Tables[0].Rows.Count > 0)
            {
                txtcname.Text             = ds.Tables[0].Rows[0]["Name"].ToString();
                txtrank.Text              = ds.Tables[0].Rows[0]["Rank"].ToString();
                txtdesc.Text              = ds.Tables[0].Rows[0]["Description"].ToString();
                ddlparentid.SelectedValue = ds.Tables[0].Rows[0]["ParentID"].ToString();
                Boolean b = Convert.ToBoolean(ds.Tables[0].Rows[0]["Active"].ToString());
                ViewState["image"] = ds.Tables[0].Rows[0]["image"].ToString();
                imageup.ImageUrl  += ds.Tables[0].Rows[0]["image"].ToString();
                imageup.Visible    = true;
                fucimage.Visible   = false;
                if (b == true)
                {
                    ckbactive.Checked = true;
                }
                else
                {
                    ckbactive.Checked = false;
                }

                //ViewState["image"] = ds.Tables[0].Rows[0]["Image"].ToString();
            }
            btnsubmit.Text = "Update";
        }
    }
    private void FillDdlData()
    {
        using (productparameter obj = new productparameter())
        {
            DataSet ds = new DataSet();
            obj._pdid = Convert.ToInt64(Request.QueryString["mid"].ToString());
            ds        = obj.productparameter_select_byproductid();

            if (ds.Tables[0].Rows.Count > 0)
            {
                ddlpdname.DataSource     = ds;
                ddlpdname.DataTextField  = "Name";
                ddlpdname.DataValueField = "ProductID";
                ddlpdname.DataBind();

                using (category objc = new category())
                {
                    DataSet dsc = new DataSet();
                    objc._id = Convert.ToInt64(ds.Tables[0].Rows[0]["CategoryID"].ToString());
                    dsc      = objc.category_selectbyid();

                    if (dsc.Tables[0].Rows.Count > 0)
                    {
                        ViewState["prid"] = dsc.Tables[0].Rows[0]["ParentID"].ToString();
                    }
                }
            }

            //ds = obj.productparameter_select_bycategoryid();
            if (ViewState["prid"] != null)
            {
                obj._pdid = Convert.ToInt64(ViewState["prid"]);
                ds        = obj.productparameter_select_bycategoryid();
                if (ds.Tables[0].Rows.Count > 0)
                {
                    ddlprname.DataSource     = ds;
                    ddlprname.DataTextField  = "Name";
                    ddlprname.DataValueField = "ParameterID";
                    ddlprname.DataBind();
                }
            }
        }
    }
예제 #3
0
    private void Choseiav()
    {
        int tag;

        // throw new NotImplementedException();
        using (product obj = new product())
        {
            obj._id = Convert.ToInt64(Request.QueryString["sid"].ToString());
            DataSet ds = new DataSet();
            ds = obj.product_details();
            if (ds.Tables[0].Rows.Count > 0)
            {
                using (category objc = new category())
                {
                    objc._id = Convert.ToInt64(ds.Tables[0].Rows[0]["cid"].ToString());
                    DataSet dsr = new DataSet();
                    dsr = objc.category_selectbyid();
                    if (dsr.Tables[0].Rows.Count > 0)
                    {
                        tag = Convert.ToInt32(dsr.Tables[0].Rows[0]["ParentID"].ToString());
                        if (tag == 2)
                        {
                            imgpd.Src += ds.Tables[0].Rows[0]["image"].ToString();
                            using (productparameter objp = new productparameter())
                            {
                                objp._pdid = Convert.ToInt64(Request.QueryString["sid"].ToString());
                                objp._prid = Convert.ToInt64("2");
                                DataSet dsp = new DataSet();
                                dsp = objp.productparameter_select_byparameterid();
                                if (dsp.Tables[0].Rows.Count > 0)
                                {
                                    aimg.HRef += dsp.Tables[0].Rows[0]["OProduct"].ToString();
                                }
                            }

                            image.Visible   = true;
                            video.Visible   = false;
                            audio.Visible   = false;
                            lblrelated.Text = "Image";
                        }
                        if (tag == 3)
                        {
                            using (productparameter objp = new productparameter())
                            {
                                objp._pdid = Convert.ToInt64(Request.QueryString["sid"].ToString());
                                objp._prid = Convert.ToInt64("6");
                                DataSet dsp = new DataSet();
                                dsp = objp.productparameter_select_byparameterid();
                                if (dsp.Tables[0].Rows.Count > 0)
                                {
                                    //aimg.HRef += dsp.Tables[0].Rows[0]["OProduct"].ToString();
                                    flashvideo.VideoURL += dsp.Tables[0].Rows[0]["OProduct"].ToString();
                                }
                            }

                            image.Visible   = false;
                            video.Visible   = true;
                            audio.Visible   = false;
                            lblrelated.Text = "Video";
                        }
                        if (tag == 4)
                        {
                            img1.Src += ds.Tables[0].Rows[0]["image"].ToString();
                            using (productparameter objp = new productparameter())
                            {
                                objp._pdid = Convert.ToInt64(Request.QueryString["sid"].ToString());
                                objp._prid = Convert.ToInt64("10");
                                DataSet dsp = new DataSet();
                                dsp = objp.productparameter_select_byparameterid();
                                if (dsp.Tables[0].Rows.Count > 0)
                                {
                                    audio1.AudioURL += dsp.Tables[0].Rows[0]["OProduct"].ToString();
                                }
                            }

                            image.Visible   = false;
                            video.Visible   = false;
                            audio.Visible   = true;
                            lblrelated.Text = "Audio";
                        }
                    }
                }
            }
        }
    }