using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Text.Json.Serialization; using AccountsDAL.DTO.PartyBranch; namespace AccountsDAL.DTO.Party { public class PartyDTO { #region PrivateMembers #region Party private int partyid; private string partycode; private string partyname; private byte partytype; //Not Applicable, One, Multiple #region CodeDefine private int codedefineid = -1; //Id private string codedefinecategorycode; private string codedefinecategoryname; #endregion private string partyfavouringname; private string partyshortname; private int partycombineid = -1; //for consolidating parties of one group, we can use the combine id private string partycombinecode; private string partycombinename; private int partyisvendor; private int partyisserviceprovider; //changed from byte to int for selectlist criteria purpose. private byte partyisaccount; private int partyiscustomer; private byte partyisprospect; private int partyisbank; private string partyisvendorname; private string partyisserviceprovidername; private string partyisaccountname; private string partyiscustomername; private string partyisprospectname; private string partyisbankname; #region ControlAccount private int controlaccountid = -1; private string controlaccountcode; private string controlaccountname; private int controlaccountcodedefineid; #endregion #region AccountLink private int accountlinkid = -1; private string accountlinkcode; private string accountlinkname; #endregion #region AccountGroup private int accountgroupid = -1; private string accountgroupcode; private string accountgroupname; #endregion #region Currency private int currencyid; private string currencycode; private string currencyname; #endregion private int defaultaddressid = -1; #endregion #region Base private int partycreatedbyid; //Created By Person (User Id) private DateTime partycreatedon; //Created On Date private int partymodifiedbyid; //Modified By Person (User Id) private DateTime partymodifiedon; //Modified On Date #endregion #region Standard private Int16 partysortorder; private byte partystatus; //0.Pending, 1.Active, 2.Deleted, 3.Amended, 4.Inactive, 5.Archived private Int16 partyversion; //No Of Times Updated private byte partysourcetype; private int tenantid; #endregion #region Account TDS Fields private byte accountiscompany = 1; private byte accountistdsapplicable = 1; private string accounttdsstate = "NONE"; //TDSState private int tdscategoryid = -1; //TDSCategory private string tdscategorycode; //TDSCategory private string tdscategoryname; #endregion //private PartyBranchDTO partybranchdto; #endregion #region ForpartywithbranchTempFields private int bankid = -1; //Id private string bankcode = ""; //Code private int bankbranchid = -1; //Id private string bankbranchcode = ""; //Code #endregion #region Forparywithbranch ifsc,accountnumber,accounttype private string banckifsccode = "0"; private string accountbankaccountnumber = "0"; private string accountbankaccounttype = "0"; private byte accountbanktype; #endregion private string partythumbnail; //ThumbNail //private IList partyaddon = new List(); #region public virtualMembers #region Party public virtual int PartyId { get { return partyid; } set { partyid = value; } } public virtual string PartyCode { get { return partycode; } set { partycode = value; } } public virtual string PartyName { get { return partyname; } set { partyname = value; } } public virtual byte PartyType { get { return partytype; } set { partytype = value; PartyTypeName = value switch { 0 => "SUPPLIERS", 1 => "CUSTOMERS", 2 => "DEALERS", 3 => "SERVICEPROVIDERS", 4 => "SUBCONTRACTORS", 5 => "FINANCEPROVIDERS", _ => "NONE" }; } } #region CodeDefine public virtual int CodeDefineId { get { return codedefineid; } //Id set { codedefineid = value; } //Id } public virtual string CodeDefineCategoryCode { get { return codedefinecategorycode; } // CategoryCode set { codedefinecategorycode = value; } //CategoryCode } public virtual string CodeDefineCategoryName { get { return codedefinecategoryname; } //CategoryName set { codedefinecategoryname = value; } //CategoryName } #endregion public virtual string PartyFavouringName { get { return partyfavouringname; } set { partyfavouringname = value; } } public virtual string PartyShortName { get { return partyshortname; } set { partyshortname = value; } } public virtual int PartyCombineId { get { return partycombineid; } //for consolidating parties of one group, we can use the combine id set { partycombineid = value; } //for consolidating parties of one group, we can use the combine id } public virtual string PartyCombineCode { get { return partycombinecode; } //for consolidating parties of one group, we can use the combine id set { partycombinecode = value; } //for consolidating parties of one group, we can use the combine id } public virtual string PartyCombineName { get { return partycombinename; } //for consolidating parties of one group, we can use the combine id set { partycombinename = value; } //for consolidating parties of one group, we can use the combine id } public virtual int PartyIsVendor { get { return partyisvendor; } //IsVendor set { partyisvendor = value; PartyIsVendorName = value == 0 ? "YES" : "NO"; } } public virtual int PartyIsServiceProvider { get { return partyisserviceprovider; } //changed from byte to int for selectlist criteria purpose. set { partyisserviceprovider = value; PartyIsServiceProviderName = value == 0 ? "YES" : "NO"; } } public virtual byte PartyIsAccount { get { return partyisaccount; } //IsAccount set { partyisaccount = value; PartyIsAccountName = value == 0 ? "YES" : "NO"; } //IsAccount } public virtual int PartyIsCustomer { get { return partyiscustomer; } //IsCustomer set { partyiscustomer = value; PartyIsCustomerName = value == 0 ? "YES" : "NO"; } //IsCustomer } public virtual byte PartyIsProspect { get { return partyisprospect; } //IsProspect set { partyisprospect = value; PartyIsProspectName = value == 0 ? "YES" : "NO"; } //IsProspect } public virtual int PartyIsBank { get { return partyisbank; } //IsBank set { partyisbank = value; PartyIsBankName = value == 0 ? "YES" : "NO"; } //IsBank } public virtual string PartyIsVendorName { get { return partyisvendorname; } //IsVendor set { partyisvendorname = value; } //IsVendor } private string partytypename; public virtual string PartyTypeName { get { return partytypename; } //IsVendor set { partytypename = value; } //IsVendor } public virtual string PartyIsServiceProviderName { get { return partyisserviceprovidername; } //changed from byte to int for selectlist criteria purpose. set { partyisserviceprovidername = value; } //changed from byte to int for selectlist criteria purpose. } public virtual string PartyIsAccountName { get { return partyisaccountname; } set { partyisaccountname = value; } } public virtual string PartyIsCustomerName { get { return partyiscustomername; } set { partyiscustomername = value; } } public virtual string PartyIsProspectName { get { return partyisprospectname; } //IsProspect set { partyisprospectname = value; } //IsProspect } public virtual string PartyIsBankName { get { return partyisbankname; } //IsBank set { partyisbankname = value; } //IsBank } #region ControlAccount public virtual int ControlAccountId { get { return controlaccountid; } set { controlaccountid = value; } } public virtual string ControlAccountCode { get { return controlaccountcode; } set { controlaccountcode = value; } } public virtual string ControlAccountName { get { return controlaccountname; } set { controlaccountname = value; } } public virtual int ControlAccountCodeDefineId { get { return controlaccountcodedefineid; } set { controlaccountcodedefineid = value; } } #endregion #region AccountLink public virtual int AccountLinkId { get { return accountlinkid; } set { accountlinkid = value; } } public virtual string AccountLinkCode { get { return accountlinkcode; } set { accountlinkcode = value; } } public virtual string AccountLinkName { get { return accountlinkname; } set { accountlinkname = value; } } #endregion #region AccountGroup public virtual int AccountGroupId { get { return accountgroupid; } set { accountgroupid = value; } } public virtual string AccountGroupCode { get { return accountgroupcode; } set { accountgroupcode = value; } } public virtual string AccountGroupName { get { return accountgroupname; } set { accountgroupname = value; } } #endregion #region Currency public virtual int CurrencyId { get { return currencyid; } set { currencyid = value; } } public virtual string CurrencyCode { get { return currencycode; } set { currencycode = value; } } public virtual string CurrencyName { get { return currencyname; } set { currencyname = value; } } #endregion public virtual int DefaultAddressId { get { return defaultaddressid; } set { defaultaddressid = value; } } #endregion #region Base public virtual int PartyCreatedById { get { return partycreatedbyid; } //Created By Person (User Id) set { partycreatedbyid = value; } //Created By Person (User Id) } public virtual DateTime PartyCreatedOn { get { return partycreatedon; } //Created On Date set { partycreatedon = value; } //Created On Date } public virtual int PartyModifiedById { get { return partymodifiedbyid; } //Modified By Person (User Id) set { partymodifiedbyid = value; } } public virtual DateTime PartyModifiedOn { get { return partymodifiedon; } //Modified On Date set { partymodifiedon = value; } } #endregion #region Standard public virtual Int16 PartySortOrder { get { return partysortorder; } set { partysortorder = value; } } public virtual byte PartyStatus { get { return partystatus; } //0.Pending, 1.Active, 2.Deleted, 3.Amended, 4.Inactive, 5.Archived set { partystatus = value; } } public virtual Int16 PartyVersion { get { return partyversion; } //No Of Times Updated set { partyversion = value; } } public virtual byte PartySourceType { get { return partysourcetype; } //no of times updated set { partysourcetype = value; } } public virtual int TenantId { get { return tenantid; } //no of times updated set { tenantid = value; } } #endregion //public virtual PartyBranchDTO PartyBranchDTO //{ // get { return partybranchdto; } // set { partybranchdto = value; } //} #endregion #region Account TDS Field Value public virtual byte AccountIsCompany { get { return accountiscompany; } //IsCompany set { accountiscompany = value; } //IsCompany } public virtual byte AccountIsTDSApplicable { get { return accountistdsapplicable; } //IsTDSApplicable set { accountistdsapplicable = value; } //IsTDSApplicable } public virtual string AccountTDSState { get { return accounttdsstate; } //TDSState set { accounttdsstate = value; } //TDSState } public virtual int TDSCategoryId { get { return tdscategoryid; } //TDSCategory set { tdscategoryid = value; } //TDSCategory } public virtual string TDSCategoryCode { get { return tdscategorycode; } //TDSCategory set { tdscategorycode = value; } //TDSCategory } public virtual string TDSCategoryName { get { return tdscategoryname; } //TDSCategory set { tdscategoryname = value; } //TDSCategory } #endregion #region ForpartywithbranchTempFields public virtual int BankId { get { return bankid; } //Id set { bankid = value; } //Id } public virtual string BankCode { get { return bankcode; } //Code set { bankcode = value; } //Code } #endregion #region ForpartywithbranchTempFields public virtual int BankBranchId { get { return bankbranchid; } //Id set { bankbranchid = value; } //Id } public virtual string BankBranchCode { get { return bankbranchcode; } //Code set { bankbranchcode = value; } //Code } #endregion #region partytempfield public virtual string AccountBankAccountNumber { get { return accountbankaccountnumber; } //BankAccountNumber set { accountbankaccountnumber = value; } //BankAccountNumber } public virtual string AccountBankAccountType { get { return accountbankaccounttype; } //BankAccountType set { accountbankaccounttype = value; } //BankAccountType } public virtual string BankIFSCCode { get { return banckifsccode; } //IFSCCode set { banckifsccode = value; } //IFSCCode } public virtual byte AccountBankType { get { return accountbanktype; } //BankType set { accountbanktype = value; } //BankType } private string statetinnumber = ""; public virtual string StateTINNumber { get { return statetinnumber; } //StateTINNumber set { statetinnumber = value; } //StateTINNumber } private string partycreatedbyname; private string partymodifiedbyname; public virtual string PartyCreatedByName { get { return partycreatedbyname; } set { partycreatedbyname = value; } } public virtual string PartyModifiedByName { get { return partymodifiedbyname; } set { partymodifiedbyname = value; } } //public virtual IList PartyAddon //{ // get { return partyaddon; } // set { partyaddon = value; } //} #endregion private int temppartyversion; public virtual int TempPartyVersion { get { return temppartyversion; } //no of times updated set { temppartyversion = value; } } private string bankswiftcode; public virtual string BankSwiftCode { get { return bankswiftcode; } set { bankswiftcode = value; } } private IList bulkpostpartyoudtos = new List(); public virtual IList BulkPostPartyOUDTOs { get { return bulkpostpartyoudtos; } set { bulkpostpartyoudtos = value; } } private int accountbankbranchid = -1; public virtual int AccountBankBranchId { get { return accountbankbranchid; } // AccountBankBranchId // set { accountbankbranchid = value; }//AccountBankBranchId } private int approvalouid = -1; public virtual int ApprovalOuId { get { return approvalouid; } // accountbankbranchid // set { approvalouid = value; }//accountbankbranchid } public virtual string PartyThumbNail { get { return partythumbnail; } //ThumbNail set { partythumbnail = value; } //ThumbNail } public PartyBranchDTO PartyBranchDTO { get; set; } = new PartyBranchDTO(); // Save requests are bound via System.Text.Json (FastEndpoints), but GetParty's response is // serialized via Newtonsoft.Json (JsonConvert.SerializeObject) — so [Newtonsoft.Json.JsonIgnore] // hides this from the Get response (matching GB4's shape, which never had this field) without // affecting deserialization of multi-branch Save requests that populate it directly. [Newtonsoft.Json.JsonIgnore] public List PartyBranchList { get; set; } = new List(); } }