public string Update(int ID, int Customer_ID, string Payment_Terms, string Price_Terms, string Bank_Name, string Address, string Zip_Postal,
            string State_Province, string Phone, string City, string Country, string Fax)
        {
            Payment_Info _Payment_Info = new Payment_Info();
            _Payment_Info.ID = ID;
            _Payment_Info.Customer_ID = Customer_ID;
            _Payment_Info.Payment_Terms = Payment_Terms;
            _Payment_Info.Price_Terms = Price_Terms;
            _Payment_Info.Bank_Name = Bank_Name;
            _Payment_Info.Address = Address;
            _Payment_Info.Zip_Postal = Zip_Postal;
            _Payment_Info.State_Province = State_Province;
            _Payment_Info.Phone = Phone;
            _Payment_Info.City = City;
            _Payment_Info.Country = Country;
            _Payment_Info.Fax = Fax;
            _Payment_Info.UpdatedBy = Session["User"].ToString();

            return Payment_Info_DA.Update(_Payment_Info);
        }
        public Payment_Info Get_Payment_Info_By_Id(int ID)
        {
            Payment_Info _Payment_Info = new Payment_Info();

            DataTable dt = Payment_Info_DA.Get_Payment_Info_By_Id(ID);

            foreach (DataRow row in dt.Rows)
            {
                ID = int.Parse(row["ID"].ToString());
                _Payment_Info.Customer_ID = int.Parse(row["Customer_ID"].ToString());
                _Payment_Info.Payment_Terms = row["Payment_Terms"].ToString();
                _Payment_Info.Price_Terms = row["Price_Terms"].ToString();
                _Payment_Info.Bank_Name = row["Bank_Name"].ToString();
                _Payment_Info.Address = row["Address"].ToString();
                _Payment_Info.Zip_Postal = row["Zip/Postal"].ToString();
                _Payment_Info.State_Province = row["State/Province"].ToString();
                _Payment_Info.Phone = row["Phone"].ToString();
                _Payment_Info.City = row["City"].ToString();
                _Payment_Info.Country = row["Country"].ToString();
                _Payment_Info.Fax = row["Fax"].ToString();
            }
            return _Payment_Info;
        }
예제 #3
0
        public static string Insert(Payment_Info _Payment)
        {
            DbCommand command = Catalog_Access.CreateCommand();
            command.CommandText = "sp_insertPayment_Info";

            DbParameter param;

            param = command.CreateParameter();
            param.ParameterName = "@Customer_ID";
            param.Value = _Payment.Customer_ID;
            param.DbType = DbType.String;
            command.Parameters.Add(param);

            param = command.CreateParameter();
            param.ParameterName = "@Bank_Name";
            param.Value = _Payment.Bank_Name;
            param.DbType = DbType.String;
            command.Parameters.Add(param);

            param = command.CreateParameter();
            param.ParameterName = "@Payment_Terms";
            param.Value = _Payment.Payment_Terms;
            param.DbType = DbType.String;
            command.Parameters.Add(param);

            param = command.CreateParameter();
            param.ParameterName = "@Address";
            param.Value = _Payment.Address;
            param.DbType = DbType.String;
            command.Parameters.Add(param);

            param = command.CreateParameter();
            param.ParameterName = "@Zip_Postal";
            param.Value = _Payment.Zip_Postal;
            param.DbType = DbType.String;
            command.Parameters.Add(param);

            param = command.CreateParameter();
            param.ParameterName = "@State_Province";
            param.Value = _Payment.State_Province;
            param.DbType = DbType.String;
            command.Parameters.Add(param);

            param = command.CreateParameter();
            param.ParameterName = "@Phone";
            param.Value = _Payment.Phone;
            param.DbType = DbType.String;
            command.Parameters.Add(param);

            param = command.CreateParameter();
            param.ParameterName = "@City";
            param.Value = _Payment.City;
            param.DbType = DbType.String;
            command.Parameters.Add(param);

            param = command.CreateParameter();
            param.ParameterName = "@Country";
            param.Value = _Payment.Country;
            param.DbType = DbType.String;
            command.Parameters.Add(param);

            param = command.CreateParameter();
            param.ParameterName = "@Fax";
            param.Value = _Payment.Fax;
            param.DbType = DbType.String;
            command.Parameters.Add(param);

            param = command.CreateParameter();
            param.ParameterName = "@CreatedBy";
            param.Value = _Payment.CreatedBy;
            param.DbType = DbType.String;
            command.Parameters.Add(param);

            param = command.CreateParameter();
            param.ParameterName = "@Return";
            param.DbType = DbType.String;
            param.Size = 2;
            param.Direction = ParameterDirection.Output;
            command.Parameters.Add(param);

            Catalog_Access.ExecuteNonQuery(command);

            string Return = command.Parameters["@Return"].Value.ToString();

            return Return;
        }