|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace ISCMS.Invoice
{
public partial class PurchaseInvoiceList : ISCMS.Main.List
{
public PurchaseInvoiceList()
{
InitializeComponent();
}
public override void LoadB_Click(object sender, EventArgs e)
{
HideControls();
RoundLoading.Visible = true;
deriveClass = "Goods_List";
DataAccess.Goods ac = new ISCMS.DataAccess.Goods();
data = ac.GetList();
//if (lastGuid != Guid.Empty)
//{
// MainForm.O.CancelAsync(lastGuid);
//}
LoadList();
DisplayList(true);
RoundLoading.SendToBack();
base.RoundLoading.Visible = false;
}
void DisplayList(bool val)
{
Sr.Visible = val;
PN.Visible = val;
Footer.Visible = val;
this.Advance_Search.Enabled = val;
//LName.Visible = val;
//Lphone.Visible = val;
//this.LCell.Visible = val;
//LEmail.Visible = val;
//LStatus.Visible = val;
//LRole.Visible = val;
//LGender.Visible = val;
//LActivity.Visible = val;
}
public override string Make_Expression()
{
if (is_AdvanceSearch)
{
is_AdvanceSearch = false;
return exp;
}
exp = " 1 = 1 ";
//switch (CMS.MasterFile.Employee.List.SearchCombo.Text)
//{
// case "Name":
// exp = exp + " and name like '*" + SearchBy.Text + "*' ";
// // this.LCustomer.BackColor = Color.Yellow;
// // this.LCustomer.ForeColor = Color.Black;
// break;
// case "Address":
// exp = exp + " and address like '*" + SearchBy.Text + "*' ";
// // this.LTape_No.BackColor = Color.Yellow;
// // this.LTape_No.ForeColor = Color.Black;
// break;
// case "Zip Code":
// exp = exp + " and zipcode like '*" + SearchBy.Text + "*' ";
// break;
// case "Phone":
// exp = exp + " and phone like '*" + SearchBy.Text + "*' ";
// // this.LConfirmation_No.BackColor = Color.Yellow;
// // this.LConfirmation_No.ForeColor = Color.Black;
// break;
// case "Occupation":
// exp = exp + " and occupation like '*" + SearchBy.Text + "*' ";
// break;
// case "SSN":
// exp = exp + " and SSN like '*" + SearchBy.Text + "*' ";
// break;
// case "Email":
// exp = exp + " and email like '*" + SearchBy.Text + "*' ";
// break;
// case "Company":
// exp = exp + " and company like '*" + SearchBy.Text + "*' ";
// break;
//}
return exp;
}
public override string GetID(int i, int item)
{
return Rows[i]["Goods_ID"].ToString();
}
public override string Item_Row(int i, int item, System.Windows.Forms.Control.ControlCollection coll)
{
StringBuilder str = new StringBuilder();
// 0
string strNo = Convert.ToString(i + 1);
// 1
string strname = Rows[i]["name"].ToString();
strname = strname.Length > 15 ? strname.Remove(10) : strname;
// 2
string strPhone = Rows[i]["Description"].ToString();
strPhone = strPhone.Length > 15 ? strPhone.Remove(15) : strPhone;
// 3
string strCell = Rows[i]["Code"].ToString();
strCell = strCell.Length > 15 ? strCell.Remove(15) : strCell;
// 4
//string strEmail = Rows[i]["Email"].ToString();
//strEmail = strEmail.Length > 20 ? strEmail.Remove(15) : strEmail;
//// 5
//string strStatus = Rows[i]["Status"].ToString();
//// 6
//string strRole = Rows[i]["Role"].ToString();
//// 7
////string strSpeciality = Rows[i]["Speciality"].ToString();
//// 8
//string strGender = Rows[i]["Gender"].ToString();
str.Append(strNo).Append(' ', Aligner(5, strNo.Length)).Append("|");
str.Append(strname).Append(' ', Aligner(20, strname.Length)).Append("|"); // 30
str.Append(strPhone).Append(' ', Aligner(77, strPhone.Length)).Append("|");// 40
str.Append(strCell).Append(' ', Aligner(57, strCell.Length)).Append("|");// 40
return str.ToString();
}
int Aligner(int limit, int length)
{
if ((limit - length - 1) < 0)
return 0;
else
return (limit - length - 1);
}
public override void KeyUpEvent(object sender, KeyEventArgs e)
{
if ((e.Control) && (!e.Alt) && (!e.Shift))
{
//// search key
//#region
//// Search By
//if (e.KeyCode.ToString() == "s" || e.KeyCode.ToString() == "S")
//{
// return;
//}
//// Value
//if (e.KeyCode.ToString() == "v" || e.KeyCode.ToString() == "V")
//{
// return;
//}
//// Load
//if (e.KeyCode.ToString() == "l" || e.KeyCode.ToString() == "L")
//{
// this.LoadB_Click(new object(), new EventArgs());
// return;
//}
//// New
//if (e.KeyCode.ToString() == "n" || e.KeyCode.ToString() == "N")
//{
// this.New_Click(new object(), new EventArgs());
// return;
//}
//// <
//if (e.KeyCode == Keys.Left)
//{
// this.Back_Click(new object(), new EventArgs());
// return;
//}
//// <<
//if (e.KeyCode == Keys.Down)
//{
// this.Full_Back_Click(new object(), new EventArgs());
// return;
//}
//// >
//if (e.KeyCode == Keys.Right)
//{
// this.Next_Click(new object(), new EventArgs());
// return;
//}
//// >>
//if (e.KeyCode == Keys.Up)
//{
// this.Full_Next_Click(new object(), new EventArgs());
// return;
//}
//// Advance Search
//if (e.KeyCode.ToString() == "a" || e.KeyCode.ToString() == "A")
//{
// if (!Advance_Search.Enabled)
// {
// Main.Control.CMessageBox.ShowBox("Please, load your need to load the list", 2);
// return;
// }
// this.Export_LinkClicked(new object(), new LinkLabelLinkClickedEventArgs((new LinkLabel()).Links[0]));
// return;
//}
//#endregion
}
// Short Cut go
if (e.KeyCode == System.Windows.Forms.Keys.Escape)
{
//sh.Close();
return;
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.