private void detach_CompanyPayHists(CompanyPayHist entity)
		{
			this.SendPropertyChanging();
			entity.Company = null;
		}
 partial void DeleteCompanyPayHist(CompanyPayHist instance);
 partial void UpdateCompanyPayHist(CompanyPayHist instance);
 partial void InsertCompanyPayHist(CompanyPayHist instance);
Exemplo n.º 5
0
    public int Pay_Amount_to_Seller(decimal amount, Guid salesID, string concept)
    {
        int status = 0;
        try
        {
            // Add in CompanyPayHists
            CompanyPayHist cph = new CompanyPayHist
            {
                CompanyID = 0,
                Amount = amount,
                Date = DateTime.Now,
                Forced = 1,
                Concept = concept,
                IsACompany = false,
                SalesID = salesID
            };

            db.CompanyPayHists.InsertOnSubmit(cph);
            db.SubmitChanges();
        }
        catch (Exception e)
        {
            status = -1;
            log.Debug("Adding a payment for the seller with id " + salesID.ToString() +  " Error is as follows: " + e);
        }
        return status;
    }
Exemplo n.º 6
0
    ///*****COMPANY FUNCTIONS*****\\\
    // Returns 0 if success, -1 if problems
    public int Pay_Amount_to_Company(decimal amount, string strcompany, string concept, int forced)
    {
        int status = 0;
        try
        {
            // Change Value in Company
            Company qry = (from c in db.Companies where c.Name == strcompany select c).Single();
            qry.Paid = qry.Paid + amount;
            // Add in CompanyPayHists
            CompanyPayHist cph = new CompanyPayHist{
                CompanyID = qry.CompanyID,
                Amount = amount,
                Date = DateTime.Now,
                Forced = forced,
                Concept = concept,
                IsACompany = true,
                SalesID = new Guid("00000000-0000-0000-0000-000000000000")
            };

            db.CompanyPayHists.InsertOnSubmit(cph);
            db.SubmitChanges();
        }
        catch
        {
            status = -1;
        }
        return status;
    }