Beispiel #1
0
        public void UpdateVendor(int FormVendorID)
        {
            PurchaseDS.FormVendorRow FormVendorRow = new FormVendorBLL().GetFormVendorByID(FormVendorID)[0];
            MasterData.VendorRow VendorRow = this.TAVendor.GetDataByID(FormVendorRow.VendorID)[0];
            MasterData.VendorTypeRow vendorTypeRow = new MasterDataBLL().GetVendorTypeById(FormVendorRow.VendorTypeID);
            VendorRow.VendorName = FormVendorRow.VendorName;
            VendorRow.VendorAddress = FormVendorRow.VendorAddress;
            VendorRow.City = FormVendorRow.City;

            VendorRow.Postal = FormVendorRow.Postal;
            VendorRow.ContactName = FormVendorRow.ContactName;
            VendorRow.VendorTypeID = FormVendorRow.VendorTypeID;
            VendorRow.CompanyID = vendorTypeRow.CompanyID;

            VendorRow.PhoneNumber = FormVendorRow.PhoneNumber;
            VendorRow.OneTimeVendor = FormVendorRow.OneTimeVendor;
            VendorRow.HoldVendor = FormVendorRow.HoldVendor;
            VendorRow.PurchaseingPostalCode = FormVendorRow.PurchaseingPostalCode;
            VendorRow.AlphaSearchKey = FormVendorRow.AlphaSearchKey;
            VendorRow.PurchasingContact = FormVendorRow.PurchasingContact;
            VendorRow.PurchasingAddress = FormVendorRow.PurchasingAddress;
            VendorRow.PurchasingCity = FormVendorRow.PurchasingCity;
            VendorRow.PurchasePhoneNumber = FormVendorRow.PurchasePhoneNumber;
            VendorRow.BankCode = FormVendorRow.BankCode;
            VendorRow.MethodPaymentID = FormVendorRow.MethodPaymentID;
            VendorRow.PaymentTermID = FormVendorRow.PaymentTermID;
            VendorRow.TransTypeID = FormVendorRow.TransTypeID;
            VendorRow.VATTypeID = FormVendorRow.VATTypeID;
            VendorRow.BankName = FormVendorRow.BankName;
            VendorRow.AccountNo = FormVendorRow.AccountNo;
            VendorRow.BankNo = FormVendorRow.BankNo;
            VendorRow.ACTypeID = FormVendorRow.ACTypeID;
            if (!FormVendorRow.IsRemarkNull()) {
                VendorRow.Remark = FormVendorRow.Remark;
            }
            VendorRow.BankCodeID = FormVendorRow.BankCodeID;

            if (FormVendorRow.ActionType == (int)SystemEnums.VendorActionType.Delete) {
                VendorRow.IsActive = false;
            }

            if (FormVendorRow.ActionType == (int)SystemEnums.VendorActionType.Reactive) {
                VendorRow.IsActive = true;
            }
            VendorRow.ActionType = FormVendorRow.ActionType;
            VendorRow.IsExport = false;
            this.TAVendor.Update(VendorRow);

            FormVendorRow.VendorID = VendorRow.VendorID;

            new PurchaseDSTableAdapters.FormVendorTableAdapter().Update(FormVendorRow);
        }
Beispiel #2
0
        public void InsertVendor(int FormVendorID)
        {
            PurchaseDS.FormVendorRow FormVendorRow = new FormVendorBLL().GetFormVendorByID(FormVendorID)[0];
            MasterData.VendorDataTable tb = new MasterData.VendorDataTable();
            MasterData.VendorRow newVendorRow = tb.NewVendorRow();
            MasterData.VendorTypeRow vendorTypeRow = new MasterDataBLL().GetVendorTypeById(FormVendorRow.VendorTypeID);
            int? Seq = 0;
            TAVendor.GenerateVenderCode(new MasterDataBLL().GetVendorTypeById(FormVendorRow.VendorTypeID).CompanyID, ref Seq);
            newVendorRow.VendorCode = Seq.ToString();
            newVendorRow.VendorName = FormVendorRow.VendorName;
            newVendorRow.VendorAddress = FormVendorRow.VendorAddress;
            newVendorRow.City = FormVendorRow.City;

            newVendorRow.Postal = FormVendorRow.Postal;
            newVendorRow.ContactName = FormVendorRow.ContactName;
            newVendorRow.VendorTypeID = FormVendorRow.VendorTypeID;
            newVendorRow.CompanyID = vendorTypeRow.CompanyID;

            newVendorRow.PhoneNumber = FormVendorRow.PhoneNumber;
            newVendorRow.OneTimeVendor = FormVendorRow.OneTimeVendor;
            newVendorRow.HoldVendor = FormVendorRow.HoldVendor;
            newVendorRow.PurchaseingPostalCode = FormVendorRow.PurchaseingPostalCode;
            newVendorRow.AlphaSearchKey = FormVendorRow.AlphaSearchKey;
            newVendorRow.PurchasingContact = FormVendorRow.PurchasingContact;
            newVendorRow.PurchasingAddress = FormVendorRow.PurchasingAddress;
            newVendorRow.PurchasingCity = FormVendorRow.PurchasingCity;
            newVendorRow.PurchasePhoneNumber = FormVendorRow.PurchasePhoneNumber;
            newVendorRow.BankCode = FormVendorRow.BankCode;
            newVendorRow.MethodPaymentID = FormVendorRow.MethodPaymentID;
            newVendorRow.PaymentTermID = FormVendorRow.PaymentTermID;
            newVendorRow.TransTypeID = FormVendorRow.TransTypeID;
            newVendorRow.VATTypeID = FormVendorRow.VATTypeID;
            newVendorRow.BankName = FormVendorRow.BankName;
            newVendorRow.AccountNo = FormVendorRow.AccountNo;
            newVendorRow.BankNo = FormVendorRow.BankNo;
            newVendorRow.ACTypeID = FormVendorRow.ACTypeID;
            newVendorRow.BankCodeID = FormVendorRow.BankCodeID;
            newVendorRow.IsExport = false;
            if (!FormVendorRow.IsRemarkNull()) {
                newVendorRow.Remark = FormVendorRow.Remark;
            }
            newVendorRow.IsActive = true;
            newVendorRow.ActionType = (int)SystemEnums.VendorActionType.Add;
            tb.AddVendorRow(newVendorRow);
            this.TAVendor.Update(tb);

            FormVendorRow.VendorID = newVendorRow.VendorID;

            new PurchaseDSTableAdapters.FormVendorTableAdapter().Update(FormVendorRow);
        }