List<Dictionary<string, string>> result = new List<Dictionary<string, string>>();
#if DEBUG
- SqlConnection conn = new SqlConnection("Data Source=newton-cn.iptime.org, 1818; Initial Catalog=food; User ID=newton; Password=newton123!;");
+ SqlConnection conn = new SqlConnection("Data Source=newton-cn1.iptime.org, 1818; Initial Catalog=food; User ID=newton; Password=newton123!;");
#else
SqlConnection conn = new SqlConnection("Data Source=localhost; Initial Catalog=food; User ID=newton; Password=newton123!;");
#endif
string sql = "";
sql += @"
select
- a1.pr_name, a2.kind_name, a1.pr_order, a2.kind_order, a1.pr_price1
+ a1.pr_name, a2.kind_name, a1.pr_order, a2.kind_order, a1.pr_price1, isnull(a3.location, '') as pr_location, a1.pr_code
from
pr a1
join kind a2
on a1.kind_code = a2.kind_code
+ left join pr_location a3
+ on a1.pr_code= a3.pr_code
where
pr_name like '%" + item + @"%' and
kind_visible = 0 and pr_visible= 0";
dict["kind_name"] = rd["kind_name"].ToString();
dict["pr_order"] = rd["pr_order"].ToString();
dict["kind_order"] = rd["kind_order"].ToString();
+ dict["pr_location"] = rd["pr_location"].ToString();
+ dict["pr_code"] = rd["pr_code"].ToString();
result.Add(dict);
}
int result = 0;
#if DEBUG
- SqlConnection conn = new SqlConnection("Data Source=newton-cn1.duckdns.org, 1818; Initial Catalog=food; User ID=newton; Password=newton123!;");
+ SqlConnection conn = new SqlConnection("Data Source=newton-cn1.iptime.org, 1818; Initial Catalog=food; User ID=newton; Password=newton123!;");
#else
SqlConnection conn = new SqlConnection("Data Source=localhost; Initial Catalog=food; User ID=newton; Password=newton123!;");
#endif
return result;
}
+
+ public int setLocation(string pr_code, string location)
+ {
+#if DEBUG
+ SqlConnection conn = new SqlConnection("Data Source=newton-cn1.iptime.org, 1818; Initial Catalog=food; User ID=newton; Password=newton123!;");
+#else
+ SqlConnection conn = new SqlConnection("Data Source=localhost; Initial Catalog=food; User ID=newton; Password=newton123!;");
+#endif
+
+ conn.Open();
+
+ string sql = "";
+ sql += @"
+ update pr_location set location='" + location + @"' where pr_code= '" + pr_code + @"'
+ IF @@ROWCOUNT=0
+ insert into pr_location values('" + location + @"', '" + pr_code + @"');
+ ";
+
+ SqlCommand cmd_select = new SqlCommand(sql, conn);
+
+ int result = cmd_select.ExecuteNonQuery();
+
+ return result;
+
+ }
}
}
this.textBox1 = new System.Windows.Forms.TextBox();
this.listView1 = new System.Windows.Forms.ListView();
this.button2 = new System.Windows.Forms.Button();
+ this.button1 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// button3
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
+ // button1
+ //
+ this.button1.Font = new System.Drawing.Font("굴림", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
+ this.button1.Location = new System.Drawing.Point(12, 396);
+ this.button1.Name = "button1";
+ this.button1.Size = new System.Drawing.Size(130, 30);
+ this.button1.TabIndex = 5;
+ this.button1.Text = "상품위치설정";
+ this.button1.UseVisualStyleBackColor = true;
+ this.button1.Click += new System.EventHandler(this.button1_Click);
+ //
// Form2
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.SystemColors.HighlightText;
this.ClientSize = new System.Drawing.Size(800, 450);
+ this.Controls.Add(this.button1);
this.Controls.Add(this.listView1);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.ListView listView1;
private System.Windows.Forms.Button button2;
+ private System.Windows.Forms.Button button1;
}
}
\ No newline at end of file
listView1.FullRowSelect = true;
listView1.Columns.Add("소속메뉴", 200);
- listView1.Columns.Add("액상이름", 400);
- listView1.Columns.Add("가격", 200);
+ listView1.Columns.Add("액상이름", 370);
+ listView1.Columns.Add("가격", 110);
+ listView1.Columns.Add("위치", 100);
listView1.Columns.Add("액상위치", 50);
listView1.Columns.Add("메뉴위치", 50);
+ listView1.Columns.Add("prcode", 1);
this.ActiveControl = textBox1;
}
list[i]["kind_name"],
list[i]["pr_name"],
list[i]["pr_price1"],
+ list[i]["pr_location"],
list[i]["pr_order"],
- list[i]["kind_order"]
+ list[i]["kind_order"],
+ list[i]["pr_code"]
};
ListViewItem lvi = new ListViewItem(item);
listView1.Items.Add(lvi);
for (int i=0; i<listView1.Columns.Count; i++)
{
- if (i == 3)
+ if (i == 4)
{
pr = Int32.Parse(item.SubItems[i].Text);
}
- else if (i == 4)
+ else if (i == 5)
{
kind = Int32.Parse(item.SubItems[i].Text);
}
{
}
+
+ private void button1_Click(object sender, EventArgs e)
+ {
+ int pr = 0;
+ int kind = 0;
+ string prcode = "";
+ string location = "";
+ ListView.SelectedListViewItemCollection selected = listView1.SelectedItems;
+ foreach (ListViewItem item in selected)
+ {
+
+ for (int i = 0; i < listView1.Columns.Count; i++)
+ {
+ if (i == 4)
+ {
+ pr = Int32.Parse(item.SubItems[i].Text);
+ }
+ else if (i == 5)
+ {
+ kind = Int32.Parse(item.SubItems[i].Text);
+ }
+ else if (i == 3)
+ {
+ location = item.SubItems[i].Text.ToString();
+ }
+ else if (i == 6)
+ {
+ prcode = item.SubItems[i].Text.ToString();
+ }
+
+ }
+ }
+
+ if (pr == 0 && kind == 0)
+ {
+ MessageBox.Show("설정 할 제품이 선택되지 않았습니다.");
+ textBox1.Focus();
+ return;
+ }
+ Form4 dlg = new Form4();
+ dlg.setPr(prcode, location);
+
+ dlg.ShowDialog();
+
+ }
}
}
--- /dev/null
+
+namespace newton_cn
+{
+ partial class Form4
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.textBox1 = new System.Windows.Forms.TextBox();
+ this.button1 = new System.Windows.Forms.Button();
+ this.button2 = new System.Windows.Forms.Button();
+ this.textBox2 = new System.Windows.Forms.TextBox();
+ this.label1 = new System.Windows.Forms.Label();
+ this.SuspendLayout();
+ //
+ // textBox1
+ //
+ this.textBox1.Location = new System.Drawing.Point(79, 12);
+ this.textBox1.Name = "textBox1";
+ this.textBox1.Size = new System.Drawing.Size(35, 21);
+ this.textBox1.TabIndex = 0;
+ this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged);
+ //
+ // button1
+ //
+ this.button1.Location = new System.Drawing.Point(39, 46);
+ this.button1.Name = "button1";
+ this.button1.Size = new System.Drawing.Size(75, 23);
+ this.button1.TabIndex = 3;
+ this.button1.Text = "취소";
+ this.button1.UseVisualStyleBackColor = true;
+ this.button1.Click += new System.EventHandler(this.button1_Click);
+ //
+ // button2
+ //
+ this.button2.Location = new System.Drawing.Point(143, 46);
+ this.button2.Name = "button2";
+ this.button2.Size = new System.Drawing.Size(75, 23);
+ this.button2.TabIndex = 2;
+ this.button2.Text = "적용";
+ this.button2.UseVisualStyleBackColor = true;
+ this.button2.Click += new System.EventHandler(this.button2_Click);
+ //
+ // textBox2
+ //
+ this.textBox2.Location = new System.Drawing.Point(143, 12);
+ this.textBox2.Name = "textBox2";
+ this.textBox2.Size = new System.Drawing.Size(45, 21);
+ this.textBox2.TabIndex = 1;
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Location = new System.Drawing.Point(126, 15);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(11, 12);
+ this.label1.TabIndex = 4;
+ this.label1.Text = "-";
+ //
+ // Form4
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(258, 81);
+ this.ControlBox = false;
+ this.Controls.Add(this.label1);
+ this.Controls.Add(this.textBox2);
+ this.Controls.Add(this.button2);
+ this.Controls.Add(this.button1);
+ this.Controls.Add(this.textBox1);
+ this.Name = "Form4";
+ this.Text = "위치설정";
+ this.Load += new System.EventHandler(this.Form4_Load);
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.TextBox textBox1;
+ private System.Windows.Forms.Button button1;
+ private System.Windows.Forms.Button button2;
+ private System.Windows.Forms.TextBox textBox2;
+ private System.Windows.Forms.Label label1;
+ }
+}
\ No newline at end of file
--- /dev/null
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+
+namespace newton_cn
+{
+ public partial class Form4 : Form
+ {
+ private string prcode= "";
+ private string location = "";
+ public Form4()
+ {
+ InitializeComponent();
+ }
+
+ public void setPr(string prcode, string location)
+ {
+ this.prcode = prcode;
+ this.location = location;
+ }
+
+ private void Form4_Load(object sender, EventArgs e)
+ {
+ string[] location = this.location.Split('-');
+
+ if (location.Length != 1)
+ {
+ textBox1.Text = location[0];
+ textBox2.Text = location[1];
+ }
+
+
+ }
+
+ private void button2_Click(object sender, EventArgs e)
+ {
+ if (String.Equals(this.prcode, ""))
+ {
+ MessageBox.Show(new Form { TopMost = true }, "오류발생 처음부터 다시 시도해주세요");
+ Application.OpenForms["Form4"].Close();
+ return;
+ }
+ DBConnector db = new DBConnector();
+ string location1 = textBox1.Text;
+ string location2 = textBox2.Text;
+
+
+ int result = db.setLocation(this.prcode, location1 + "-" + location2);
+ if (result == 1)
+ {
+ MessageBox.Show(new Form { TopMost = true }, "적용완료");
+ Application.OpenForms["Form4"].Close();
+ Application.OpenForms["Form2"].Close();
+ return;
+ }
+ else
+ {
+ MessageBox.Show(new Form { TopMost = true }, "오류발생 처음부터 다시 시도해주세요");
+ Application.OpenForms["Form4"].Close();
+ Application.OpenForms["Form2"].Close();
+ return;
+ }
+ }
+
+ private void button1_Click(object sender, EventArgs e)
+ {
+ Application.OpenForms["Form4"].Close();
+ }
+
+ private void textBox1_TextChanged(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root>
\ No newline at end of file
<Compile Include="Form3.Designer.cs">
<DependentUpon>Form3.cs</DependentUpon>
</Compile>
+ <Compile Include="Form4.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="Form4.Designer.cs">
+ <DependentUpon>Form4.cs</DependentUpon>
+ </Compile>
<Compile Include="MouseEvent2.cs" />
<Compile Include="MouseEvent1.cs" />
<Compile Include="DBConnector.cs" />
<EmbeddedResource Include="Form3.resx">
<DependentUpon>Form3.cs</DependentUpon>
</EmbeddedResource>
+ <EmbeddedResource Include="Form4.resx">
+ <DependentUpon>Form4.cs</DependentUpon>
+ </EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
-56ead392093dad3d616723a23a90b2613ebdf9c3
+a57cd293bb18147329b91cd138d49d97ab5de67e
z:\바탕 화면\insang\workspace\newton-cn_pos\newton-cn\obj\Debug\newton-cn.csproj.CoreCompileInputs.cache
z:\바탕 화면\insang\workspace\newton-cn_pos\newton-cn\obj\Debug\newton-cn.exe
z:\바탕 화면\insang\workspace\newton-cn_pos\newton-cn\obj\Debug\newton-cn.pdb
+z:\바탕 화면\insang\workspace\newton-cn_pos\newton-cn\obj\Debug\newton_cn.Form4.resources
-a8f2a865f4323c7953761747d6204465cd75e02c
+2fd756779f42ac4ce5b36cc48039c820d2627401
z:\바탕 화면\insang\workspace\newton-cn_pos\newton-cn\obj\Release\newton-cn.exe
z:\바탕 화면\insang\workspace\newton-cn_pos\newton-cn\obj\Release\newton-cn.pdb
z:\바탕 화면\insang\workspace\newton-cn_pos\newton-cn\obj\Release\newton_cn.Form3.resources
+z:\바탕 화면\insang\workspace\newton-cn_pos\newton-cn\obj\Release\newton_cn.Form4.resources