Beispiel #1
0
    private void CommentsBind()
    {
        string        cs  = ConfigurationManager.ConnectionStrings["RegistrationConnectionString"].ConnectionString;
        SqlConnection con = new SqlConnection(cs);
        SqlCommand    cmd = new SqlCommand("spGetParentCommentssss", con);

        cmd.CommandType = CommandType.StoredProcedure;
        cmd.Parameters.Add("@Pa_id", SqlDbType.Int).Value = lblID.Text.Trim();
        cmd.Connection = con;


        try
        {
            con.Open();
            GridViewComment.DataSource = cmd.ExecuteReader();
            GridViewComment.DataBind();
        }
        catch (Exception ex)
        {
            throw ex;
        }
        finally
        {
            con.Close();
        }
    }
 private void GetPostData()
 {
     try
     {
         string         pro_id = Session["C_Pid"].ToString();
         SqlCommand     cmd    = new SqlCommand("select C_Cid,C_Pid,C_Comment_cnt,C_Commenttext,C_Currentdate from tbl_comments where C_Pid='" + pro_id + "' order by C_Cid DESC", con);
         SqlDataAdapter da     = new SqlDataAdapter(cmd);
         DataSet        ds     = new DataSet();
         da.Fill(ds);
         int cnt = ds.Tables[0].Rows.Count;
         if (cnt > 0)
         {
             lblcomment_cnt.Text = (ds.Tables[0].Rows.Count).ToString();
             lblcmt.Text         = (ds.Tables[0].Rows.Count).ToString();
         }
         else
         {
             lblcmt.Text = "0";
         }
         GridViewComment.DataSource = ds.Tables[0].DefaultView;
         GridViewComment.DataBind();
     }
     catch (Exception)
     {
     }
 }
Beispiel #3
0
        private void load_data()
        {
            //Load Category
            Label10.Text = GetCategoryData();
            //********************************
            string         bookID = Request.QueryString["bookid"];
            SqlConnection  con    = new SqlConnection(connStr);
            SqlDataAdapter da     = new SqlDataAdapter("select * from Chapter where BookID=" + bookID, con);
            DataTable      tb     = new DataTable();

            da.Fill(tb);
            GridViewChapter.DataSource = tb;
            GridViewChapter.DataBind();

            //Load Book Infor

            SqlDataAdapter da1 = new SqlDataAdapter("select title, summary, author from book where BookID=" + bookID, con);
            DataTable      tb1 = new DataTable();

            da1.Fill(tb1);
            Label1.Text     = tb1.Rows[0][0].ToString();
            lblAuthor.Text  = tb1.Rows[0][2].ToString();
            lblSummary.Text = tb1.Rows[0][1].ToString();

            //Load AVG Score
            SqlDataAdapter da2 = new SqlDataAdapter("select cast(AVG(Score) as decimal(10,2)) as 'Average Score' from VoteScore where BookID=" + bookID, con);
            DataTable      tb2 = new DataTable();

            da2.Fill(tb2);
            lblScore.Text = tb2.Rows[0][0].ToString();

            //Load current score
            SqlDataAdapter da3 = new SqlDataAdapter("select score from VoteScore where BookID=" + bookID + " and userid='" + lblUsername.Text + "'", con);
            DataSet        ds  = new DataSet();

            da3.Fill(ds);
            int count = ds.Tables[0].Rows.Count;

            if (count == 1)
            {
                DataTable tb3 = new DataTable();
                da3.Fill(tb3);
                DropDownList1.SelectedValue = tb3.Rows[0][0].ToString();
            }
            //Load Comment
            SqlDataAdapter da4 = new SqlDataAdapter("select * from Comment where BookID=" + bookID + " order by CommentID desc", con);
            DataTable      tb4 = new DataTable();

            da4.Fill(tb4);
            GridViewComment.DataSource = tb4;
            GridViewComment.DataBind();

            //Load Chapter
            SqlDataAdapter da5 = new SqlDataAdapter("select * from Chapter where BookID=" + bookID, con);
            DataTable      tb5 = new DataTable();

            da5.Fill(tb5);
            GridViewChapter.DataSource = tb5;
            GridViewChapter.DataBind();
        }
Beispiel #4
0
    private void CommentsBind()
    {
        string        cs  = ConfigurationManager.ConnectionStrings["RegistrationConnectionString"].ConnectionString;
        SqlConnection con = new SqlConnection(cs);
        SqlCommand    cmd = new SqlCommand("spGetAboutCommentssss", con);

        cmd.CommandType = CommandType.StoredProcedure;
        cmd.Connection  = con;


        try
        {
            con.Open();
            GridViewComment.DataSource = cmd.ExecuteReader();
            GridViewComment.DataBind();
        }
        catch (Exception ex)
        {
            throw ex;
        }
        finally
        {
            con.Close();
        }
    }
Beispiel #5
0
        protected void ButtonPost_Click(object sender, EventArgs e)
        {
            //dbContext.CreatingFeedbackComment(TextBoxVisitorName.Text, TextBoxEmail.Text, TextBoxTitle.Text, TextBoxComment.Text, null);

            dbContext.CreatingFeedbackComment(TBVisitorName.Value, TBEmail.Value, TBTitle.Value, TAComment.Value, null);
            GridViewComment.DataBind();
            Response.Redirect(Request.Path);
        }
Beispiel #6
0
        private void CommentsBind()
        {
            SqlDataAdapter da = new SqlDataAdapter("spGetParentComment", con);
            DataSet        ds = new DataSet();

            da.Fill(ds);
            GridViewComment.DataSource = ds;
            GridViewComment.DataBind();
        }
Beispiel #7
0
        protected void BindData(string id)
        {
            DataTable reqData = oSALE_ORDER_Service.getDataById(id);

            DataTable dtCustomerGroup = oUtility.getActive(oCUSTOMER_GROUP_Service.getData(), "Status_Name", "Active");

            oUtility.DDL(DDLEditCustomerGroup, dtCustomerGroup, "Cus_Group_Name", "Cus_Group_Code", "Please select Customer Group");
            DataTable dtCustomer = oUtility.getActive(oCUSTOMER_Service.getData(), "Status_Name", "Active");

            oUtility.DDL(DDLEditCustomer, dtCustomer, "Cus_Name", "Cus_Code", "Please select Customer");
            DataTable dtSale = oUtility.getActive(oSALE_Service.getData(), "Status_Name", "Active");

            oUtility.DDL(DDLEditSale, dtSale, "Sale_Name", "Sale_Code", "Please select Sale");
            DataTable dtCostCenter = oUtility.getActive(oCOSTCENTER_Service.getData(), "Status_Name", "Active");

            oUtility.DDL(DDLEditCostCenter, dtCostCenter, "COST_CENTER_NAME", "COST_CENTER_CODE", "Please select Sale");
            DataTable dtVender = oUtility.getActive(oVENDER_Service.getData(), "Status_Name", "Active");

            oUtility.DDL(DDLEditVender, dtVender, "VENDER_FULL_NAME", "VENDER_CODE", "Please select Customer");

            if (reqData.Rows[0]["SALE_ORDER_TYPE"].ToString() == "MS")
            {
                DDLEditVender.Enabled = false;
                //txtEditSaleOrderAmount.Enabled = false;
                //DDLEditCostCenter.Enabled = false;
            }
            else
            {
                DDLEditVender.Enabled = true;
                //txtEditSaleOrderAmount.Enabled = true;
                //DDLEditCostCenter.Enabled = true;
            }

            lblEditId.Text = reqData.Rows[0]["SALE_ORDER_ID"].ToString();
            DDLEditCustomerGroup.SelectedValue = reqData.Rows[0]["Cus_Group_Code"].ToString();
            DDLEditCustomer.SelectedValue      = reqData.Rows[0]["Cus_Code"].ToString();
            DDLEditSaleOrderType.SelectedValue = reqData.Rows[0]["SALE_ORDER_TYPE"].ToString();
            DDLEditVender.SelectedValue        = reqData.Rows[0]["VENDER_CODE"].ToString();
            lblEditSaleOrderNumber.Text        = reqData.Rows[0]["SALE_ORDER_Number"].ToString();
            txtEditPONumber.Text = reqData.Rows[0]["PO_Number"].ToString();

            txtEditSaleOrderShippingDate.Text = reqData.Rows[0]["SALE_ORDER_Shipping_Date"].ToString();

            txtEditSaleOrderAmount.Text     = reqData.Rows[0]["SALE_ORDER_Amount"].ToString();
            DDLEditSale.SelectedValue       = reqData.Rows[0]["Sale_Code"].ToString();
            DDLEditCostCenter.SelectedValue = reqData.Rows[0]["Cost_Center"].ToString();
            txtEditRemark.Text = reqData.Rows[0]["SALE_ORDER_Remark"].ToString();

            ViewState["reqDataDetail"] = oSALE_ORDER_Service.getDataDetail(id);
            GridView.DataSource        = (DataTable)ViewState["reqDataDetail"];
            GridView.DataBind();

            ViewState["reqDataComment"] = oSALE_ORDER_Service.getDataCommentById(id);
            GridViewComment.DataSource  = (DataTable)ViewState["reqDataComment"];
            GridViewComment.DataBind();
        }
        private void CommentsBind()
        {
            SqlDataAdapter da = new SqlDataAdapter("spGetParentComment", con);
            DataSet        ds = new DataSet();

            da.Fill(ds);
            GridViewComment.DataSource = ds;
            GridViewComment.DataBind();
            Label2.Text = Request.QueryString["Username"];
        }
Beispiel #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DataTable panelPopup = new DataTable();

            panelPopup.Columns.Add("Input");
            panelPopup.Columns.Add("Name");
            panelPopup.Columns.Add("Output");

            createActionTable("User", panelPopup);
            GridViewUser.DataSource = panelPopup;
            GridViewUser.DataBind();

            panelPopup.Clear();
            createActionTable("Friend", panelPopup);
            GridViewFriends.DataSource = panelPopup;
            GridViewFriends.DataBind();

            panelPopup.Clear();
            createActionTable("Album", panelPopup);
            GridViewAlbum.DataSource = panelPopup;
            GridViewAlbum.DataBind();

            panelPopup.Clear();
            createActionTable("Photo", panelPopup);
            GridViewPhoto.DataSource = panelPopup;
            GridViewPhoto.DataBind();

            panelPopup.Clear();
            createActionTable("Post", panelPopup);
            GridViewPost.DataSource = panelPopup;
            GridViewPost.DataBind();

            panelPopup.Clear();
            createActionTable("Video", panelPopup);
            GridViewVideo.DataSource = panelPopup;
            GridViewVideo.DataBind();

            panelPopup.Clear();
            createActionTable("Like", panelPopup);
            GridViewLike.DataSource = panelPopup;
            GridViewLike.DataBind();

            panelPopup.Clear();
            createActionTable("Comment", panelPopup);
            GridViewComment.DataSource = panelPopup;
            GridViewComment.DataBind();
        }
        protected void BindData(string id)
        {
            DataTable reqData = oSALE_ORDER_Service.getDataById(id);

            ViewState["reqData"] = reqData;

            lblDetailId.Text                    = reqData.Rows[0]["SALE_ORDER_ID"].ToString();
            lblDetailCustomerGroup.Text         = reqData.Rows[0]["Cus_Group_Name"].ToString();
            lblDetailCustomer.Text              = reqData.Rows[0]["Cus_Name"].ToString();
            lblDetailSaleOrderType.Text         = reqData.Rows[0]["SALE_ORDER_TYPE"].ToString();
            lblDetailVenderName.Text            = reqData.Rows[0]["VENDER_NAME"].ToString();
            lblDetailSaleOrderNumber.Text       = reqData.Rows[0]["SALE_ORDER_Number"].ToString();
            lblDetailSaleOrderBalance.Text      = reqData.Rows[0]["SALE_ORDER_Balance"].ToString();
            lblDetailPONumber.Text              = reqData.Rows[0]["PO_Number"].ToString();
            lblDetailSaleOrderShippingDate.Text = reqData.Rows[0]["SALE_ORDER_Shipping_Date"].ToString();
            double amount = Double.Parse(reqData.Rows[0]["SALE_ORDER_Amount"].ToString());

            lblDetailSaleOrderAmount.Text = string.Format("{0:C2}", amount);
            double balance = Double.Parse(reqData.Rows[0]["SALE_ORDER_Balance"].ToString());

            lblDetailSaleOrderBalance.Text  = string.Format("{0:C2}", balance);
            lblDetailSale.Text              = reqData.Rows[0]["Sale_Name"].ToString();
            lblDetailCostCenter.Text        = reqData.Rows[0]["COST_CENTER_NAME"].ToString();
            txtEditRemark.Text              = reqData.Rows[0]["SALE_ORDER_Remark"].ToString();
            RdWarehouseStatus.SelectedValue = reqData.Rows[0]["SALE_ORDER_Status"].ToString();

            DataTable reqDataDetail = oSALE_ORDER_Service.getDataDetail(id);

            ViewState["reqDataDetail"] = reqDataDetail;
            GridView.DataSource        = reqDataDetail;
            GridView.DataBind();

            ViewState["reqDataInvoice"] = oINVENTORY_Service.getDataBySaleOrder(lblDetailSaleOrderNumber.Text);
            GridViewInvoice.DataSource  = (DataTable)ViewState["reqDataInvoice"];
            GridViewInvoice.DataBind();

            ViewState["reqDataCreditNote"] = oCREDITNOTE_Service.getDataBySaleOrder(lblDetailSaleOrderNumber.Text);
            GridViewCreditNote.DataSource  = (DataTable)ViewState["reqDataCreditNote"];
            GridViewCreditNote.DataBind();

            ViewState["reqDataComment"] = oSALE_ORDER_Service.getDataCommentById(id);
            GridViewComment.DataSource  = (DataTable)ViewState["reqDataComment"];
            GridViewComment.DataBind();
        }