You are on page 1of 73

MEDICAL STORE MANAGEMENT SYSTEM

1. About the project:-


I prepare the project of medical on Window 7. Besacuse I have knowledge of C# and SQL
server it . Medical is very different type of subject there are many type of product in over
project and give a very smooth and very easy details in over project and also relative physical
details in customer project . It works on window 7 and appears version windows . It will be
developed for medical. It is user friendly all information is like English like language . There
for any user can easily use this project.

2. Existing System :-

 The existing system is manual .


 The manual system is more error prone.
 It is very costly.
 Immediate response to the queries is difficult and time consuming.
 Difficult to maintain record and more paper work is required.
 Report generation is difficult.
 The system is not sequred.
 More men power are needed.

3 . Objectives :-
 To provide computerised data storege facility.
 We can search easily any record.
 The new system requires less time for completion of any work.
 All the stock of medicine is update automatically in the new system.
 The system is user friendly and any one having computer knowledge
can handle it easily.
 Suitability for computerized data entry. Maintaining stock, Supplier
information,Customer information & bill information are easy.
 New system is provided security against unauthorized user.

1
MEDICAL STORE MANAGEMENT SYSTEM

2
MEDICAL STORE MANAGEMENT SYSTEM

3
MEDICAL STORE MANAGEMENT SYSTEM

4
MEDICAL STORE MANAGEMENT SYSTEM

5
MEDICAL STORE MANAGEMENT SYSTEM

6
MEDICAL STORE MANAGEMENT SYSTEM

7
MEDICAL STORE MANAGEMENT SYSTEM

8
MEDICAL STORE MANAGEMENT SYSTEM

9
MEDICAL STORE MANAGEMENT SYSTEM

10
MEDICAL STORE MANAGEMENT SYSTEM

11
MEDICAL STORE MANAGEMENT SYSTEM

12
MEDICAL STORE MANAGEMENT SYSTEM

13
MEDICAL STORE MANAGEMENT SYSTEM

Proecss Algorithm

Login Process :-
This process checks the authentication and admin can able to access the
application.

Purchase process :-
Supplier gives the information about purchase item information.

Stock Process :-
Stock gives the information about which current stock is available.

Sales Process:-
Admin enter the sales information also check the detail in retrieve from
the sales _Mst.

14
MEDICAL STORE MANAGEMENT SYSTEM

15
MEDICAL STORE MANAGEMENT SYSTEM

Proecss Algorithm

Step 1:- Start

Step 2:- Login

Step 3:- Enter valid Username & Password

Step 4:- Check available medicine stock

Step 5:- If medicine are available then medicine are sales and go Go to step 8 Else if
medicine are purchase and go to step 6

Step 6:- If medicine are Not available then medicine are Purchase and go Go to Step 8

Step7:- Update Stock

Step 8:- Generate Bill

Step 9:- Stop

16
MEDICAL STORE MANAGEMENT SYSTEM

17
MEDICAL STORE MANAGEMENT SYSTEM

FORM SPLASH

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;

namespace OmMedical
{
public partial class frmSplash : Form
{
public frmSplash()
{
InitializeComponent();
}

private void frmSplash_Load(object sender, EventArgs e)


{
progressBar1.Width = this.Width;
}

private void timer1_Tick(object sender, EventArgs e)


{
frmLogin frm = new frmLogin();
progressBar1.Visible = true;
this.progressBar1.Value = this.progressBar1.Value + 2;
if (this.progressBar1.Value == 10)
{
label1.Text = "Reading modules..";
}
else if (this.progressBar1.Value == 20)
{
label1.Text = "Turning on modules.";
}
else if (this.progressBar1.Value == 40)
{
label1.Text = "Starting modules..";
}
else if (this.progressBar1.Value == 60)
{
label1.Text = "Loading modules..";
}
else if (this.progressBar1.Value == 80)
{
label1.Text = "Done Loading modules..";

18
MEDICAL STORE MANAGEMENT SYSTEM

}
else if (this.progressBar1.Value == 100)
{
frm.Show();
timer1.Enabled = false;
this.Hide();
}
}
}
}

FRM LOGIN
using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Speech.Synthesis;
using Medical_BLL.Logic;
using Medical_BLL.Props;

namespace OmMedical
{
public partial class frmLogin : Form
{
SqlConnection con = null;
DataSet ds = new DataSet();
DataTable dt = new DataTable();
conn cs = new conn();
public static String Admin;
private StringBuilder errors;
private Regex validator;
public frmLogin()
{

InitializeComponent();
}
//private bool AreFieldsValid()
//{

19
MEDICAL STORE MANAGEMENT SYSTEM

// errors = new StringBuilder();

// validator = new Regex(@"^[0-9a-zA-Z\@\.]+$");

// if (!validator.IsMatch(txtpassword.Text))
// errors.AppendLine("Password is not in the proper formate.");

// if (errors.ToString() == String.Empty)
// {
// return true;
// }
// else
// {
// MessageBox.Show(errors.ToString(), "Validation
Failed",MessageBoxButtons.OK,MessageBoxIcon.Error);
// }

//}
private bool AreFieldsValid()
{

errors = new StringBuilder();

//Validate Address
validator = new Regex(@"^[0-9a-zA-Z\@\.]+$");

if (!validator.IsMatch(txtpassword.Text))
errors.AppendLine("Password is not in the proper format.");

if (errors.ToString() == String.Empty)
{
return true;
}
else
{
MessageBox.Show(errors.ToString(), "Validation Failed",
MessageBoxButtons.OK, MessageBoxIcon.Error);

return false;
}
}
public static string GetEncryptedPassword(string pstrStringToEncrypt)
{

if (string.IsNullOrEmpty(pstrStringToEncrypt))
throw (new ApplicationException("Argument cann't be null in the function
GetEncryptedPassword (Core Module / Security)"));

20
MEDICAL STORE MANAGEMENT SYSTEM

var md5 = MD5.Create();


var inputBytes = Encoding.UTF8.GetBytes(pstrStringToEncrypt);
var hash = md5.ComputeHash(inputBytes);

var sb = new StringBuilder();


foreach (var b in hash)
{
sb.Append(b.ToString("x2", System.Globalization.CultureInfo.InvariantCulture));
}
return sb.ToString();
}

private void getname()


{

try
{
using (con = new SqlConnection(cs.DBconn))
{
con.Open();
SqlCommand cmd = new SqlCommand("GetStatus", con);
cmd.Parameters.Add("@IP_NAME", SqlDbType.NVarChar, 50).Value =
txtusername.Text.Trim().ToUpper();
cmd.CommandType = CommandType.StoredProcedure;
SqlDataReader rdr = cmd.ExecuteReader();
while (rdr.Read())
{
label3.Text = (String)rdr["Isactive"];
label3.Text = label3.Text.Trim();
}
rdr.Dispose();
con.Close();
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error",MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
finally
{
con.Close();
}
}
private void button1_Click(object sender, EventArgs e)
{
if (txtusername.Text == "")
{

21
MEDICAL STORE MANAGEMENT SYSTEM

MessageBox.Show("Please enter user name", "Error", MessageBoxButtons.OK,


MessageBoxIcon.Error);
txtusername.Focus();
return;
}
if (txtpassword.Text == "")
{
MessageBox.Show("Please enter password", "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);
txtpassword.Focus();
return;
}
if (AreFieldsValid())
{

Cloginlogic lobj = new Cloginlogic();


CloginProps pobj = new CloginProps();
pobj.UserName = txtusername.Text.Trim().ToUpper();
String lstrPassword = GetEncryptedPassword(txtpassword.Text.Trim());
pobj.Password = lstrPassword;
pobj = lobj.LoginUser(pobj);
if (pobj.OpErrorCode == "0")
{
getname();
if (label3.Text == "Y")
{
//DateTime date = DateTime.Now;
//DateTime start = new DateTime(2014, 7, 1);
//DateTime end = start.AddMonths(12).AddDays(-1);

//if (end >= date)


//{
this.Hide();
frmMainMenu frm = new frmMainMenu();
//speak();
frm.Show();

//}
//else
//{
// MessageBox.Show("Your Licence is expired", "Error",
MessageBoxButtons.OK, MessageBoxIcon.Error);

//}
}
else
{
if (label3.Text == "F")

22
MEDICAL STORE MANAGEMENT SYSTEM

{
txtpassword.Text = "";
frmforgetPassword frm = new frmforgetPassword();
frm.ShowDialog();

}
else
{

}
}

}
else
{

txtusername.Text = "";
txtpassword.Text = "";
MessageBox.Show("Login Failed...Try again !", "Login Denied",
MessageBoxButtons.OK, MessageBoxIcon.Error);
txtusername.Focus();
}

}
}

private void frmLogin_Load(object sender, EventArgs e)


{
try
{
txtusername.Text = "";
txtpassword.Text = "";
txtusername.Focus();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
finally
{

}
}

private void frmLogin_FormClosing(object sender, FormClosingEventArgs e)


{
System.Windows.Forms.Application.ExitThread();

23
MEDICAL STORE MANAGEMENT SYSTEM

System.Windows.Forms.Application.Exit();
}

private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


{
try
{
Admin = txtusername.Text.Trim();
this.Hide();
frmforgetPassword frm = new frmforgetPassword();
frm.Show();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);

}
finally
{

}
}

}
}

FRM FORGETPASSWORD

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace OmMedical
{
public partial class frmforgetPassword : Form
{
public static String Admin;
SqlConnection con = null;
DataSet ds = new DataSet();

24
MEDICAL STORE MANAGEMENT SYSTEM

DataTable dt = new DataTable();


conn cs = new conn();
public frmforgetPassword()
{
if (frmLogin.Admin != null)
{
Admin = frmLogin.Admin;
}
InitializeComponent();
}
private void getname()
{

try
{
using (con = new SqlConnection(cs.DBconn))
{
con.Open();
SqlCommand cmd = new SqlCommand("Proc_GetUserName", con);
SqlDataReader rdr = cmd.ExecuteReader();
while (rdr.Read())
{
txtname.Text = (String)rdr["User_Name"];
txtname.Text = txtname.Text.Trim();
}
rdr.Dispose();
con.Close();
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
finally
{
con.Close();
}
}
private void frmforgetPassword_Load(object sender, EventArgs e)
{
getname();
}

private void btnChangePassword_Click(object sender, EventArgs e)


{
if (txtpassword.Text != "" && txtconfirmpassword.Text != "")
{
try
{

25
MEDICAL STORE MANAGEMENT SYSTEM

con = new SqlConnection(cs.DBconn);


con.Open();
string texoldname = txtname.Text;
Regex reg = new Regex(@"^[0-9a-zA-Z\.]{1,50}$");
if (reg.IsMatch(texoldname))
{
string texdname = txtpassword.Text;
Regex reg1 = new Regex(@"^[0-9a-zA-Z\.]{1,20}$");
if (reg1.IsMatch(texdname))
{
string textconf = txtconfirmpassword.Text;
Regex reg2 = new Regex(@"^[0-9a-zA-Z\.]{1,20}$");
if (reg2.IsMatch(textconf))
{
if (txtpassword.Text == txtconfirmpassword.Text)
{
string newpass = GetEncryptedPassword(txtpassword.Text.Trim());
SqlCommand cmd = new SqlCommand("Proc_Updatepassword",
con);
cmd.Parameters.Add("@IP_Name", SqlDbType.NVarChar, 50).Value
= txtname.Text.Trim().ToUpper();
cmd.Parameters.Add("@IP_newpassword", SqlDbType.NVarChar,
100).Value = newpass.Trim();
cmd.CommandType = CommandType.StoredProcedure;
int count = cmd.ExecuteNonQuery();
if (count == 1)
{

//this.Close();
MessageBox.Show("your new password = "+ txtpassword.Text + "",
"Result", MessageBoxButtons.OK, MessageBoxIcon.Information);
frmLogin frm = new frmLogin();
frm.Show();
this.Close();

}
else
{

MessageBox.Show("your password not changed", "Error",


MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
else
{
txtpassword.Text = "";
txtconfirmpassword.Text = "";

26
MEDICAL STORE MANAGEMENT SYSTEM

MessageBox.Show("new password and confirm password do not


match", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
else
{

MessageBox.Show("Confrim password not in correct format", "Error",


MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
else
{

MessageBox.Show("new password not in correct format", "Error",


MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
else
{

MessageBox.Show("Answer not in correct format", "Error",


MessageBoxButtons.OK, MessageBoxIcon.Error);
}

catch (Exception ex)


{
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
finally
{

con.Close();
}
}
else
{

MessageBox.Show("Please enter text in Answer and new password and confrim


name", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
public static string GetEncryptedPassword(string pstrStringToEncrypt)
{

27
MEDICAL STORE MANAGEMENT SYSTEM

if (string.IsNullOrEmpty(pstrStringToEncrypt))
throw (new ApplicationException("Argument cann't be null in the function
GetEncryptedPassword (Core Module / Security)"));

var md5 = MD5.Create();


var inputBytes = Encoding.UTF8.GetBytes(pstrStringToEncrypt);
var hash = md5.ComputeHash(inputBytes);

var sb = new StringBuilder();


foreach (var b in hash)
{
sb.Append(b.ToString("x2", System.Globalization.CultureInfo.InvariantCulture));
}
return sb.ToString();
}

private void frmforgetPassword_FormClosing(object sender, FormClosingEventArgs e)


{
try
{
this.Hide();
frmLogin frm = new frmLogin();
frm.ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
finally
{

}
}
}
}

FRM PURCHASE
using Medical_BLL.Logic;
using Medical_BLL.Props;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;

28
MEDICAL STORE MANAGEMENT SYSTEM

using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace OmMedical
{
public partial class frmMedicanPurchase : Form
{
DataTable dtable = new DataTable();
SqlConnection con = null;
DataSet ds = new DataSet();
public static string ID;
DataTable dt = new DataTable();
conn cs = new conn();
public frmMedicanPurchase()
{
InitializeComponent();
}

private void frmMedicanPurchase_Load(object sender, EventArgs e)


{
addbuttongirdtransction();
dataGridView1.Visible = false;
getMedicanRegistred();

private void addbuttongirdtransction()


{
DataGridViewLinkColumn Showlink = new DataGridViewLinkColumn();
Showlink.UseColumnTextForLinkValue = true;
Showlink.HeaderText = "Edit";
Showlink.Width = 60;
Showlink.DataPropertyName = "lnkColumn";
Showlink.LinkBehavior = LinkBehavior.SystemDefault;
Showlink.Text = "Edit";
dataGridView1.Columns.Add(Showlink);

}
private void getMedicanRegistred()
{

try
{

con = new SqlConnection(cs.DBconn);


con.Open();
DataSet ds = new DataSet();
SqlCommand cmd3 = new SqlCommand("Proc_GetRegistredMedican", con);

29
MEDICAL STORE MANAGEMENT SYSTEM

cmd3.Parameters.Add("@IP_MedicanName", SqlDbType.NVarChar, 50).Value =


txtMname.Text;
cmd3.CommandType = CommandType.StoredProcedure;
SqlDataAdapter da = new SqlDataAdapter(cmd3);
da.Fill(ds);
dataGridView1.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.75F,
System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
dataGridView1.DataSource = ds.Tables[0];
dataGridView1.Columns[0].HeaderText = "Edit";
dataGridView1.Columns[1].HeaderText = "Id";
dataGridView1.Columns[2].HeaderText = "Medican_Name";
dataGridView1.Columns[3].HeaderText = "Drug";
dataGridView1.Columns[4].HeaderText = "Batch_Number";
dataGridView1.Columns[5].HeaderText = "Quantity";
dataGridView1.Columns[6].HeaderText = "MFG_Date";
dataGridView1.Columns[7].HeaderText = "Expire_Date";
dataGridView1.Columns[8].HeaderText = "Sale_Rate";
dataGridView1.Columns[9].HeaderText = "Purchase_Rate";
dataGridView1.AutoGenerateColumns = false;
dataGridView1.AllowUserToAddRows = false;
dataGridView1.Columns[0].Width = 70;
dataGridView1.Columns[1].Width = 70;
dataGridView1.Columns[2].Width = 180;
dataGridView1.Columns[3].Width = 100;
dataGridView1.Columns[4].Width = 80;
dataGridView1.Columns[5].Width = 100;
dataGridView1.Columns[6].Width = 100;
dataGridView1.Columns[7].Width = 100;
dataGridView1.Columns[8].Width = 90;
dataGridView1.Columns[9].Width = 90;
ds.Dispose();

}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
finally
{
con.Close();
}
}
private void Save()
{
if (txtMname.Text == "")
{

30
MEDICAL STORE MANAGEMENT SYSTEM

MessageBox.Show("Please enter Medican name", "Error",


MessageBoxButtons.OK, MessageBoxIcon.Error);
txtMname.Focus();
return;
}
if (txtsalt.Text == "")
{
MessageBox.Show("Please enter Saltdrug name", "Error",
MessageBoxButtons.OK, MessageBoxIcon.Error);
txtsalt.Focus();
return;
}
if (txtbatch.Text == "")
{
MessageBox.Show("Please enter batch number", "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);
txtbatch.Focus();
return;
}
if (txtquantity.Text == "")
{
MessageBox.Show("please enter Quanitity", "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);
txtquantity.Focus();
return;
}
if (txtMRP.Text == "")
{
MessageBox.Show("Please enter MRP of product", "Error",
MessageBoxButtons.OK, MessageBoxIcon.Error);
txtMRP.Focus();
return;
}
if (txtprate.Text == "")
{
MessageBox.Show("Please enter price of product", "Error",
MessageBoxButtons.OK, MessageBoxIcon.Error);
txtprate.Focus();
return;
}
if (txtGST.Text == "")
{
MessageBox.Show("Please enter GST rate ", "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);
txtGST.Focus();
return;
}
if (txtHSN.Text == "")
{

31
MEDICAL STORE MANAGEMENT SYSTEM

MessageBox.Show("Please enter HSN Number ", "Error",


MessageBoxButtons.OK, MessageBoxIcon.Error);
txtHSN.Focus();
return;
}

String date = DateTime.Now.ToString("dd/MM/yyyy");


CMedicanPurchaseProps pobj = new CMedicanPurchaseProps();
CMPurchaseLogic lobj = new CMPurchaseLogic();
pobj.MedicanName = txtMname.Text.Trim();
pobj.Drug = txtsalt.Text.Trim();
pobj.BatchNumber = txtbatch.Text.Trim();
pobj.Quantity = txtquantity.Text.Trim();
pobj.PurchaseRate = Convert.ToDecimal(txtprate.Text.Trim());
pobj.PurchaseDate = date;
pobj.MFGDate = Mfgdate.Text.Trim();
pobj.ExpireDate = EXPdate.Text.Trim();
pobj.SaleRate = Convert.ToDecimal(txtMRP.Text.Trim());
pobj.GST = txtGST.Text.Trim();
pobj.HSN = txtHSN.Text.Trim();
pobj = lobj.MedicanPurchase(pobj);
if (pobj.OpErrorCode == "0")
{
MessageBox.Show("Record insert successfuly", "Result",
MessageBoxButtons.OK, MessageBoxIcon.Information);
dataGridView1.Visible = true;
getMedicanRegistred();

}
else
if (pobj.OpErrorCode == "3")
{
MessageBox.Show("Duplicate Entry", "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
else
{
MessageBox.Show("Record not insert", "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);

private void button1_Click_1(object sender, EventArgs e)


{
Save();
}

32
MEDICAL STORE MANAGEMENT SYSTEM

private void button2_Click_1(object sender, EventArgs e)


{
txtMname.Clear();
txtMname.Focus();
txtsalt.Clear();
txtbatch.Clear();
txtprate.Clear();
txtquantity.Clear();
}

private void dataGridView1_CellContentClick_1(object sender,


DataGridViewCellEventArgs e)
{
if (e.ColumnIndex == 0)
{
if (MessageBox.Show("Do you really want to edit this record?", "Confirmation",
MessageBoxButtons.YesNo, MessageBoxIcon.Question) ==
System.Windows.Forms.DialogResult.Yes)
{

ID = Convert.ToString(dataGridView1.Rows[e.RowIndex].Cells["Id"].Value);
this.Hide();
frmEditMedican frm = new frmEditMedican();
frm.ShowDialog();

}
}
}

private void label5_Click(object sender, EventArgs e)


{

private void txtMRP_TextChanged(object sender, EventArgs e)


{

private void frmMedicanPurchase_FormClosing(object sender, FormClosingEventArgs


e)
{
try
{
this.Hide();
frmMainMenu frm = new frmMainMenu();
frm.ShowDialog();
}

33
MEDICAL STORE MANAGEMENT SYSTEM

catch (Exception ex)


{
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
finally
{

}
}
}
}

FRM EDIT PURCHASE


using Medical_BLL.Logic;
using Medical_BLL.Props;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace OmMedical
{
public partial class frmEditMedican : Form
{
public static string Id;
SqlConnection con=null;
conn cs = new conn();
public frmEditMedican()
{
if (frmMedicanPurchase.ID != null)
{
Id = frmMedicanPurchase.ID;
}
InitializeComponent();
}

private void GetMedicanName()


{
try
{
using (con = new SqlConnection(cs.DBconn))

34
MEDICAL STORE MANAGEMENT SYSTEM

{
con.Open();
DataSet ds1 = new DataSet();
SqlCommand cmd = new SqlCommand("Proc_GetMedicanDetails", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@IP_MedicanId", SqlDbType.Int, 50).Value = Id;
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(ds1);
if (ds1.Tables[0].Rows.Count > 0)
{
lblid.Text = Convert.ToString(ds1.Tables[0].Rows[0]["Id"]);
txtMname.Text =
Convert.ToString(ds1.Tables[0].Rows[0]["Medican_Name"]);
txtsalt.Text = Convert.ToString(ds1.Tables[0].Rows[0]["Drug"]);
txtbatch.Text = Convert.ToString(ds1.Tables[0].Rows[0]["Batch_Number"]);
txtquantity.Text = Convert.ToString(ds1.Tables[0].Rows[0]["Quantity"]);
txtprate.Text = Convert.ToString(ds1.Tables[0].Rows[0]["Purchase_Rate"]);
txtMRP.Text = Convert.ToString(ds1.Tables[0].Rows[0]["Sale_Rate"]);
Mfgdate.Text = Convert.ToString(ds1.Tables[0].Rows[0]["MFG_Date"]);
EXPdate.Text = Convert.ToString(ds1.Tables[0].Rows[0]["Expire_Date"]);
txtGST.Text=Convert.ToString(ds1.Tables[0].Rows[0]["GST"]);
txtHSN.Text = Convert.ToString(ds1.Tables[0].Rows[0]["HSN"]);

}
}

}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
finally
{
con.Close();
}
}

private void frmEditMedican_Load(object sender, EventArgs e)


{
GetMedicanName();
}

private void Save()


{
if (txtMname.Text == "")
{
MessageBox.Show("Please enter Medican name", "Error",
MessageBoxButtons.OK, MessageBoxIcon.Error);
txtMname.Focus();

35
MEDICAL STORE MANAGEMENT SYSTEM

return;
}
if (txtsalt.Text == "")
{
MessageBox.Show("Please enter Saltdrug name", "Error",
MessageBoxButtons.OK, MessageBoxIcon.Error);
txtsalt.Focus();
return;
}
if (txtbatch.Text == "")
{
MessageBox.Show("Please enter batch number", "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);
txtbatch.Focus();
return;
}
if (txtquantity.Text == "")
{
MessageBox.Show("please enter Quanitity", "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);
txtquantity.Focus();
return;
}
if (txtMRP.Text == "")
{
MessageBox.Show("Please enter MRP of product", "Error",
MessageBoxButtons.OK, MessageBoxIcon.Error);
txtMRP.Focus();
return;
}
if (txtprate.Text == "")
{
MessageBox.Show("Please enter price of product", "Error",
MessageBoxButtons.OK, MessageBoxIcon.Error);
txtprate.Focus();
return;
}
if (txtGST.Text == "")
{
MessageBox.Show("Please enter GST rate", "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);
txtGST.Focus();
return;
}
if (txtHSN.Text == "")
{
MessageBox.Show("Please enter HSN Number ", "Error",
MessageBoxButtons.OK, MessageBoxIcon.Error);
txtHSN.Focus();
return;

36
MEDICAL STORE MANAGEMENT SYSTEM

}
String date = DateTime.Now.ToString("dd/MM/yyyy");
CMedicanPurchaseProps pobj = new CMedicanPurchaseProps();
CMPurchaseLogic lobj = new CMPurchaseLogic();
pobj.MedicanName = txtMname.Text.Trim();
pobj.Drug = txtsalt.Text.Trim();
pobj.BatchNumber = txtbatch.Text.Trim();
pobj.Quantity = txtquantity.Text.Trim();
pobj.PurchaseRate = Convert.ToDecimal(txtprate.Text.Trim());
pobj.PurchaseDate = date;
pobj.MFGDate = Mfgdate.Text.Trim();
pobj.ExpireDate = EXPdate.Text.Trim();
pobj.SaleRate = Convert.ToDecimal(txtMRP.Text.Trim());
pobj.Id = Convert.ToInt32(lblid.Text.Trim());
pobj.GST = txtGST.Text.Trim();
pobj.HSN = txtHSN.Text.Trim();
pobj = lobj.UpdateMedicanDetails(pobj);
if (pobj.OpErrorCode == "0")
{
MessageBox.Show("Record Update successfuly", "Result",
MessageBoxButtons.OK, MessageBoxIcon.Information);
dataGridView1.Visible = true;
getMedicanRegistred();

}
private void getMedicanRegistred()
{

try
{

con = new SqlConnection(cs.DBconn);


con.Open();
DataSet ds = new DataSet();
SqlCommand cmd3 = new SqlCommand("Proc_GetUpdateRegistredMedican",
con);
cmd3.Parameters.Add("@IP_MedicanId", SqlDbType.NVarChar, 50).Value =
lblid.Text;
cmd3.CommandType = CommandType.StoredProcedure;
SqlDataAdapter da = new SqlDataAdapter(cmd3);
da.Fill(ds);
dataGridView1.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.75F,
System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
dataGridView1.DataSource = ds.Tables[0];
//dataGridView1.Columns[0].HeaderText = "Edit";
dataGridView1.Columns[0].HeaderText = "Id";

37
MEDICAL STORE MANAGEMENT SYSTEM

dataGridView1.Columns[1].HeaderText = "Medican_Name";
dataGridView1.Columns[2].HeaderText = "Drug";
dataGridView1.Columns[3].HeaderText = "Batch_Number";
dataGridView1.Columns[4].HeaderText = "Quantity";
dataGridView1.Columns[5].HeaderText = "MFG_Date";
dataGridView1.Columns[6].HeaderText = "Expire_Date";
dataGridView1.Columns[7].HeaderText = "Sale_Rate";
dataGridView1.Columns[8].HeaderText = "Purchase_Rate";
dataGridView1.AutoGenerateColumns = false;
dataGridView1.AllowUserToAddRows = false;
dataGridView1.Columns[0].Width = 70;
dataGridView1.Columns[1].Width = 170;
dataGridView1.Columns[2].Width = 180;
dataGridView1.Columns[3].Width = 100;
dataGridView1.Columns[4].Width = 80;
dataGridView1.Columns[5].Width = 100;
dataGridView1.Columns[6].Width = 100;
dataGridView1.Columns[7].Width = 100;
dataGridView1.Columns[8].Width = 90;
//dataGridView1.Columns[9].Width = 90;
ds.Dispose();

}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
finally
{
con.Close();
}
}

private void button1_Click_1(object sender, EventArgs e)


{
Save();
}

private void frmEditMedican_FormClosing(object sender, FormClosingEventArgs e)


{
try
{
this.Hide();
frmMedicanPurchase frm = new frmMedicanPurchase();
frm.ShowDialog();
}
catch (Exception ex)

38
MEDICAL STORE MANAGEMENT SYSTEM

{
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
finally
{

}
}
}
}

39
MEDICAL STORE MANAGEMENT SYSTEM

FRM SALE
using Medical_BLL.Logic;
using Medical_BLL.Props;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace OmMedical
{
public partial class frmSale : Form
{

SqlConnection con = null;


DataSet ds = new DataSet();
public static string ID;
public static string BillNo;
DataTable dt = new DataTable();
conn cs = new conn();
AutoCompleteStringCollection ACSC = new AutoCompleteStringCollection();
public frmSale()
{
InitializeComponent();
}

private void addbuttongirdtransction()


{
DataGridViewLinkColumn Showlink = new DataGridViewLinkColumn();
Showlink.UseColumnTextForLinkValue = true;
Showlink.HeaderText = "Edit";
Showlink.Width = 60;
Showlink.DataPropertyName = "lnkColumn";
Showlink.LinkBehavior = LinkBehavior.SystemDefault;
Showlink.Text = "Edit";
dataGridView1.Columns.Add(Showlink);

}
//private void addbuttongirdtransctionDelete()
//{
// DataGridViewLinkColumn Showlink = new DataGridViewLinkColumn();
// Showlink.UseColumnTextForLinkValue = true;
// Showlink.HeaderText = "Delete";

40
MEDICAL STORE MANAGEMENT SYSTEM

// Showlink.Width = 60;
// Showlink.DataPropertyName = "lnkColumn";
// Showlink.LinkBehavior = LinkBehavior.SystemDefault;
// Showlink.Text = "Delete";
// dataGridView1.Columns.Add(Showlink);

//}

private void frmSale_Load(object sender, EventArgs e)


{

rand();
addbuttongirdtransction();
//addbuttongirdtransctionDelete();
//label9.Visible = false;
//textBox4.Visible = false;
//label11.Visible = false;
lbldiscountgiven.Visible = false;
button4.Visible = false;
dataGridView1.Visible = false;
//getBillNumber();
getMedicanname();
}

public void rand()


{
Random random = new Random();
var x = random.Next(0, 100000);
string s = x.ToString("0000");
lblbillNum.Text = s;
}

// private void getBillNumber()


//{
// try
// {
// using (con = new SqlConnection(cs.DBconn))
// {

// con.Open();
// DataSet ds = new DataSet();
// SqlCommand cmd1 = new SqlCommand("GetBillNumber", con);
// cmd1.CommandType = CommandType.StoredProcedure;
// SqlDataAdapter da = new SqlDataAdapter(cmd1);
// da.Fill(ds);
// if (ds.Tables[0].Rows.Count > 0)
// {

// lblbillNum.Text = Convert.ToString(ds.Tables[0].Rows[0]["Billno"]);

41
MEDICAL STORE MANAGEMENT SYSTEM

// }

// if (lblbillNum.Text == "")
// {

// lblbillNum.Text = "1";

// }
// else
// {

// int BillNumber = Convert.ToInt32(lblbillNum.Text);


// int finalBillNumber = BillNumber + 1;
// lblbillNum.Text = Convert.ToString(finalBillNumber);
// //string nextId = string.Empty;
// //int len = lblbillNum.Text.Length;
// //string splitNo = lblbillNum.Text.Substring(5, len - 5);//This line will ignore
the string values and read only the numeric values
// //int num = Convert.ToInt32(splitNo);
// //num++;// Increment the numeric value
// //nextId = lblbillNum.Text.Substring(0, 5) +
num.ToString("0000");//Concatenate the string value and the numeric value after the
increment
// //lblbillNum.Text = nextId.Trim();
// }
// }
// }
// catch (Exception ex)
// {

// MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK,


MessageBoxIcon.Error);

// }
// finally
// {
// con.Close();
// }
//}
private void GetSaleMedicanDetails()
{

try
{

con = new SqlConnection(cs.DBconn);


con.Open();

42
MEDICAL STORE MANAGEMENT SYSTEM

DataSet ds = new DataSet();


SqlCommand cmd3 = new SqlCommand("Proc_GetSaleMedicanDetails", con);
cmd3.Parameters.Add("@IP_BillNumber", SqlDbType.NVarChar, 50).Value =
lblbillNum.Text;
cmd3.Parameters.Add("@IP_Name", SqlDbType.NVarChar, 50).Value =
textBox1.Text;
cmd3.CommandType = CommandType.StoredProcedure;
SqlDataAdapter da = new SqlDataAdapter(cmd3);
da.Fill(ds);
dataGridView1.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.75F,
System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
dataGridView1.DataSource = ds.Tables[0];
dataGridView1.Columns[0].HeaderText = "Edit";
//dataGridView1.Columns[1].HeaderText = "Delete";
dataGridView1.Columns[1].HeaderText = "Id";
dataGridView1.Columns[2].HeaderText = "BillNo";
dataGridView1.Columns[3].HeaderText = "Name";
dataGridView1.Columns[4].HeaderText = "DrName";
dataGridView1.Columns[5].HeaderText = "MedicanName";
dataGridView1.Columns[6].HeaderText = "BatchName";
dataGridView1.Columns[7].HeaderText = "MfgDate";
dataGridView1.Columns[8].HeaderText = "ExpireDate";
dataGridView1.Columns[9].HeaderText = "Quantity";
dataGridView1.Columns[10].HeaderText = "Amount";
dataGridView1.Columns[11].HeaderText = "Rate";
dataGridView1.AutoGenerateColumns = false;
dataGridView1.AllowUserToAddRows = false;
dataGridView1.Columns[0].Width = 60;
dataGridView1.Columns[1].Width = 70;
dataGridView1.Columns[2].Width = 90;
dataGridView1.Columns[3].Width = 90;
dataGridView1.Columns[4].Width = 90;
dataGridView1.Columns[5].Width = 90;
dataGridView1.Columns[6].Width = 90;
dataGridView1.Columns[7].Width = 90;
dataGridView1.Columns[8].Width = 90;
dataGridView1.Columns[9].Width = 90;
dataGridView1.Columns[10].Width = 90;
dataGridView1.Columns[11].Width = 90;
ds.Dispose();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
finally
{
con.Close();
}

43
MEDICAL STORE MANAGEMENT SYSTEM

private void Save()


{
lbldate.Text = DateTime.Now.ToString("dd/MM/yyyy");
int Q = Convert.ToInt32(txtQuantity.Text.Trim());
int A = Convert.ToInt32(lbltotalQ.Text.Trim());
if (textBox1.Text == "")
{
MessageBox.Show("Please enter name", "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);
textBox1.Focus();
return;

}
if (textBox2.Text == "")
{
MessageBox.Show("Please enter doctor name", "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);
textBox2.Focus();
return;
}
if (textBox3.Text == "")
{
MessageBox.Show("Please enter medicine name", "Error",
MessageBoxButtons.OK, MessageBoxIcon.Error);
textBox3.Focus();
return;
}
if (txtQuantity.Text == "")
{
MessageBox.Show("Please enter quantity", "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);
txtQuantity.Focus();
return;
}

if (DateTime.Parse(lbldate.Text) > DateTime.Parse(lblexpire.Text))


{
MessageBox.Show("Medicine date is expired", "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
if (A < Q)
{
MessageBox.Show("Quantity is Greater than toatal Quantity", "Error",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
CSaleLogic lobj = new CSaleLogic();
CMedicanSaleProps pobj = new CMedicanSaleProps();
pobj.BillNo = lblbillNum.Text.Trim();

44
MEDICAL STORE MANAGEMENT SYSTEM

pobj.Name = textBox1.Text.Trim();
pobj.Dname = "Dr." + textBox2.Text.Trim();
pobj.Mname = textBox3.Text.Trim();
pobj.BatchName = lblbatch.Text.Trim();
pobj.MGGdate = lblmfg.Text.Trim();
pobj.ExpireDate = lblexpire.Text.Trim();
pobj.Quantity = txtQuantity.Text.Trim();
pobj.SaleRate = Convert.ToDecimal(lblrate.Text.Trim());
pobj.Amount = Convert.ToDecimal(lblAmount.Text.Trim());
pobj.Date = lbldate.Text.Trim();
int TotalQ = Convert.ToInt32(lbltotalQ.Text.Trim());
int Quant = Convert.ToInt32(txtQuantity.Text.Trim());
int RemaingQ = TotalQ - Quant;
pobj.ReamingQuantity = Convert.ToString(RemaingQ);
pobj = lobj.SaleMedican(pobj);
if (pobj.OpErrorCode == "0")
{
MessageBox.Show("Record insert successfuly", "Result",
MessageBoxButtons.OK, MessageBoxIcon.Information);

dataGridView1.Visible = true;
GetSaleMedicanDetails();
button4.Visible = true;
txttotalamount.Visible = true;
Gettotal();
textBox3.Text = "";
textBox3.Focus();
lblbatch.Text = "";
lblmfg.Text = "";
lblexpire.Text = "";
txtQuantity.Text = "";
lblrate.Text = "";
lblAmount.Text = "";
lbltotalQ.Text = "";

}
else
if (pobj.OpErrorCode == "3")
{
MessageBox.Show("Duplicate Entry", "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
else
{
MessageBox.Show("Record not insert", "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);

45
MEDICAL STORE MANAGEMENT SYSTEM

private void GST()


{
lbldiscountgiven.Visible = true;
try
{
if (textBox5.Text == "")
{
textBox5.Text = "0";
}
double GST = double.Parse(textBox5.Text);
double c = GST / 2;
double CGST = c;
double SGST = c;
double GSTGIVEN = Convert.ToDouble(txttotalamount.Text) * (GST / 100);
double GSTD = GSTGIVEN / 2;
double CGSTamount = GSTD;
double SGSTamount = GSTD;
double salePrice = Convert.ToDouble(txttotalamount.Text) + CGSTamount +
SGSTamount;
lblGSTAMT.Text = Convert.ToString(GSTGIVEN);
lblGSTAmount.Text = Convert.ToString(salePrice);
lblSgst.Text = Convert.ToString(CGSTamount);
lblCgst.Text = Convert.ToString(SGSTamount);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);

}
finally
{

private void Discount()


{
try
{
if (textBox4.Text == "")
{
textBox4.Text = "0";
}
double dicsount = double.Parse(textBox4.Text);
double discountgiven = Convert.ToDouble(lblGSTAmount.Text) * (dicsount /
100);
double salePrice = Convert.ToDouble(lblGSTAmount.Text) - discountgiven;

46
MEDICAL STORE MANAGEMENT SYSTEM

lbldiscountgiven.Text = Convert.ToString(discountgiven);
lblsaleprice.Text = Convert.ToString(salePrice);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);

}
finally
{

private void getMedicanname()


{
try
{

con = new SqlConnection(cs.DBconn);


con.Open();
DataSet ds = new DataSet();
SqlCommand cmd3 = new SqlCommand("Proc_MedicanName", con);
cmd3.Parameters.Add("@IP_MedicanName", SqlDbType.NVarChar, 50).Value =
textBox3.Text;
cmd3.CommandType = CommandType.StoredProcedure;
SqlDataReader sdr = cmd3.ExecuteReader();
while (sdr.Read())
{
ACSC.Add(sdr.GetString(0));
}
textBox3.AutoCompleteCustomSource = ACSC;

}
catch (Exception ex)
{

MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK,


MessageBoxIcon.Error);

}
finally
{
con.Close();
}

47
MEDICAL STORE MANAGEMENT SYSTEM

private void button1_Click(object sender, EventArgs e)


{
Save();
}

private void button2_Click(object sender, EventArgs e)


{

textBox1.Text = "";
textBox1.Focus();
textBox3.Text = "";
textBox2.Text = "";
lblbatch.Text = "";
lblmfg.Text = "";
lblexpire.Text = "";
txtQuantity.Text = "";
lblrate.Text = "";
lblAmount.Text = "";
lbltotalQ.Text = "";
}

private void textBox3_TextChanged_1(object sender, EventArgs e)


{
try
{
con = new SqlConnection(cs.DBconn);
con.Open();
DataSet ds = new DataSet();
SqlCommand cmd = new SqlCommand("Proc_GetMedicanDetailsforSale", con);
cmd.Parameters.Add("@IP_MedicanName", SqlDbType.NVarChar, 50).Value =
textBox3.Text;
cmd.CommandType = CommandType.StoredProcedure;
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(ds);
if (ds.Tables[0].Rows.Count > 0)
{
lblbatch.Text = Convert.ToString(ds.Tables[0].Rows[0]["Batch_Number"]);
lblmfg.Text = Convert.ToString(ds.Tables[0].Rows[0]["MFG_Date"]);
lblexpire.Text = Convert.ToString(ds.Tables[0].Rows[0]["Expire_Date"]);
lbltotalQ.Text = Convert.ToString(ds.Tables[0].Rows[0]["Quantity"]);
lblrate.Text = Convert.ToString(ds.Tables[0].Rows[0]["Sale_Rate"]);

}
catch (Exception ex)

48
MEDICAL STORE MANAGEMENT SYSTEM

{
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
finally
{
con.Close();
}

}
private void Gettotal()
{
try
{

con = new SqlConnection(cs.DBconn);


con.Open();
DataSet ds = new DataSet();
SqlCommand cmd = new SqlCommand("Proc_GetMedicanAmontofSale", con);
cmd.Parameters.Add("@IP_BillNumber", SqlDbType.NVarChar, 50).Value =
lblbillNum.Text;
cmd.Parameters.Add("@IP_MedicanName", SqlDbType.NVarChar, 150).Value =
textBox3.Text;
cmd.CommandType = CommandType.StoredProcedure;
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(ds);
if (ds.Tables[0].Rows.Count > 0)
{

if (txttotalamount.Text == "")
{
txttotalamount.Text = "0";
}

else
{
String Amount = Convert.ToString(ds.Tables[0].Rows[0]["Amount"]);
decimal MAmount = Convert.ToDecimal(Amount);
Decimal GAmount = Convert.ToDecimal(txttotalamount.Text);
Decimal Amount2 = MAmount + GAmount;
txttotalamount.Text = Convert.ToString(Amount2);
}

}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);

49
MEDICAL STORE MANAGEMENT SYSTEM

}
finally
{
con.Close();
}
}

private void txtQuantity_TextChanged_1(object sender, EventArgs e)


{

try
{

if (txtQuantity.Text == "")
{
txtQuantity.Text = "0";
}
else
{

int Q = Convert.ToInt32(txtQuantity.Text);
decimal rate = Convert.ToDecimal(lblrate.Text);
decimal amount = rate * Q;
lblAmount.Text = Convert.ToString(amount);
// lblTamount.Text = lblAmount.Text + 0;
}

}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);

}
finally
{
}
}

private void label11_Click(object sender, EventArgs e)


{

//private void checkBox1_MouseClick(object sender, MouseEventArgs e)


//{
// if (checkBox1.Checked)
// {

50
MEDICAL STORE MANAGEMENT SYSTEM

// label9.Visible = true;
// textBox4.Visible = true;
// label11.Visible = true;
// lbldiscountgiven.Visible = true;
// }
// else
// {
// label9.Visible = false;
// textBox4.Visible = false;
// label11.Visible = false;
// lbldiscountgiven.Visible = false;
// }
//}

private void textBox4_TextChanged(object sender, EventArgs e)


{
Discount();
}

private void SaveBill()


{
CSaleLogic lobj = new CSaleLogic();
CBillManagmentProps pobj = new CBillManagmentProps();
pobj.BillNo = lblbillNum.Text.Trim();
pobj.discount = textBox4.Text.Trim();
pobj.discountGiven = Convert.ToDecimal(lbldiscountgiven.Text.Trim());
pobj.totalamount = Convert.ToDecimal(lblsaleprice.Text.Trim());
pobj.GST = textBox5.Text.Trim();
pobj.CGST = Convert.ToString(lblCgst.Text.Trim());
pobj.SGST = Convert.ToString(lblSgst.Text.Trim());
pobj.GSTAMT = Convert.ToDecimal(lblGSTAMT.Text.Trim());
pobj.AFTGSTAMOUNT = Convert.ToDecimal(lblGSTAmount.Text.Trim());
pobj = lobj.SaveBill(pobj);
if (pobj.OpErrorCode == "0")
{
MessageBox.Show("Record insert successfuly", "Result",
MessageBoxButtons.OK, MessageBoxIcon.Information);

//lblGSTAMT.Text="";
//lblSgst.Text = "";
//lblCgst.Text = "";
//textBox5.Text = "";
//lblsaleprice.Text = "";
//lbldiscountgiven.Text = "";
//textBox4.Text = "";
//textBox1.Text = "";
//textBox1.Focus();
//textBox3.Text = "";
//textBox2.Text = "";
//lblbatch.Text = "";

51
MEDICAL STORE MANAGEMENT SYSTEM

//lblmfg.Text = "";
//lblexpire.Text = "";
//txtQuantity.Text = "0";
//lblrate.Text = "";
//lblAmount.Text = "";
//lbltotalQ.Text = "";
//lblGSTAmount.Text = "";

}
else
if (pobj.OpErrorCode == "3")
{
MessageBox.Show("Duplicate Entry", "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
else
{
MessageBox.Show("Record not insert", "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);

}
}

private void button3_Click(object sender, EventArgs e)


{
SaveBill();
BillNo = Convert.ToString(lblbillNum.Text.Trim());
//Name = Convert.ToString(textBox1.Text.Trim());
frmPrintBillDetails1 frm = new frmPrintBillDetails1();
frm.ShowDialog();

private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


{

frmMedicanDemand frm = new frmMedicanDemand();


frm.ShowDialog();
}

private void Delete()


{

}
private void dataGridView1_CellContentClick(object sender,
DataGridViewCellEventArgs e)
{
if (e.ColumnIndex == 0)
{

52
MEDICAL STORE MANAGEMENT SYSTEM

if (MessageBox.Show("Do you really want to edit this record?", "Confirmation",


MessageBoxButtons.YesNo, MessageBoxIcon.Question) ==
System.Windows.Forms.DialogResult.Yes)
{

ID = Convert.ToString(dataGridView1.Rows[e.RowIndex].Cells["Id"].Value);
BillNo =
Convert.ToString(dataGridView1.Rows[e.RowIndex].Cells["BillNo"].Value);
// MName =
Convert.ToString(dataGridView1.Rows[e.RowIndex].Cells["MedicanName"].Value);
frmEditSale frm = new frmEditSale();
frm.ShowDialog();

}
}
if (e.ColumnIndex == 1)
{
if (MessageBox.Show("Do you really want to Delete this record?", "Confirmation",
MessageBoxButtons.YesNo, MessageBoxIcon.Question) ==
System.Windows.Forms.DialogResult.Yes)
{

Delete();

}
}
}

private void button4_Click(object sender, EventArgs e)


{
GetSaleMedicanDetails();
}

private void textBox5_TextChanged(object sender, EventArgs e)


{
GST();
}

private void label14_Click(object sender, EventArgs e)


{

private void lblbillNum_Click(object sender, EventArgs e)


{

53
MEDICAL STORE MANAGEMENT SYSTEM

private void frmSale_FormClosing(object sender, FormClosingEventArgs e)


{
try
{
this.Hide();
frmMainMenu frm = new frmMainMenu();
frm.ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
finally
{

}
}

}
}

54
MEDICAL STORE MANAGEMENT SYSTEM

Login

55
MEDICAL STORE MANAGEMENT SYSTEM

Main Menu

Purchase Form

56
MEDICAL STORE MANAGEMENT SYSTEM

Sale Form

57
MEDICAL STORE MANAGEMENT SYSTEM

DemandForm

58
MEDICAL STORE MANAGEMENT SYSTEM

Refund Form

59
MEDICAL STORE MANAGEMENT SYSTEM

60
MEDICAL STORE MANAGEMENT SYSTEM

Purchase Output

Sale Ouput

61
MEDICAL STORE MANAGEMENT SYSTEM

Bill Report

62
MEDICAL STORE MANAGEMENT SYSTEM

63
MEDICAL STORE MANAGEMENT SYSTEM

TESTING

Validation Testing
 In Validation testing first of all we have check that all the requirements
which was given for Administration like product is fulfilled or not.
 All the requirements which were given for user side (i.e. viewing new
information comparison of two models) appropriately done or not.

Coding Testing

 The Code testing strategy examines the logic of the program.


 However if code testing can be performed in its entirety, it does not
guarantee against software failures.

System Testing

 Ultimately, software is incorporated with other system elements (e.g.


hardware, people, information), and a series of system integration and
validation tests are conducted.
 System testing is actually a series of different tests whose primary purpose is
to fully exercise the computer-based system.
 After implementation the system all the flow of data between
interfaces are done or not.

FUTURE ENHANCEMENT
There is one segment named lab unit needed computer system to improve work .In this
system, we tried to make a simple application for user. We can change our system day by day
as per the user requirements will be changed. In future we want to implement below point in
our system.

 We convert our system into website.


 To add Sales return & Purchase return Modules.

64
MEDICAL STORE MANAGEMENT SYSTEM

SYSTEM REQUIREMENT & SPECIFICATION

System Analysis :-
Now a days we do all works with computerized system but with current system
is very compilcated to keep the track of all registers and handle manually . As well as this
work is time consuming and expensive in this system report work may be not accurate and
not fastest.

Drawbacks of Current System


1. Time consuming...

2. More expensive...

3. Searching problem...

4. Maintains problem of all regsiters...

5. Less accuracy...

6. Problem for marking of not normal value...

7. More stationary...

8. Display multi report...

Advantage of computerised system


1. Time saving...

2. Less expensive...

3. Powerfull searching..

4. Solve problem of maintains register...

5. More accuracy...

6. Easy generate report...

7. Not display multiple report...

65
MEDICAL STORE MANAGEMENT SYSTEM

FEASIBILITY STUDY
There are major areas that determine the feasibilty of project .These all areas combine define
whether the project is feasbile or not .

These major areas are given below:

1) Technical Feasibilty :
It is considered in terms of technical requirements ans their avalability
in the markets . It determines whether the current level of technology support the proposed
system or not . The technical possibility of proposed system is as follows :

 The units does process the hardware as well as related software for the project.
 The proposed system does not require much technical details.
 The current manual working is not so much sufficient.
 It just require window opreating system.

2) Economically Feasibilty :
The economically feasibilty is considered in terms of
money/price value . The organization measure the cost efficentiveness of the project . The
economical feasibilty of proposed system is as under:

 The organization is ready to invest in proposed system for latest technology and
best result.
 As the personnel and manager know the computer opreating, the unit need not
have appoint any computer operator.
 The units has not be spend much amount for computer hardware and software.

3) Operational Feasiblity:
As the ultimate feasibilty ,consideration of the proposed
system will fullfill the department’s requirements . It decides whether the proposed
system covers all the opreational feasibilty is as under:
 The proposed system will fulfill the organization’s requriments .
 The proposed system covers all the aspects of current manual system.
 The responsible users of the system i.e. manager ,accountant and partner are
honestly enthusiastic for new system.
 The change of this system being oprational are quite strong.

66
MEDICAL STORE MANAGEMENT SYSTEM

PROPOSED SYSTEM
In proposed system ,the managment needs not to keep any type
of register , which they use to keep in old one . They have work only with one computer . All
the details are stored in computer files . The dual entires are done very qucikly as entry in one
file only, affects the other file where it has to record . In the way there is no need to record
the computer opreator.

The working through register system is not only very laborious and time consuming , but
there are number of errors found . In comparison to old system the proposed system of
computer processes many advantages.

Some of the merits of proposed system are follows :

● Accuracy:
It is one of the features of computer that is provides accuracy result. It
is often said,”Man does mistakes but machine never”. When a man works there seems
number of errors and mistakes in performing calculation and other things,while it is not in
case with computer

● Security:
The security is maintained vary comfortably in computers. Secrets
are not disclosed off,as there as password settings in the computers. So the frim can get the
benfiet of non-disclosed of its secrets to the outsiders competitor as well as other non-
authorized persons.

● Time Saving:
The computerized system is time saving. On immediate inquiry ,
the opreator or any authorized person has to just click some switches and get the information
in few seconds

. ● Perform Repetitve Task Very Well: It is said that computer never tries. I do the repetitive task
very well as it never feel laziness . Perfromance of repetitive task by man is not well.

● Low Cost:
The computer need not change year as it happens in case
of register . In register system clerk, employees and also managers are needed to fulfill the
management activity while in computer system the two persons are enough for all the work .
So in proposed system the two persons and expenses of registers are saved annually

67
MEDICAL STORE MANAGEMENT SYSTEM

● Easy Maintenance:
The maintenace of computer is not tough job as compared to the
registers,as it may not be lost or damaged . So there is only soft or easy maintenace with
computers.

● Easy Modification:
In case of any in data stored , the modification or editing can be
done vary easily and clearly through computers , but this is possible with registers.

● Attractive and Status:


Computer creates diffrenet kind of impression in mind of
computer or any other person. Computer tends to increase in reputation/status of the frim .
Whenever party required any information the units has just to print to out clicking some
switches, so with the help of computer , promoters can increase thier profit. Hence,with these
merits , it would be very unwise and reckless to manager the organization though the system
of book keeping, as it said that preventaion is better than cure, it would be very fine
intelligent decision to have a computer application system in management.

Hardware Requirement:
 Pentium processor

 2 GB RAM

 160 GB Hard disk

 keyboard and Mouse

Software Requirment:

 Opreating system : Window 7

 Front end tool : Vishual studio 2012

 Back end tool : SQL server 2008

68
MEDICAL STORE MANAGEMENT SYSTEM

69
MEDICAL STORE MANAGEMENT SYSTEM

FUTURE ENHANCEMENT

There is one segment named lab unit needed computer system to


improve work .In this system, we tried to make a simple
application for user. We can change our system day by day as
per the user requirements will be changed. In future we want to
implement below point in our system.

 We convert our system into website.

70
MEDICAL STORE MANAGEMENT SYSTEM

71
MEDICAL STORE MANAGEMENT SYSTEM

BIBLOGRAPHY

Visual Basic 6 Programming (Black Book)

Online Resources

Website Referred

www.codeproject.com

72
MEDICAL STORE MANAGEMENT SYSTEM

73

You might also like