public bool InsertCustomerSupervisor(string fullName, string address, string street, string ward, string phone, 
        int customerId, int districtId, int positionId)
    {
        try
        {
            if (CheckExistedSuporvisor(-1, phone)) return false;

            var o = new CustomerSupervisor
                        {
                            FullName = fullName,
                            Address = address,
                            Street = street,
                            Ward = ward,
                            Phone = phone,
                            CustomerId = customerId,
                            DistrictId = districtId,
                            PositionId = positionId
                        };
            db.CustomerSupervisors.InsertOnSubmit(o);
            db.SubmitChanges();
            return true;
        }
        catch
        {
            return false;
        }
    }
Exemplo n.º 2
0
 public bool InsertSupervisor(string FullName, string Address, string Street, string Ward, string Phone, int CustomerId, int DistrictId)
 {
     try
     {
         CustomerSupervisor o = new CustomerSupervisor();
         o.FullName = FullName;
         o.Address = Address;
         o.Street = Street;
         o.Ward = Ward;
         o.Phone = Phone;
         o.CustomerId = CustomerId;
         o.DistrictId = DistrictId;
         db.CustomerSupervisors.InsertOnSubmit(o);
         db.SubmitChanges();
         return true;
     }
     catch
     {
         return false;
     }
 }
Exemplo n.º 3
0
	private void detach_CustomerSupervisors(CustomerSupervisor entity)
	{
		this.SendPropertyChanging();
		entity.Customer = null;
	}
Exemplo n.º 4
0
	private void attach_CustomerSupervisors(CustomerSupervisor entity)
	{
		this.SendPropertyChanging();
		entity.SupervisorPosition = this;
	}
Exemplo n.º 5
0
 partial void DeleteCustomerSupervisor(CustomerSupervisor instance);
Exemplo n.º 6
0
 partial void UpdateCustomerSupervisor(CustomerSupervisor instance);
Exemplo n.º 7
0
 partial void InsertCustomerSupervisor(CustomerSupervisor instance);
Exemplo n.º 8
0
	private void attach_CustomerSupervisors(CustomerSupervisor entity)
	{
		this.SendPropertyChanging();
		entity.District = this;
	}