public AgentParty()
 {
     PartyIdentification = new PartyIdentification();
     PartyName = new PartyName();
     PostalAddress = new PostalAddress();
     PartyLegalEntity = new PartyLegalEntity();
 }
Example #2
0
 /// <summary>
 /// The function updates the party details.
 /// </summary>
 /// <returns></returns> Returns if the update succseed or not
 public string UpdateParty()
 {
     con.sqlCommand("UpdatePartyDetails");
     con.InsertValstring("@partyName", PartyName.Trim());
     con.InsertValint("@member_size", membersSize);
     con.InsertValstring("@platform", platform.Trim());
     return(con.getVal("@Result"));
 }
Example #3
0
 public string UpdateMemberParty()
 {
     con.sqlCommand("UpdateMemberParty");
     con.InsertValint("@member_code", MemberCode);
     con.InsertValstring("@party_name", PartyName.Trim());
     con.InsertValstring("@f_name", FName.Trim());
     con.InsertValstring("@l_name", LName.Trim());
     con.InsertValstring("@birth_date", GetDob().ToString());
     con.InsertValint("@list_place", ListPlace);
     con.InsertValstring("@education", Education.Trim());
     con.InsertValstring("@experience", Experience.Trim());
     return(con.getVal("@Result").ToString());
 }
Example #4
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (PartyName != null)
         {
             hashCode = hashCode * 59 + PartyName.GetHashCode();
         }
         if (Email != null)
         {
             hashCode = hashCode * 59 + Email.GetHashCode();
         }
         return(hashCode);
     }
 }
Example #5
0
        /// <summary>
        /// Returns true if InboxesCreateRequest instances are equal
        /// </summary>
        /// <param name="other">Instance of InboxesCreateRequest to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(InboxesCreateRequest other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     PartyName == other.PartyName ||
                     PartyName != null &&
                     PartyName.Equals(other.PartyName)
                     ) &&
                 (
                     Email == other.Email ||
                     Email != null &&
                     Email.Equals(other.Email)
                 ));
        }
Example #6
0
 public SignatoryParty()
 {
     PartyIdentification = new PartyIdentification();
     PartyName           = new PartyName();
 }
        public void UpdateInvoiceMaster()
        {
            string FilePath = @"D:\DONT DELETE\Desktop\Invoietoday\invoice (188).xlsx";
            string con      = @"Provider=Microsoft.ACE.OLEDB.12.0; Data Source=" + FilePath + ";Extended Properties ='Excel 8.0;HDR=Yes';";

            using (OleDbConnection OleDbCon = new OleDbConnection(con))
            {
                OleDbCon.Open();
                OleDbCommand    oleDbCommand = new OleDbCommand("Select * From [Invoicing$]", OleDbCon);
                OleDbDataReader dr           = oleDbCommand.ExecuteReader();

                SqlConnection sqlCon = new SqlConnection(GetConnectionString());

                while (dr.Read())
                {
                    int      invoiceNo   = 0;
                    string   orderID     = string.Empty;
                    DateTime invoiceDate = new DateTime();
                    string   productID   = "";
                    string   ErrorMsg    = string.Empty;
                    int      Result      = 0;

                    int      quantity = 0;
                    decimal  rate = 0M, unitPrice = 0M, netSales = 0M, total = 0.00M;
                    decimal  CST = 0.00M, VAT = 0.00M, ShippingHandling = 0.00M;
                    DateTime orderDate = new DateTime();
                    string   TaxGroup = string.Empty, PartyName, Address, EmailID, MobNo, Vendor;

                    orderID = Converter.ToString(dr["Order ID"].ToString());
                    if (string.IsNullOrEmpty(orderID))
                    {
                        continue;
                    }
                    productID = Converter.ToString(dr["SKU"]).ToUpper();
                    quantity  = Converter.ToInt(dr["Quantity"]);
                    rate      = Converter.ToDecimal(dr["Rate"]);
                    //TaxGroup = Converter.ToString(dr["Tax Group"]);
                    PartyName        = Converter.ToString(dr["Party's Name"]);
                    Address          = Converter.ToString(dr["Address"]);
                    EmailID          = Converter.ToString(dr["Email ID"]);
                    MobNo            = Converter.ToString(dr["Mobile No"]);
                    ShippingHandling = Math.Round((Converter.ToDecimal(dr["Shipping & Handling"])), 2);
                    //Vendor = Converter.ToString(dr["Sales Group"]);

                    netSales = unitPrice * quantity;
                    total    = (rate * quantity) + Math.Round((Converter.ToDecimal(dr["Shipping & Handling"])), 2);

                    string query = "Update InvoiceMaster Set";
                    if (!string.IsNullOrEmpty(PartyName))
                    {
                        query += " PartyName = '" + PartyName.Replace("'", "''") + "'";
                    }
                    if (!string.IsNullOrEmpty(Address))
                    {
                        query += " Address = '" + Address.Replace("'", "''") + "'";
                    }
                    if (!string.IsNullOrEmpty(EmailID))
                    {
                        query += " EmailID = '" + PartyName + "'";
                    }
                    if (!string.IsNullOrEmpty(MobNo))
                    {
                        query += " MobilNo = '" + MobNo + "'";
                    }
                    if (quantity > 0)
                    {
                        query += " Quantity = " + quantity;
                    }
                    if (ShippingHandling > 0)
                    {
                        query += " PackagingAndForwarding = " + ShippingHandling;
                    }

                    int     DbQuantity         = 0;
                    decimal DbCST              = 0M;
                    decimal DbShippingHandling = 0M;

                    SqlCommand cmd = null;
                    if (rate > 0 || quantity > 0)
                    {
                        cmd = new SqlCommand("Select CST, Quantity From InvoiceMaster Where OrderID = '" + orderID + "' ProductID = '" + productID + "'");

                        using (SqlDataReader dr1 = cmd.ExecuteReader())
                        {
                            if (dr1.HasRows)
                            {
                                while (dr1.Read())
                                {
                                    DbCST      = Convert.ToDecimal(dr["CST"]);
                                    DbQuantity = Convert.ToInt32(dr["Quantity"]);

                                    if (DbCST > 0)
                                    {
                                        TaxGroup = "CST";
                                    }
                                    break;
                                }
                            }
                        }

                        if (quantity == 0)
                        {
                            quantity = DbQuantity;
                        }

                        decimal VatCstRate = 0M;
                        if (TaxGroup == "CST")
                        {
                            VatCstRate = FindVatCstRate(productID, false) + 100;
                            unitPrice  = Math.Round(((rate / VatCstRate) * 100), 2);
                            CST        = (rate - unitPrice) * quantity;
                        }
                        else
                        {
                            VatCstRate = FindVatCstRate(productID, true) + 100;
                            unitPrice  = Math.Round(((rate / VatCstRate) * 100), 2);
                            VAT        = (rate - unitPrice) * quantity;
                        }

                        netSales = unitPrice * quantity;

                        if (ShippingHandling == 0)
                        {
                            ShippingHandling = DbShippingHandling;
                        }

                        total = (rate * quantity) + ShippingHandling;

                        query += " Rate = " + rate + ", UnitPrice = " + unitPrice + ",NetSale=" + netSales + ", VAT=" + VAT + ", CST=" + CST + ", Total=" + total;
                    }

                    query += " Where ProductID = '" + productID + "' And OrderID = '" + orderID + "'";

                    cmd = new SqlCommand(query, sqlCon);
                }
            }
        }
 public Party()
 {
     PartyName = new PartyName();
     PostalAddress = new PostalAddress();
     PartyLegalEntity = new PartyLegalEntity();
 }