public string Update(int ID, int Customer_ID, string Address, string ZP, string SP, string City,string Country)
        {
            Delivery_Location _Delivery_Location = new Delivery_Location();
            _Delivery_Location.ID = ID;
            _Delivery_Location.Customer_ID = Customer_ID;
            _Delivery_Location.Address = Address;
            _Delivery_Location.ZP = ZP;
            _Delivery_Location.SP = SP;
            _Delivery_Location.City = City;
            _Delivery_Location.Country = Country;

            _Delivery_Location.UpdatedBy = Session["User"].ToString();

            return Delivery_Location_DA.Update(_Delivery_Location);
        }
        public Delivery_Location Get_Delivery_Location_By_Id(int ID)
        {
            Delivery_Location _Delivery_Location = new Delivery_Location();

            DataTable dt = Delivery_Location_DA.Get_Delivery_Location_By_Id(ID);

            foreach (DataRow row in dt.Rows)
            {
                ID = int.Parse(row["ID"].ToString());
                _Delivery_Location.Customer_ID = int.Parse(row["Customer_ID"].ToString());
                _Delivery_Location.Address = row["Address"].ToString();
                _Delivery_Location.ZP = row["Zip/Postal"].ToString();
                _Delivery_Location.SP = row["State/Province"].ToString();
                _Delivery_Location.City = row["City"].ToString();
                _Delivery_Location.Country = row["Country"].ToString();

            }
            return _Delivery_Location;
        }
コード例 #3
0
        public static string Insert(Delivery_Location _Delivery_Location)
        {
            DbCommand command = Catalog_Access.CreateCommand();
            command.CommandText = "sp_insertDelivery_Location";

            DbParameter param;

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

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

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

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

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

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

            param = command.CreateParameter();
            param.ParameterName = "@CreatedBy";
            param.Value = _Delivery_Location.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;
        }