public C_Supplier GetSupplier(string id)
        {
            SqlParameter[] parms = { new SqlParameter("@Id", SqlDbType.VarChar, 100) };
            parms[0].Value = SqlTypeConverter.DBNullStringChecker(id);

            C_Supplier entity = null;

            using (var rdr = SqlHelper.ExecuteReader(this._databaseConnectionString, CommandType.Text, SqlCommands_Rs.Sql_C_Supplier_Repository_GetSupplier, parms)) {
                if (rdr.Read())
                {
                    entity            = new C_Supplier();
                    entity.Id         = SqlTypeConverter.DBNullStringHandler(rdr["Id"]);
                    entity.Name       = SqlTypeConverter.DBNullStringHandler(rdr["Name"]);
                    entity.Contact    = SqlTypeConverter.DBNullStringHandler(rdr["linkMan"]);
                    entity.Phone      = SqlTypeConverter.DBNullStringHandler(rdr["Phone"]);
                    entity.Fax        = SqlTypeConverter.DBNullStringHandler(rdr["Fax"]);
                    entity.Address    = SqlTypeConverter.DBNullStringHandler(rdr["Address"]);
                    entity.Level      = SqlTypeConverter.DBNullStringHandler(rdr["Level"]);
                    entity.PostalCode = SqlTypeConverter.DBNullStringHandler(rdr["PostalCode"]);
                    entity.Comment    = SqlTypeConverter.DBNullStringHandler(rdr["Desc"]);
                    entity.Enabled    = SqlTypeConverter.DBNullBooleanHandler(rdr["Enabled"]);
                }
            }
            return(entity);
        }
Beispiel #2
0
 public frmAddEnterCoupon()
 {
     InitializeComponent();
     _item  = new C_Items();
     _staff = new C_Staff();
     _sup   = new C_Supplier();
     _enter = new C_Enter();
 }
Beispiel #3
0
        //Load nhom nha cung cap
        public void LoadTreeGroupSup()
        {
            _sup = new C_Supplier();
            tV_GroupSup.Nodes.Clear();
            tV_GroupSup.Nodes.Add("Tất cả");
            tV_GroupSup.Nodes[0].Tag = "1";
            tV_GroupSup.Nodes[0].ContextMenuStrip = cMS_GroupSup;
            DataTable typeCus = new DataTable();

            typeCus = _sup.GetTableTypeSupplierMySQL();
            for (int i = 0; i < typeCus.Rows.Count; i++)
            {
                tV_GroupSup.Nodes[0].Nodes.Add(typeCus.Rows[i][0].ToString());
                tV_GroupSup.Nodes[0].Nodes[i].Tag = "2";
                tV_GroupSup.Nodes[0].Nodes[i].ContextMenuStrip = cMS_GroupSup;
            }
            tV_GroupSup.Nodes[0].ExpandAll();
        }
        public List <C_Supplier> GetSuppliers()
        {
            var entities = new List <C_Supplier>();

            using (var rdr = SqlHelper.ExecuteReader(this._databaseConnectionString, CommandType.Text, SqlCommands_Rs.Sql_C_Supplier_Repository_GetSuppliers, null)) {
                while (rdr.Read())
                {
                    var entity = new C_Supplier();
                    entity.Id         = SqlTypeConverter.DBNullStringHandler(rdr["Id"]);
                    entity.Name       = SqlTypeConverter.DBNullStringHandler(rdr["Name"]);
                    entity.Contact    = SqlTypeConverter.DBNullStringHandler(rdr["linkMan"]);
                    entity.Phone      = SqlTypeConverter.DBNullStringHandler(rdr["Phone"]);
                    entity.Fax        = SqlTypeConverter.DBNullStringHandler(rdr["Fax"]);
                    entity.Address    = SqlTypeConverter.DBNullStringHandler(rdr["Address"]);
                    entity.Level      = SqlTypeConverter.DBNullStringHandler(rdr["Level"]);
                    entity.PostalCode = SqlTypeConverter.DBNullStringHandler(rdr["PostalCode"]);
                    entity.Comment    = SqlTypeConverter.DBNullStringHandler(rdr["Desc"]);
                    entity.Enabled    = SqlTypeConverter.DBNullBooleanHandler(rdr["Enabled"]);
                    entities.Add(entity);
                }
            }
            return(entities);
        }
 public frmAddGroupSupplier()
 {
     InitializeComponent();
     _sup = new C_Supplier();
 }
 public frmAddSupplier()
 {
     InitializeComponent();
     _supdll = new C_Supplier();
 }