15,896,557 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
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
Cmajorros
13-Feb-13 6:59am
View
I have tried already and it was working with no error
Cmajorros
13-Feb-13 6:58am
View
Actually, I have the same project in another computer . When I run this page, it works well. So Does it cause of the project's environment?
Cmajorros
26-Sep-12 2:42am
View
I have tried this
//this is the event from the confirm button in Modal popup panel.
protected void btnConfirm_Click(object sender, EventArgs e)
{
string ActID = GridView1.SelectedRow.Cells[1].Text.ToString();
TextBox txtCancelDes = (TextBox)(this.FindControl("txtCancelDes"));
string Des = txtCancelDes.Text;
string CancelActivity;
CancelActivity = "UPDATE Activities SET Activity_Status = 'Canceled',Activity_CancelDes = '"+Des+"' WHERE Activity_ID = " + ActID + ";";
dbconn.QueryExecuteScalar(CancelActivity);
dbconn.Close();
MessageBox.Show("Done");
}
but it s still not work. I have tried to debug it by dropping the break point at the event btnConfirm_Click but when i run the page. it does not break at this event. the confirm button does not know this event.
Moreover, I have tried some codes here. It did not work too. there was no break when i drop a breakpoint at this event.
protected void btnCancelActivity_Click(object sender, EventArgs e)
{
string ActID = GridView1.SelectedRow.Cells[1].Text.ToString();
TextBox txtCancelDes = (TextBox)(this.FindControl("txtCancelDes"));
string Des = txtCancelDes.Text;
string CancelActivity;
CancelActivity = "UPDATE Activities SET Activity_Status = 'Canceled',Activity_CancelDes = '" + Des + "' WHERE Activity_ID = " + ActID + ";";
dbconn.QueryExecuteScalar(CancelActivity);
dbconn.Close();
MessageBox.Show("Done");
}
Is there any suggestion ? Thanks for your kindly help again
Cmajorros
9-Sep-12 13:59pm
View
Thanks you so much.
Cmajorros
9-Sep-12 10:46am
View
I have tried ,but there was an error about "smtp.Credentials = new NetworkCredential(fromAddress, fromPassword);" It show an error at NetworkCredential. Do I have to declare any namespaces? and how can i know what is my fromAddress and fromPassword. How can I get them ?
Show More