Aland Sabr Maruf
Aland Sabr Maruf
Aland Sabr Maruf
use Retail;
create table Login(
id int identity primary key,
username varchar(50),
passwordd varchar(50),
adminrole varchar(50)
);
select * from Login;
);
create table SoldProducts(
productid int identity primary key,
Barcode varchar(50),
sellprice varchar(50),
qty int,
ExpDate date
);
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
}
cmd.Parameters.AddWithValue("@ExpDate",datetimeexp.value.ToString("yyyy/MM/dd");
cmd.ExecuteNonQuery();
con.Close();
ShowData();
}
catch(Exception ex){
MessageBox.Show(ex.Message);
// koy Gshtyaka
private void dataGridView1_RowsAdded(object sender,
DataGridViewRowsAddedEventArgs e)
{
int Summ=0;
for(int i=0; i<dataGridView1.Rows.Count; i++){
Summ=Summ+Convert.ToInt16(dataGridView1.Rows[i].Cells[1].Value);
}
txtsumall.Text=Summ.ToString();
}
}
//Form Login Code
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace WindowsFormsApplication1
{
public partial class Form2 : Form
{
//form 2 login
public Form2()
{
InitializeComponent();
}
rdr.Read();
name=rdr.["username"].ToString();
pass=rdr.["passwordd"].ToString();
if(adtype=="Admin"){
Form1 froshtn = new Form1();
froshtn.Show();
}
else{
MessageBox.Show("error login please Only Users register Admin
Role");
}
con.Close();
}
catch(Exception ex){
MessageBox.Show(ex.Message);
}
}
}
}