public int CompareTo(ExpenditureByTerritory other) { const StringComparison comparisonIgnoreCase = StringComparison.OrdinalIgnoreCase; if (ReferenceEquals(this, other)) { return(0); } if (ReferenceEquals(null, other)) { return(1); } var monthIdComparison = MonthId.CompareTo(other.MonthId); if (monthIdComparison != 0) { return(monthIdComparison); } var monthComparison = string.Compare(Month, other.Month, comparisonIgnoreCase); if (monthComparison != 0) { return(monthComparison); } var productNameComparison = string.Compare(ProductName, other.ProductName, comparisonIgnoreCase); if (productNameComparison != 0) { return(productNameComparison); } var companyNameComparison = string.Compare(CompanyName, other.CompanyName, comparisonIgnoreCase); if (companyNameComparison != 0) { return(companyNameComparison); } var summRbComparison = SummRb.CompareTo(other.SummRb); if (summRbComparison != 0) { return(summRbComparison); } var summUsdComparison = SummUsd.CompareTo(other.SummUsd); if (summUsdComparison != 0) { return(summUsdComparison); } return(string.Compare(MoneyOrBarter, other.MoneyOrBarter, comparisonIgnoreCase)); }
public int CompareTo(MonthBaseDto other) { if (ReferenceEquals(this, other)) { return(0); } if (ReferenceEquals(null, other)) { return(1); } return(MonthId.CompareTo(other.MonthId)); }
/// <summary> /// Получение информации о всех месяцах и id вариантов в них /// </summary> /// <param name="Url">Базовая ссылка по умолчанию установлена ссылка на химию</param> /// <returns></returns> public static List <MonthId> Get() { List <MonthId> months = new List <MonthId>(0); HtmlDocument htmlDocument = new HtmlDocument(); htmlDocument.LoadHtml(Function.getHTML(Setting.Url)); // Парсинг главной страницы HtmlNodeCollection htmlNodes = htmlDocument.DocumentNode.SelectNodes("//tr"); MonthId month = new MonthId { Mesac = ("New " + ((Monthes)(DateTime.Now.Month)).ToString()), varXimIndices = new List <Var>(0) }; foreach (var Component in htmlNodes) { try { if (Component.Attributes["class"].Value == "pinkmark") { HtmlDocument html = new HtmlDocument(); html.LoadHtml(Component.InnerHtml); HtmlNodeCollection nodes = html.DocumentNode.SelectNodes("//a"); foreach (var ComponentTwo in nodes) { try { month.varXimIndices.Add(new Var { Id = ComponentTwo.Attributes["href"].Value.Replace("/test?id=", ""), Num = (uint)(month.varXimIndices.Count + 1) }); } catch { } } } } catch { } } months.Add(month); // Парсинг всего архива htmlDocument.LoadHtml(Function.getHTML(Setting.Url + Archive)); htmlNodes = htmlDocument.DocumentNode.SelectNodes("//div"); if (htmlNodes != null) { foreach (var Component in htmlNodes) { try { if (Component.Attributes["class"].Value == "content") { //поиск месяцов и их контентов List <string> Mesaca = new List <string>(0); List <HtmlDocument> HtmlMesacContent = new List <HtmlDocument>(0); htmlDocument.LoadHtml(Component.InnerHtml); htmlNodes = htmlDocument.DocumentNode.SelectNodes("//h3"); //Записываем месяца согласно их порядку foreach (var ComponentTmo in htmlNodes) { try { if (ComponentTmo.Attributes["style"].Value == "margin-bottom:-5px") { Mesaca.Add("Архив: " + ComponentTmo.InnerText); } } catch { } } //Записываем контент каждого месяца htmlNodes = htmlDocument.DocumentNode.SelectNodes("//table"); foreach (var ComponentTmo in htmlNodes) { try { if (ComponentTmo.Attributes["class"].Value == "our_test") { HtmlDocument html = new HtmlDocument(); html.LoadHtml(ComponentTmo.InnerHtml); HtmlMesacContent.Add(html); } } catch { } } //Добавление данных о каждом месяце и их вариантах for (int i = 0; i < HtmlMesacContent.Count; i++) { htmlNodes = HtmlMesacContent[i].DocumentNode.SelectNodes("//a"); List <Var> IdVar = new List <Var>(0); foreach (var ComponentTwo in htmlNodes) { try { IdVar.Add(new Var { Num = (uint)(IdVar.Count + 1), Id = ComponentTwo.Attributes["href"].Value.Remove(0, ComponentTwo.Attributes["href"].Value.LastIndexOf('=') + 1) }); } catch { } } months.Add(new MonthId { Mesac = Mesaca[i], varXimIndices = IdVar }); } break; } } catch { } } } return(months); }
protected void InvoiceDetails() { //ClearInvoiceControl(); UserName = ddlSerContractor.SelectedValue; ProductDivisionId = 18; YearId = Convert.ToInt32(Ddlyear.SelectedValue); if (ddlSerContractor.SelectedValue.Equals("0")) { spnSoldto.Visible = false; } if (!string.IsNullOrEmpty(ddlMonth.SelectedValue) && ddlMonth.SelectedValue != "0") { MonthId = Convert.ToInt32(ddlMonth.SelectedValue); } else { MonthId = DateTime.Now.Month; ddlMonth.SelectedValue = DateTime.Now.Month.ToString(); } hdnRawUrl.Value = "yId=" + YearId.ToString() + "&mId=" + MonthId.ToString(); if (!Roles.GetRolesForUser(objCommonMIS.EmpId).Any(x => (x.Contains("SC") || x.Contains("SC_SIMS")))) { AscId = Convert.ToInt32(ddlSerContractor.SelectedValue);; RegionId = Convert.ToInt32(ddlRegion.SelectedValue); BranchId = Convert.ToInt32(ddlBranch.SelectedValue); hdnRawUrl.Value = hdnRawUrl.Value + "&arb=" + ddlSerContractor.SelectedValue + "|" + ddlRegion.SelectedValue + "|" + ddlBranch.SelectedValue; hdnRawUrl.Value = hdnRawUrl.Value + "&rbv=" + ddlRegion.SelectedItem.Text + "|" + ddlBranch.SelectedItem.Text; } else { //objsimsinvoice.AscId = 0; RegionId = 0; BranchId = 0; hdnRawUrl.Value = hdnRawUrl.Value + "&arb="; hdnRawUrl.Value = hdnRawUrl.Value + "&rbv="; } DataSet dsInvoice = GetInvoiceDetails(); if (dsInvoice != null) { if (dsInvoice.Tables[1].Rows.Count > 0) { lblCustomerName.Text = "<b>" + dsInvoice.Tables[1].Rows[0]["Sc_Name"].ToString() + "</b>"; lblAscAddress.Text = dsInvoice.Tables[1].Rows[0]["Addres"].ToString(); } if (dsInvoice.Tables[2].Rows.Count > 0) { lblInvoiceNo.Text = dsInvoice.Tables[2].Rows[0]["InvoiceNo"].ToString(); lblInvoiceDate.Text = dsInvoice.Tables[2].Rows[0]["InvoiceDt"].ToString(); } if (dsInvoice.Tables[0].Rows.Count > 0) { taxableAmt = Math.Round(Convert.ToDouble(dsInvoice.Tables[0].Compute("Sum(TaxableAmt)", "")), 2); } if (dsInvoice.Tables[3].Rows.Count > 0) { int countL = 0; int countO = 0; foreach (DataRow dr in dsInvoice.Tables[3].Rows) { if (dr["Activity"].ToString().Equals("L")) { countL = countL + 1; } if (dr["Activity"].ToString().Equals("O")) { countO = countO + 1; } } lblRepLoQ.Text = countL.ToString(); lblRepLoA.Text = Convert.ToString(Convert.ToDouble(countL) * Convert.ToDouble(lblRepLoU.Text)); lblRepOoQ.Text = countO.ToString(); lblRepOoA.Text = Convert.ToString(Convert.ToDouble(countO) * Convert.ToDouble(lblRepOoU.Text)); } foreach (DataRow dr in dsInvoice.Tables[0].Rows) { if (dr["ActivityParameter_SNo"].ToString().Equals("0")) { lblQuanityfd.Text = dr["Quantity"].ToString(); lblfdUnitPrice.Text = dr["UnitPrice"].ToString(); lblfdamount.Text = dr["Amount"].ToString(); } } calculate(); } }
protected void InvoiceDetails() { try { //ClearInvoiceControl(); UserName = Membership.GetUser().UserName; ProductDivisionId = 13; YearId = Convert.ToInt32(Ddlyear.SelectedValue); if (ddlSerContractor.SelectedValue.Equals("0")) { spnSoldto.Visible = false; } if (!string.IsNullOrEmpty(ddlMonth.SelectedValue) && ddlMonth.SelectedValue != "0") { MonthId = Convert.ToInt32(ddlMonth.SelectedValue); } else { MonthId = DateTime.Now.Month; ddlMonth.SelectedValue = DateTime.Now.Month.ToString(); } hdnRawUrl.Value = "yId=" + YearId.ToString() + "&mId=" + MonthId.ToString(); if (!Roles.GetRolesForUser(objCommonMIS.EmpId).Any(x => (x.Contains("SC") || x.Contains("SC_SIMS")))) { AscId = Convert.ToInt32(ddlSerContractor.SelectedValue); RegionId = Convert.ToInt32(ddlRegion.SelectedValue); BranchId = Convert.ToInt32(ddlBranch.SelectedValue); hdnRawUrl.Value = hdnRawUrl.Value + "&arb=" + ddlSerContractor.SelectedValue + "|" + ddlRegion.SelectedValue + "|" + ddlBranch.SelectedValue; hdnRawUrl.Value = hdnRawUrl.Value + "&rbv=" + ddlRegion.SelectedItem.Text + "|" + ddlBranch.SelectedItem.Text; } else { AscId = 0; RegionId = 0; BranchId = 0; hdnRawUrl.Value = hdnRawUrl.Value + "&arb="; hdnRawUrl.Value = hdnRawUrl.Value + "&rbv="; } DataSet dsInvoice = GetInvoiceDetails(); if (dsInvoice != null) { if (dsInvoice.Tables[1].Rows.Count > 0) { lblCustomerName.Text = "<b>" + dsInvoice.Tables[1].Rows[0]["Sc_Name"].ToString() + "</b>"; lblAscAddress.Text = dsInvoice.Tables[1].Rows[0]["Addres"].ToString(); } if (dsInvoice.Tables[2].Rows.Count > 0) { lblInvoiceNo.Text = dsInvoice.Tables[2].Rows[0]["InvoiceNo"].ToString(); lblInvoiceDate.Text = dsInvoice.Tables[2].Rows[0]["InvoiceDt"].ToString(); } if (dsInvoice.Tables[0].Rows.Count > 0) { taxableAmt = Math.Round(Convert.ToDouble(dsInvoice.Tables[0].Compute("Sum(TaxableAmt)", "")), 2); } // callnew proc calculate(); } } catch (Exception ex) { SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString()); } }
protected void InvoiceDetails() { try { //ClearInvoiceControl(); UserName = Membership.GetUser().UserName; ProductDivisionId = 13; YearId = Convert.ToInt32(Ddlyear.SelectedValue); if (ddlSerContractor.SelectedValue.Equals("0")) { spnSoldto.Visible = false; } if (!string.IsNullOrEmpty(ddlMonth.SelectedValue) && ddlMonth.SelectedValue != "0") { MonthId = Convert.ToInt32(ddlMonth.SelectedValue); } else { MonthId = DateTime.Now.Month; ddlMonth.SelectedValue = DateTime.Now.Month.ToString(); } hdnRawUrl.Value = "yId=" + YearId.ToString() + "&mId=" + MonthId.ToString(); if (!Roles.GetRolesForUser(objCommonMIS.EmpId).Any(x => (x.Contains("SC") || x.Contains("SC_SIMS")))) { AscId = Convert.ToInt32(ddlSerContractor.SelectedValue); RegionId = Convert.ToInt32(ddlRegion.SelectedValue); BranchId = Convert.ToInt32(ddlBranch.SelectedValue); hdnRawUrl.Value = hdnRawUrl.Value + "&arb=" + ddlSerContractor.SelectedValue + "|" + ddlRegion.SelectedValue + "|" + ddlBranch.SelectedValue; hdnRawUrl.Value = hdnRawUrl.Value + "&rbv=" + ddlRegion.SelectedItem.Text + "|" + ddlBranch.SelectedItem.Text; } else { AscId = 0; RegionId = 0; BranchId = 0; hdnRawUrl.Value = hdnRawUrl.Value + "&arb="; hdnRawUrl.Value = hdnRawUrl.Value + "&rbv="; } DataSet dsInvoice = GetInvoiceDetails(); if (dsInvoice != null) { if (dsInvoice.Tables[1].Rows.Count > 0) { lblCustomerName.Text = "<b>" + dsInvoice.Tables[1].Rows[0]["Sc_Name"].ToString() + "</b>"; lblAscAddress.Text = dsInvoice.Tables[1].Rows[0]["Addres"].ToString(); } if (dsInvoice.Tables[2].Rows.Count > 0) { lblInvoiceNo.Text = dsInvoice.Tables[2].Rows[0]["InvoiceNo"].ToString(); lblInvoiceDate.Text = dsInvoice.Tables[2].Rows[0]["InvoiceDt"].ToString(); } if (dsInvoice.Tables[0].Rows.Count > 0) { taxableAmt = Math.Round(Convert.ToDouble(dsInvoice.Tables[0].Compute("Sum(TaxableAmt)", "")), 2); } // callnew proc SqlParameter[] param = { new SqlParameter("@UserName", UserName), new SqlParameter("@MonthId", ddlMonth.SelectedValue), new SqlParameter("@YearId", Ddlyear.SelectedValue), new SqlParameter("@type", "INS"), new SqlParameter("@ProductDivisionSno", 13), }; DataSet insdataset = objSqlDataAccessLayer.ExecuteDataset(CommandType.StoredProcedure, "GenerateInvoiceInstitutionalFan_Replica", param); if (insdataset.Tables[0].Rows.Count > 0) { int countL = 0; int countO = 0; foreach (DataRow drs in insdataset.Tables[0].Rows) { if (drs["Activity"].ToString().Equals("L")) { countL = countL + 1; } if (drs["Activity"].ToString().Equals("O")) { countO = countO + 1; } } lblRepLoQ.Text = countL.ToString(); lblRepLoA.Text = Convert.ToString(Convert.ToDouble(countL) * Convert.ToDouble(lblRepLoU.Text)); lblRepOoQ.Text = countO.ToString(); lblRepOoA.Text = Convert.ToString(Convert.ToDouble(countO) * Convert.ToDouble(lblRepOoU.Text)); } foreach (DataRow dr in dsInvoice.Tables[0].Rows) { if (dr["ActivityParameter_SNo"].ToString().Equals("0")) { lblQuanityfd.Text = dr["Quantity"].ToString(); lblfdUnitPrice.Text = dr["UnitPrice"].ToString(); lblfdamount.Text = dr["Amount"].ToString(); } } calculate(); } } catch (Exception ex) { SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString()); } }