Click here to Skip to main content
15,896,557 members

Comments by Cmajorros (Top 10 by date)

Cmajorros 3-Apr-13 23:34pm View    
I know that well. I used to use it to generate my DB File to ERD. But for generate the Datadic to ERD I really have no idea
Cmajorros 13-Feb-13 11:40am View    
Anyway I have solve my problems already. I just created new page and copy sever side code. It 's work. Although it seems to be a stupid solution,at least It works well. Thank you all guys for your kindly help
Cmajorros 13-Feb-13 7:11am View    
I am appreciated for your kindly help. Thanks again.
Cmajorros 13-Feb-13 7:10am View    
These code is from Server Side

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;

namespace OPProject.Production
{
public partial class WebForm2 : System.Web.UI.Page
{
clsDatabase dbconn = new clsDatabase();
DataTable dt1;

protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
dt1 = new DataTable();
MakeDataTable();
}
else
{
dt1 = (DataTable)ViewState["DataTable"];
}
ViewState["DataTable"] = dt1;

}

protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
String FindJobOrder = "Select * from JobOrders where JobID Like '%" + txtFindJO.Text + "%' or CusName like '%" + txtFindJO.Text + "%' and JobStatus = 'รอจัดซื้อวัตถุดิบ';";
DataTable dt = dbconn.QueryExecuteScalar(FindJobOrder);
GridView1.DataSource = dt;
GridView1.DataBind();
dbconn.Close();
PanelResult.Visible = true;
PanelAddRaw.Visible = false;
PanelDetail.Visible = false;
PanelSearch.Visible = true;
PanelOrderItem.Visible = false;
}

protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
string JOID = GridView1.SelectedRow.Cells[1].Text;
string SearchJI = "SELECT * FROM JobOrderItems WHERE JobID = '" + JOID + "';";
DataTable dt = dbconn.QueryExecuteScalar(SearchJI);
GridView2.DataSource = dt;
GridView2.DataBind();
dbconn.Close();
PanelOrderItem.Visible = true;
PanelResult.Visible = false;
PanelDetail.Visible = false;
PanelAddRaw.Visible = false;
PanelSearch.Visible = true;
}

protected void GridView2_SelectedIndexChanged(object sender, EventArgs e)
{
string ShowJobItem = "Select JobOrderItems.JobItemID, JobOrderItems.JobItemStatus, JobOrderItems.JobItemName, JobOrderItems.JobItemDes, JobOrderItems.SizeID,Sizes.SizeName,JobOrderItems.JobItemQty from JobOrderItems, Sizes where JobItemID = '" + GridView2.SelectedRow.Cells[1].Text + "' AND JobOrderItems.SizeID = Sizes.SizeID ;";

DataTable dt = dbconn.QueryExecuteScalar(ShowJobItem);


GridView GV = (GridView)DetailsView1.FindControl("GridViewJobOrderItem");
GV.DataSource = dt;
GV.DataBind();



string FindStyle = "SELECT dbo.JobOrders.StyleID, dbo.Styles.StylePic FROM dbo.Styles INNER JOIN dbo.JobOrders ON dbo.Styles.StyleID = dbo.JobOrders.StyleID WHERE (dbo.JobOrders.JobID = '" + GridView1.SelectedRow.Cells[1].Text + "');";
DataTable dtStyle = dbconn.QueryExecuteScalar(FindStyle);
string ImageN = dtStyle.Rows[0]["StylePic"].ToString();
string ImageName = "~/ModelPicture/" + ImageN;
Image ShowImage = (Image)DetailsView1.FindControl("Image1");
ShowImage.ImageUrl = ImageName;
dbconn.Close();
PanelDetail.Visible = true;
PanelAddRaw.Visible = true;
PanelResult.Visible = false;
PanelOrderItem.Visible = false;
PanelSearch.Visible = true;
}

protected void SqlDataSource3_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
{

}

protected void BtnSave_Click(object sender, EventArgs e)
{
SaveMat();

Response.Redirect("~/Master/CompleteSave.aspx");
}
private void MakeDataTable()
{
dt1.Columns.Add("รหัสวัตถุดิบ");
dt1.Columns.Add("วัตถุดิบ");
dt1.Columns.Add("จำนวน");
dt1.Columns.Add("หน่วย");


Cmajorros 13-Feb-13 7:09am View    
Sure!



These are for Designed Page


<%@ Page Title="" Language="C#" MasterPageFile="~/OP.Master" AutoEventWireup="true" CodeBehind="AddOrder.aspx.cs" Inherits="OPProject.Production.Order" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<style type="text/css">
.style9
{
width: 100%;
}
.style10
{
width: 982px;
}
.style13
{
width: 136px;
color: #FFFFFF;
}
.style20
{
width: 80px;
}
.style21
{
height: 53px;
width: 80px;
}
.style22
{
font-size: medium;
width: 982px;
}
.style23
{
width: 124px;
}
.style26
{
width: 813px;
}
.style30
{
width: 124px;
height: 21px;
}
.style31
{
width: 813px;
height: 21px;
}
.style32
{
height: 21px;
}
.style35
{
height: 31px;
}
.style49
{
width: 471px;
height: 31px;
}
.style50
{
width: 471px;
}
.style51
{
width: 124px;
height: 31px;
color: #FFFFFF;
}
.style53
{
width: 124px;
height: 30px;
}
.style54
{
width: 813px;
height: 30px;
}
.style55
{
height: 30px;
}
.style56
{
color: #696969;
}
.style63
{
width: 136px;
height: 31px;
color: #FFFFFF;
}
.style64
{
height: 31px;
color: #FFFFFF;
}
.style65
{
color: #FFFFFF;
}
.style67
{
height: 31px;
width: 813px;
}
.style68
{
width: 760px;
height: 31px;
color: #FF3300;
}
.style69
{
width: 813px;
height: 31px;
color: #FF3300;
}
</style>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
 <table class="style9">
<tr>
<td class="style20">
 </td>
<td class="style10">
<asp:ScriptManager ID="ScriptManager1" runat="server">

</td>
<td>
 </td>
<td>
 </td>
</tr>
<tr>
<td class="style20">
 </td>
<td class="style22">
สร้างคำสั่งผลิต</td>
<td>
 </td>
<td>
 </td>
</tr>
<tr>
<td class="style21">
 </td>
<td colspan="3">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<contenttemplate>
<asp:Panel ID="PanelJobOrder" runat="server" BorderColor="#666666"
BorderStyle="Solid" BorderWidth="3px" style="margin-right: 78px" Wrap="False">
<table>
<tr>
<td class="style63" bgcolor="#336699">
เลขที่คำสั่งผลิต : 
</td>
<td class="style49">
<asp:Label ID="Lbl