コード例 #1
0
ファイル: Form1.cs プロジェクト: miretteamin/SunStore
 private void SunStoreDisconnectedModefrm_Load_1(object sender, EventArgs e)
 {
     LoadIDs();
     LoadData();
     ProductIDcbx.Hide();
     ProductsIDlbl.Hide();
     ProductNametxt.Hide();
     ProductNamelbl.Hide();
     Pricetxt.Hide();
     Pricelbl.Hide();
     btn.Hide();
     btn.Text = "";
 }
コード例 #2
0
 private void ProductNametxt_TextChanged(object sender, EventArgs e)
 {
     if (ProductNametxt.Text.Length <= 0)
     {
         ProductNametxt.Focus();
         SaveChangebtn.Enabled = false;
         return;
     }
     else
     {
         SaveChangebtn.Enabled = true;
         return;
     }
 }
コード例 #3
0
ファイル: Form1.cs プロジェクト: miretteamin/SunStore
 private void Searchbtn_CheckedChanged_1(object sender, EventArgs e)
 {
     if (Searchbtn.Checked == true)
     {
         ProductIDcbx.Hide();
         ProductsIDlbl.Hide();
         ProductNametxt.Show();
         ProductNamelbl.Show();
         Pricetxt.Show();
         Pricelbl.Show();
         btn.Show();
         btn.Text = "Search";
     }
 }
コード例 #4
0
ファイル: Form1.cs プロジェクト: miretteamin/SunStore
 private void DELradiobtn_CheckedChanged(object sender, EventArgs e)
 {
     if (DELradiobtn.Checked == true)
     {
         ProductIDcbx.Show();
         ProductsIDlbl.Show();
         ProductNametxt.Hide();
         ProductNamelbl.Hide();
         Pricetxt.Hide();
         Pricelbl.Hide();
         btn.Show();
         btn.Text = "Delete";
     }
 }
コード例 #5
0
ファイル: Form1.cs プロジェクト: miretteamin/SunStore
 private void UPDradiobtn_CheckedChanged(object sender, EventArgs e)
 {
     if (UPDradiobtn.Checked == true)
     {
         ProductIDcbx.Show();
         ProductsIDlbl.Show();
         ProductNametxt.Show();
         ProductNamelbl.Show();
         Pricetxt.Show();
         Pricelbl.Show();
         btn.Show();
         btn.Text = "Edit";
     }
 }
コード例 #6
0
        private void AddNewItem_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(ProductNametxt.Text) || string.IsNullOrWhiteSpace(ProductIDtxt.Text) || string.IsNullOrWhiteSpace(DesignCodetxt.Text) || string.IsNullOrWhiteSpace(ColorTxt.Text) || string.IsNullOrWhiteSpace(NumberOfPiecesTxt.Text) || string.IsNullOrWhiteSpace(QuantityInStockTxt.Text) || string.IsNullOrWhiteSpace(ProductPriceTxt.Text) ||
                string.IsNullOrWhiteSpace(KameezaFabricTxt.Text) || string.IsNullOrWhiteSpace(ShalwarFabricTxt.Text) || string.IsNullOrWhiteSpace(DupattaFabricTxt.Text) || !IsImgUploaded)


            {
                MessageBox.Show("Please Fill All Fields And Mark Embroidery Status If Require");
            }
            else
            {
                try
                {
                    Admin.AddItem(ProductNametxt.Text, ProductIDtxt.Text, DesignCodetxt.Text, ColorTxt.Text, int.Parse(NumberOfPiecesTxt.Text), int.Parse(QuantityInStockTxt.Text), double.Parse(ProductPriceTxt.Text),
                                  KameezaFabricTxt.Text, ShalwarFabricTxt.Text, DupattaFabricTxt.Text, EmbroideryStatus.GetItemChecked(0),
                                  EmbroideryStatus.GetItemChecked(1), EmbroideryStatus.GetItemChecked(2), EmbroideryStatus.GetItemChecked(3),
                                  o1.FileName);



                    ProductPicture.Image = ProductPicture.InitialImage;
                    ProductNametxt.Clear();
                    ProductIDtxt.Clear();
                    DesignCodetxt.Clear();
                    ColorTxt.ResetText();
                    NumberOfPiecesTxt.ResetText();
                    QuantityInStockTxt.ResetText();
                    ProductPriceTxt.ResetText();
                    KameezaFabricTxt.ResetText();
                    ShalwarFabricTxt.ResetText();
                    DupattaFabricTxt.ResetText();
                    ProductPicture.Image = ProductPicture.InitialImage;
                    //EmbroideryStatus.Refresh();
                    for (int i = 0; i < EmbroideryStatus.Items.Count; i++)
                    {
                        EmbroideryStatus.SetItemChecked(i, false);
                    }
                }
                catch (System.Data.SqlClient.SqlException ex)
                {
                    if (ex.Number == 2627)
                    {
                        MessageBox.Show("Product Id Already Reserved for some other product please try some other Id");
                    }
                }
            }
        }
コード例 #7
0
 private void AddItemBtn_Click(object sender, EventArgs e)
 {
     ProductPicture.Image = ProductPicture.InitialImage;
     ProductNametxt.Clear();
     ProductIDtxt.Clear();
     DesignCodetxt.Clear();
     ColorTxt.ResetText();
     EmbroideryStatus.Refresh();
     AddItems.Show();
     AddItems.BringToFront();
     EditItem.TabStop       = false;
     ViewAccount.TabStop    = false;
     AccountSetting.TabStop = false;
     KameezaFabricTxt.Items.Clear();
     ShalwarFabricTxt.Items.Clear();
     DupattaFabricTxt.Items.Clear();
     ColorTxt.Items.Clear();
     Admin.ReadFabricInfo(ColorTxt, KameezaFabricTxt, ShalwarFabricTxt, DupattaFabricTxt);
 }