static void Main() { Regedit reg = new Regedit(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); reg.add("Login", "false", "Initial"); server = reg.get("Server", "Server"); auth = reg.get("Auth", "Initial"); if (String.IsNullOrEmpty(server) || String.IsNullOrEmpty(auth)) { Application.Run(new FirstRun()); } Application.Run(new Login()); try { state = reg.get("Login", "Initial"); if (state.Equals("true")) { Application.Run(new MainPage()); } } catch (Exception) { Application.Exit(); } }
public PrintFormetter(string adm_no, CheckedListBox.CheckedItemCollection checkedItemCollection, String slipNo) { this.billNo = slipNo; savePath = reg.get("savePath", "Printer"); int i; try { List <List <string> > academic_fee = new List <List <string> >(); List <List <string> > other_fee = new List <List <string> >(); List <List <string> > fine = new List <List <string> >(); List <string> tmp = new List <string>(); for (i = 0; i < checkedItemCollection.Count; i++) { String[] item_id = null; item_id = checkedItemCollection[i].ToString().Split('#'); feeDetails = db.getFeeDetails(item_id[1]); if (feeDetails[3].Trim().Equals("Academic Fee")) { tmp.Add(feeDetails[1].ToString()); tmp.Add(feeDetails[2].ToString()); academic_fee.Add(tmp); } if (feeDetails[3].Trim().Equals("Other")) { tmp.Add(feeDetails[1].ToString()); tmp.Add(feeDetails[2].ToString()); other_fee.Add(tmp); } if (feeDetails[3].Trim().Equals("Fine")) { tmp.Add(feeDetails[1].ToString()); tmp.Add(feeDetails[2].ToString()); fine.Add(tmp); } tmp = new List <string>(); } studentInfo = db.studentInfo(adm_no); while (studentInfo.Read()) { studentName = studentInfo[1].ToString(); studentClass = studentInfo[2].ToString() + " " + studentInfo[3].ToString(); } try { printBill(adm_no, date, studentName, studentClass, slipNo, academic_fee, other_fee, fine); } catch (Exception ex) { MessageBox.Show(ex.Message); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public MainPage() { InitializeComponent(); theam(); auth = reg.get("Auth", "Initial"); theam(); }
private void button1_Click(object sender, EventArgs e) { if (inputPass.Text.Length != 0 && inputUsername.Text.Length != 0 && server.Text.Length != 0 && department.Text.Length != 0) { try { if (db.conTest(server.Text.ToString())) { /* Set User Pass*/ reg.add(inputUsername.Text, encrypt.md5(inputPass.Text), "Initial"); reg.add("fee", "0", "Initial"); reg.add("Theam", "Black", "Color"); reg.add("Auth", department.Text.ToString(), "Initial"); /* Set Server*/ reg.add("savePath", pdf_save_path.Text, "Printer"); reg.add("Server", server.Text, "Server"); regValue = reg.get("Server", "Server"); MessageBox.Show("Database Path : " + regValue, "Sucess", MessageBoxButtons.OK); this.Close(); } } catch (Exception exp) { MessageBox.Show(exp.Message.ToString()); } } else { MessageBox.Show("You must fill all the field", "Failed", MessageBoxButtons.RetryCancel, MessageBoxIcon.Stop); } }
public setting() { InitializeComponent(); theam(); maskedTextBox1.Text = reg.get("savePath", "Printer"); textBox1.Text = reg.get("fee", "Initial"); server.Text = reg.get("Server", "Server"); cuTheam.Text = reg.get("Theam", "Color"); }
private void button1_Click(object sender, EventArgs e) { if (userName.Text.Length != 0 && passWord.Text.Length != 0) { try { pass = reg.get(userName.Text.ToString(), "Initial"); if (encrypt.md5(passWord.Text).Equals(pass)) { reg.add("Login", "true", "Initial"); this.Close(); } else { MessageBox.Show("Wrong Username and Password", "Error", MessageBoxButtons.RetryCancel, MessageBoxIcon.Stop); } }catch (Exception) { MessageBox.Show("Wrong Username and Password", "Error", MessageBoxButtons.RetryCancel, MessageBoxIcon.Stop); } } }
public TheamPack() { this.colorCode = reg.get("Theam", "Color").ToString(); colorMaker(); }