Permalink
Browse files

Merge branch 'master' of https://github.com/phiree/namename

  • Loading branch information...
2 parents 72216fd + 651e4bf commit e925630ba2a39b09f0d86564c3dc27f7be3ad7c2 @phiree committed Jun 2, 2012
Showing with 103 additions and 60 deletions.
  1. +1 −0 ShopClient/Cash.Designer.cs
  2. +42 −0 ShopClient/Cash.cs
  3. +1 −0 ShopClient/Login.cs
  4. +40 −40 ShopClient/Program.cs
  5. +16 −16 ShopClient/ShopSelect.Designer.cs
  6. +3 −4 ShopClient/ShopSelect.cs

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -6,14 +6,56 @@
using System.Linq;
using System.Text;
using System.Windows.Forms;
+using NameName.DAL;
+using NameName.Model;
namespace ShopClient
{
public partial class Cash : Form
{
public Cash()
{
+ ClientLogin();
InitializeComponent();
}
+
+ private void Cash_Load(object sender, EventArgs e)
+ {
+
+ }
+
+ private void ClientLogin()
+ {
+
+
+ string strShopId = Properties.Settings.Default.ShopId;
+
+ if (string.IsNullOrEmpty(strShopId))
+ {
+ new ShopSelect().ShowDialog();
+ }
+ else
+ {
+ Guid shopId;
+ Guid.TryParse(strShopId, out shopId);
+ if (shopId != Guid.Empty)
+ {
+ ShopInfo shop = new DALShopInfo().GetByShopID(shopId);
+ if (shop == null)
+ {
+ new ShopSelect().ShowDialog();
+ }
+ else
+ {
+ GlobalValue.ShopID = shop.ShopID;
+ new UserSelect().ShowDialog();
+ }
+ }
+ else
+ {
+ new ShopSelect().ShowDialog();
+ }
+ }
+ }
}
}
View
@@ -42,6 +42,7 @@ private void Login_Load(object sender, EventArgs e)
private void btnClear_Click(object sender, EventArgs e)
{
tbxPwd.Text = string.Empty;
+
}
private void button4_Click(object sender, EventArgs e)
View
@@ -17,55 +17,55 @@ static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
- //InitClient();
- Application.Run(new ShopSelect());
+
+ Application.Run(new Cash());
}
/// <summary>
/// 之前是否已经选择过.
/// 是:读取配置信息 直接打开登录界面
/// 否:打开选择页面
/// </summary>
- private static void InitClient()
- {
- bool HasSelected = false;
- string strShopId = Properties.Settings.Default.ShopId;
- Application.Run(new ShopSelect());
- return;
- if (string.IsNullOrEmpty(strShopId))
- {
- HasSelected = false;
+ //private static void InitClient()
+ //{
+ // bool HasSelected = false;
+ // string strShopId = Properties.Settings.Default.ShopId;
+ // Application.Run(new ShopSelect());
+ // return;
+ // if (string.IsNullOrEmpty(strShopId))
+ // {
+ // HasSelected = false;
- }
- else
- {
+ // }
+ // else
+ // {
- Guid shopId;
- Guid.TryParse(strShopId, out shopId);
- if (shopId != Guid.Empty)
- {
- ShopInfo shop = new DALShopInfo().GetByShopID(shopId);
- if (shop == null)
- {
- HasSelected = false;
- }
- else
- {
- HasSelected = true;
- GlobalValue.ShopID = shop.ShopID;
- Application.Run(new Login());
- }
- }
- else
- {
- HasSelected = false;
- }
- }
- if (!HasSelected)
- {
- Application.Run(new ShopSelect());
+ // Guid shopId;
+ // Guid.TryParse(strShopId, out shopId);
+ // if (shopId != Guid.Empty)
+ // {
+ // ShopInfo shop = new DALShopInfo().GetByShopID(shopId);
+ // if (shop == null)
+ // {
+ // HasSelected = false;
+ // }
+ // else
+ // {
+ // HasSelected = true;
+ // GlobalValue.ShopID = shop.ShopID;
+ // Application.Run(new Login());
+ // }
+ // }
+ // else
+ // {
+ // HasSelected = false;
+ // }
+ // }
+ // if (!HasSelected)
+ // {
+ // Application.Run(new ShopSelect());
- }
+ // }
- }
+ //}
}
}

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -46,7 +46,7 @@ public void LoadShops(AreaInfo area, TabPage tp)
GridBuilder<ShopInfo> g = new GridBuilder<ShopInfo>(d, new Size(100, 100), tp, 10, 20, 20);
g.OnBindButtonClick += new GridBuilder<ShopInfo>.BindButtonClick(g_OnBindButtonClick);
- g.BuildButtons();
+ g.BuildButtons();
}
void g_OnBindButtonClick(Button b)
@@ -62,9 +62,8 @@ void btn_Click(object sender, EventArgs e)
P.Settings.Default.Save();
GlobalValue.ShopID = shop.ShopID;
-
+ this.Close();
new UserSelect().ShowDialog();
-
}
private void ShopSelect_Load(object sender, EventArgs e)
@@ -79,7 +78,7 @@ private void label1_Click(object sender, EventArgs e)
private void button1_Click(object sender, EventArgs e)
{
- this.Close();
+ Application.Exit();
}
}
}

0 comments on commit e925630

Please sign in to comment.