Example #1
0
 public virtual CloudAccountDA.TaxMasterDataTable GetData()
 {
     this.Adapter.SelectCommand = this.CommandCollection[0];
     CloudAccountDA.TaxMasterDataTable dataTable = new CloudAccountDA.TaxMasterDataTable();
     this.Adapter.Fill(dataTable);
     return(dataTable);
 }
        private void ViewRecord(string iD)
        {
            this.objItemMasterDT = this.objItemMasterBll.GetDataByItemID(int.Parse(iD));
            if (this.objItemMasterDT.Rows.Count <= 0)
            {
                return;
            }
            this.hfItemID.Value       = this.objItemMasterDT.Rows[0]["ItemID"].ToString();
            this.hfCompanyID.Value    = this.objItemMasterDT.Rows[0]["CompanyID"].ToString();
            this.lblItemName.Text     = this.objItemMasterDT.Rows[0]["ItemName"].ToString();
            this.lblItemDesc.Text     = this.objItemMasterDT.Rows[0]["Description"].ToString();
            this.lblUnitCost.Text     = this.objItemMasterDT.Rows[0]["UnitCost"].ToString();
            this.lblCurrentStock.Text = this.objItemMasterDT.Rows[0]["CurrentStock"].ToString();
            this.lblQuantity.Text     = this.objItemMasterDT.Rows[0]["Quantity"].ToString();
            this.lblInventory.Text    = this.objItemMasterDT.Rows[0]["TrackInventory"].ToString();
            string s1 = this.objItemMasterDT.Rows[0]["TaxID1"].ToString();
            string s2 = this.objItemMasterDT.Rows[0]["TaxID2"].ToString();

            if (!string.IsNullOrEmpty(s1))
            {
                this.objTaxMasterDT = this.objTaxMasterBll.GetDataByTaxID(int.Parse(s1));
                this.lblTax.Text    = this.objTaxMasterDT.Rows[0]["TaxName"].ToString();
            }
            if (string.IsNullOrEmpty(s2))
            {
                return;
            }
            this.objTaxMasterDT = this.objTaxMasterBll.GetDataByTaxID(int.Parse(s2));
            this.lblTax2.Text   = this.objTaxMasterDT.Rows[0]["TaxName"].ToString();
        }
Example #3
0
 public virtual int Fill(CloudAccountDA.TaxMasterDataTable dataTable)
 {
     this.Adapter.SelectCommand = this.CommandCollection[0];
     if (this.ClearBeforeFill)
     {
         dataTable.Clear();
     }
     return(this.Adapter.Fill(dataTable));
 }
 private void SetRecord(string iD)
 {
     this.objTaxMasterDT = this.objTaxMasterBll.GetDataByTaxID(int.Parse(iD));
     if (this.objTaxMasterDT.Rows.Count <= 0)
     {
         return;
     }
     this.hfTaxID.Value     = this.objTaxMasterDT.Rows[0]["TaxID"].ToString();
     this.hfCompanyID.Value = this.objTaxMasterDT.Rows[0]["CompanyID"].ToString();
     this.txtTaxName.Text   = this.objTaxMasterDT.Rows[0]["TaxName"].ToString();
     this.txtTaxNumber.Text = this.objTaxMasterDT.Rows[0]["TaxNumber"].ToString();
     this.txtTaxRate.Text   = this.objTaxMasterDT.Rows[0]["TaxRate"].ToString();
 }
Example #5
0
 public virtual CloudAccountDA.TaxMasterDataTable DeleteByCompanyID(int?CompanyID)
 {
     this.Adapter.SelectCommand = this.CommandCollection[1];
     if (CompanyID.HasValue)
     {
         this.Adapter.SelectCommand.Parameters[1].Value = CompanyID.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[1].Value = DBNull.Value;
     }
     CloudAccountDA.TaxMasterDataTable dataTable = new CloudAccountDA.TaxMasterDataTable();
     this.Adapter.Fill(dataTable);
     return(dataTable);
 }
        protected void gvTaskView_OnRowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType != DataControlRowType.DataRow)
            {
                return;
            }
            string text1 = e.Row.Cells[0].Text;
            string text2 = e.Row.Cells[4].Text;
            string text3 = e.Row.Cells[5].Text;

            this.objTaskMasterDT = this.objTaskMasterBll.GetDataByTaskID(int.Parse(text1));
            if (this.objTaskMasterDT.Rows.Count > 0)
            {
                e.Row.Cells[0].Text = this.objTaskMasterDT.Rows[0]["TaskName"].ToString();
            }
            try
            {
                if (!string.IsNullOrEmpty(text2) && !text2.Contains("&"))
                {
                    this.objTaxMasterDT = this.objTaxMasterBll.GetDataByTaxID(int.Parse(text2));
                    if (this.objTaxMasterDT.Rows.Count > 0)
                    {
                        e.Row.Cells[4].Text = this.objTaxMasterDT.Rows[0]["TaxName"].ToString();
                    }
                }
                if (string.IsNullOrEmpty(text3) || text3.Contains("&"))
                {
                    return;
                }
                this.objTaxMasterDT = this.objTaxMasterBll.GetDataByTaxID(int.Parse(text3));
                if (this.objTaxMasterDT.Rows.Count <= 0)
                {
                    return;
                }
                e.Row.Cells[5].Text = this.objTaxMasterDT.Rows[0]["TaxName"].ToString();
            }
            catch (Exception ex)
            {
                e.Row.Cells[4].Text = "";
                e.Row.Cells[5].Text = "";
            }
        }
 protected void btnSubmit_Click(object sender, EventArgs e)
 {
     if (!this.Page.IsValid)
     {
         return;
     }
     if (this.txtTaxName.Text.Trim().Length > 0)
     {
         this.objTaxMasterDT = this.objTaxMasterBll.GetDataByTaxName(int.Parse(this.hfCompanyID.Value), this.txtTaxName.Text.Trim());
         if (this.objTaxMasterDT.Rows.Count > 0)
         {
             this.checkInDB = true;
             this.DisplayAlert("Tax Already Exists..!");
         }
         if (this.checkInDB)
         {
             return;
         }
         Decimal?dTaxRate = new Decimal?();
         if (this.txtTaxRate.Text.Trim().Length > 0)
         {
             dTaxRate = new Decimal?(Decimal.Parse(this.txtTaxRate.Text.Trim()));
         }
         int num = this.objTaxMasterBll.AddTax(int.Parse(this.hfCompanyID.Value), this.txtTaxName.Text.Trim(), dTaxRate, this.txtTaxNumber.Text.Trim());
         if (num != 0)
         {
             this.Session["saveTax"] = (object)1;
             this.DisplayAlert("Details Added Successfully.");
             this.Response.Redirect("~/BillTransact/TaxMaster.aspx?cmd=add&ID=" + (object)num);
         }
         else
         {
             this.DisplayAlert("Fail to Add New Details.");
             this.Clear();
         }
     }
     else
     {
         this.DisplayAlert("Please Fill All Details...!");
     }
 }
Example #8
0
 public virtual CloudAccountDA.TaxMasterDataTable GetDataByTaxName(int?CompanyID, string TaxName)
 {
     this.Adapter.SelectCommand = this.CommandCollection[4];
     if (CompanyID.HasValue)
     {
         this.Adapter.SelectCommand.Parameters[1].Value = CompanyID.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[1].Value = DBNull.Value;
     }
     if (TaxName == null)
     {
         this.Adapter.SelectCommand.Parameters[2].Value = DBNull.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[2].Value = TaxName;
     }
     CloudAccountDA.TaxMasterDataTable dataTable = new CloudAccountDA.TaxMasterDataTable();
     this.Adapter.Fill(dataTable);
     return(dataTable);
 }
        private void ViewRecord(string id)
        {
            this.objEstimateMasterDT = this.objEstimateMasterBll.GetDataByEstimateID(int.Parse(id));
            if (this.objEstimateMasterDT.Rows.Count <= 0)
            {
                return;
            }
            this.hfCompanyID.Value       = this.objEstimateMasterDT.Rows[0]["CompanyID"].ToString();
            this.hfEstimateID.Value      = this.objEstimateMasterDT.Rows[0]["EstimateID"].ToString();
            this.lblEstimateNum.Text     = this.objEstimateMasterDT.Rows[0]["EstimateNumber"].ToString();
            this.lblEstimateNumHead.Text = "Estimate: " + this.objEstimateMasterDT.Rows[0]["EstimateNumber"];
            this.lblEstimateDate.Text    = DateTime.Parse(this.objEstimateMasterDT.Rows[0]["EstimateDate"].ToString()).ToString("MMMM dd, yyyy");
            this.lblPONumber.Text        = this.objEstimateMasterDT.Rows[0]["PONumber"].ToString();
            this.lblTerms.Text           = this.objEstimateMasterDT.Rows[0]["Terms"].ToString();
            this.lblNotes.Text           = this.objEstimateMasterDT.Rows[0]["Notes"].ToString();
            string s1 = this.objEstimateMasterDT.Rows[0]["Discount"].ToString();

            this.lblDiscout.Text           = s1.Length > 0 ? s1 : "0.00";
            this.lblEstimateTotalView.Text = Decimal.Round(Decimal.Parse(this.objEstimateMasterDT.Rows[0]["EstimateTotal"].ToString()), 2).ToString();
            this.lblPaidToDateView.Text    = Decimal.Round(Decimal.Parse(this.objEstimateMasterDT.Rows[0]["PaidToDate"].ToString()), 2).ToString();
            Label   label1 = this.lblEstimateAmount;
            Label   label2 = this.lblAmountDue;
            Decimal num1   = Decimal.Parse(this.lblEstimateTotalView.Text) - Decimal.Parse(this.lblPaidToDateView.Text);
            string  str1;
            string  str2 = str1 = num1.ToString();

            label2.Text = str1;
            string str3 = str2;

            label1.Text = str3;
            Label   label3 = this.lblEstimateAmount;
            Label   label4 = this.lblAmountDue;
            Decimal num2   = Decimal.Round(Decimal.Parse(this.lblAmountDue.Text), 2);
            string  str4;
            string  str5 = str4 = num2.ToString();

            label4.Text = str4;
            string str6 = str5;

            label3.Text = str6;
            this.divTaxValueView.Controls.Clear();
            this.divTaxView.Controls.Clear();
            Hashtable hashtable = new Hashtable();

            if (this.gvTaskView.Rows.Count > 0)
            {
                for (int index = 0; index < this.gvTaskView.Rows.Count; ++index)
                {
                    string text1 = this.gvTaskView.Rows[index].Cells[2].Text;
                    string text2 = this.gvTaskView.Rows[index].Cells[3].Text;
                    string text3 = this.gvTaskView.Rows[index].Cells[4].Text;
                    string text4 = this.gvTaskView.Rows[index].Cells[5].Text;
                    try
                    {
                        if (!string.IsNullOrEmpty(text3) && !text3.Contains("&"))
                        {
                            this.objTaxMasterDT = this.objTaxMasterBll.GetDataByTaxName(int.Parse(this.hfCompanyID.Value), text3);
                            if (this.objTaxMasterDT.Rows.Count > 0)
                            {
                                string  s2     = this.objTaxMasterDT.Rows[0]["TaxRate"].ToString();
                                Decimal d      = Decimal.Parse(text1) * Decimal.Parse(text2) * Decimal.Parse(s2) / new Decimal(100);
                                Label   label5 = new Label()
                                {
                                    Text = this.gvTaskView.Rows[index].Cells[4].Text + "(" + s2 + ")"
                                };
                                Label label6 = new Label()
                                {
                                    Text = string.Concat((object)Decimal.Round(d, 2))
                                };
                                if (hashtable.ContainsKey((object)label5.Text))
                                {
                                    object  obj  = hashtable[(object)label5.Text];
                                    Decimal num3 = d + Decimal.Parse(obj.ToString());
                                    hashtable.Remove((object)label5.Text);
                                    hashtable.Add((object)label5.Text, (object)num3.ToString());
                                }
                                else
                                {
                                    hashtable.Add((object)label5.Text, (object)label6.Text);
                                }
                            }
                        }
                        if (!string.IsNullOrEmpty(text4))
                        {
                            if (!text4.Contains("&"))
                            {
                                this.objTaxMasterDT = this.objTaxMasterBll.GetDataByTaxName(int.Parse(this.hfCompanyID.Value), text4);
                                if (this.objTaxMasterDT.Rows.Count > 0)
                                {
                                    string  s2     = this.objTaxMasterDT.Rows[0]["TaxRate"].ToString();
                                    Decimal d      = Decimal.Parse(text1) * Decimal.Parse(text2) * Decimal.Parse(s2) / new Decimal(100);
                                    Label   label5 = new Label()
                                    {
                                        Text = this.gvTaskView.Rows[index].Cells[5].Text + "(" + s2 + ")"
                                    };
                                    Label label6 = new Label()
                                    {
                                        Text = string.Concat((object)Decimal.Round(d, 2))
                                    };
                                    if (hashtable.ContainsKey((object)label5.Text))
                                    {
                                        object  obj  = hashtable[(object)label5.Text];
                                        Decimal num3 = d + Decimal.Parse(obj.ToString());
                                        hashtable.Remove((object)label5.Text);
                                        hashtable.Add((object)label5.Text, (object)num3.ToString());
                                    }
                                    else
                                    {
                                        hashtable.Add((object)label5.Text, (object)label6.Text);
                                    }
                                }
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        this.gvTaskView.Rows[index].Cells[4].Text = "";
                        this.gvTaskView.Rows[index].Cells[5].Text = "";
                    }
                }
            }
            if (this.gvItemView.Rows.Count > 0)
            {
                for (int index = 0; index < this.gvItemView.Rows.Count; ++index)
                {
                    string text1 = this.gvItemView.Rows[index].Cells[2].Text;
                    string text2 = this.gvItemView.Rows[index].Cells[3].Text;
                    string text3 = this.gvItemView.Rows[index].Cells[4].Text;
                    string text4 = this.gvItemView.Rows[index].Cells[5].Text;
                    try
                    {
                        if (!string.IsNullOrEmpty(text3) && !text3.Contains("&"))
                        {
                            this.objTaxMasterDT = this.objTaxMasterBll.GetDataByTaxName(int.Parse(this.hfCompanyID.Value), text3);
                            if (this.objTaxMasterDT.Rows.Count > 0)
                            {
                                string  s2     = this.objTaxMasterDT.Rows[0]["TaxRate"].ToString();
                                Decimal d      = Decimal.Parse(text1) * Decimal.Parse(text2) * Decimal.Parse(s2) / new Decimal(100);
                                Label   label5 = new Label()
                                {
                                    Text = this.gvItemView.Rows[index].Cells[4].Text + "(" + s2 + ")"
                                };
                                Label label6 = new Label()
                                {
                                    Text = string.Concat((object)Decimal.Round(d, 2))
                                };
                                if (hashtable.ContainsKey((object)label5.Text))
                                {
                                    object  obj  = hashtable[(object)label5.Text];
                                    Decimal num3 = d + Decimal.Parse(obj.ToString());
                                    hashtable.Remove((object)label5.Text);
                                    hashtable.Add((object)label5.Text, (object)num3.ToString());
                                }
                                else
                                {
                                    hashtable.Add((object)label5.Text, (object)label6.Text);
                                }
                            }
                        }
                        if (!string.IsNullOrEmpty(text4))
                        {
                            if (!text4.Contains("&"))
                            {
                                this.objTaxMasterDT = this.objTaxMasterBll.GetDataByTaxName(int.Parse(this.hfCompanyID.Value), text4);
                                if (this.objTaxMasterDT.Rows.Count > 0)
                                {
                                    string  s2     = this.objTaxMasterDT.Rows[0]["TaxRate"].ToString();
                                    Decimal d      = Decimal.Parse(text1) * Decimal.Parse(text2) * Decimal.Parse(s2) / new Decimal(100);
                                    Label   label5 = new Label()
                                    {
                                        Text = this.gvItemView.Rows[index].Cells[5].Text + "(" + s2 + ")"
                                    };
                                    Label label6 = new Label()
                                    {
                                        Text = string.Concat((object)Decimal.Round(d, 2))
                                    };
                                    if (hashtable.ContainsKey((object)label5.Text))
                                    {
                                        object  obj  = hashtable[(object)label5.Text];
                                        Decimal num3 = d + Decimal.Parse(obj.ToString());
                                        hashtable.Remove((object)label5.Text);
                                        hashtable.Add((object)label5.Text, (object)num3.ToString());
                                    }
                                    else
                                    {
                                        hashtable.Add((object)label5.Text, (object)label6.Text);
                                    }
                                }
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        this.gvItemView.Rows[index].Cells[4].Text = "";
                        this.gvItemView.Rows[index].Cells[5].Text = "";
                    }
                }
            }
            if (hashtable.Count > 0)
            {
                foreach (string str7 in (IEnumerable)hashtable.Keys)
                {
                    this.divTaxView.Controls.Add((Control) new Label()
                    {
                        Text = str7
                    });
                    this.divTaxView.Controls.Add((Control) new LiteralControl("<br />"));
                }
                foreach (object obj in (IEnumerable)hashtable.Values)
                {
                    this.divTaxValueView.Controls.Add((Control) new Label()
                    {
                        Text = ("+" + (object)Decimal.Round(Decimal.Parse(obj.ToString()), 2))
                    });
                    this.divTaxValueView.Controls.Add((Control) new LiteralControl("<br />"));
                }
            }
            Decimal d1 = new Decimal(0);

            if (this.gvItemView.Rows.Count > 0)
            {
                for (int index = 0; index < this.gvItemView.Rows.Count; ++index)
                {
                    string text = this.gvItemView.Rows[index].Cells[6].Text;
                    d1 += Decimal.Parse(text);
                }
            }
            if (this.gvTaskView.Rows.Count > 0)
            {
                for (int index = 0; index < this.gvTaskView.Rows.Count; ++index)
                {
                    string text = this.gvTaskView.Rows[index].Cells[6].Text;
                    d1 += Decimal.Parse(text);
                }
            }
            Label   label7 = this.lblSubTotalView;
            Decimal num4   = Decimal.Round(d1, 2);
            string  str8   = num4.ToString();

            label7.Text = str8;
            Label label8 = this.lblDiscountAmt;

            num4 = Decimal.Parse(this.lblSubTotalView.Text) * Decimal.Parse(s1) / new Decimal(100);
            string str9 = num4.ToString();

            label8.Text = str9;
            Label label9 = this.lblDiscountAmt;

            num4 = Decimal.Round(Decimal.Parse(this.lblDiscountAmt.Text), 2);
            string str10 = num4.ToString();

            label9.Text = str10;
            this.lblAddedTaxesView.Text = Decimal.Round(Decimal.Parse(this.lblEstimateAmount.Text) - Decimal.Parse(this.lblSubTotalView.Text) + Decimal.Parse(this.lblDiscountAmt.Text), 2).ToString();
            this.objCompanyMasterDT     = this.objCompanyMasterBll.GetDataByCompanyID(int.Parse(this.hfCompanyID.Value));
            this.imgLogo.ImageUrl       = "../Handler/CompanyLogoFile.ashx?id=" + this.objCompanyMasterDT.Rows[0]["CompanyID"];
            this.lblCompanyName.Text    = this.objCompanyMasterDT.Rows[0]["CompanyName"].ToString();
            string str11 = string.Empty;

            if (!string.IsNullOrEmpty(this.objCompanyMasterDT.Rows[0]["CompanyAddressStreet1"].ToString()))
            {
                str11 = str11 + this.objCompanyMasterDT.Rows[0]["CompanyAddressStreet1"] + ",<br />";
            }
            if (!string.IsNullOrEmpty(this.objCompanyMasterDT.Rows[0]["CompanyAddressStreet2"].ToString()))
            {
                str11 = str11 + this.objCompanyMasterDT.Rows[0]["CompanyAddressStreet2"] + ",<br />";
            }
            if (!string.IsNullOrEmpty(this.objCompanyMasterDT.Rows[0]["CompanyCityID"].ToString()))
            {
                this.objCityMasterDT = this.objCityMasterBll.GetDataByCityID(int.Parse(this.objCompanyMasterDT.Rows[0]["CompanyCityID"].ToString()));
                if (this.objCityMasterDT.Rows.Count > 0)
                {
                    str11 = str11 + this.objCityMasterDT.Rows[0]["CityName"] + " - ";
                }
            }
            if (!string.IsNullOrEmpty(this.objCompanyMasterDT.Rows[0]["CompanyZipCode"].ToString()))
            {
                str11 = str11 + this.objCompanyMasterDT.Rows[0]["CompanyZipCode"] + ",<br />";
            }
            if (!string.IsNullOrEmpty(this.objCompanyMasterDT.Rows[0]["CompanyStateID"].ToString()))
            {
                this.objStateMasterDT = this.objStateMasterBll.GetDataByStateID(int.Parse(this.objCompanyMasterDT.Rows[0]["CompanyStateID"].ToString()));
                if (this.objStateMasterDT.Rows.Count > 0)
                {
                    str11 = str11 + this.objStateMasterDT.Rows[0]["StateName"] + ",<br />";
                }
            }
            if (!string.IsNullOrEmpty(this.objCompanyMasterDT.Rows[0]["CompanyCountryID"].ToString()))
            {
                this.objCountryMasterDT = this.objCountryMasterBll.GetDataByCountryID(int.Parse(this.objCompanyMasterDT.Rows[0]["CompanyCountryID"].ToString()));
                if (this.objCountryMasterDT.Rows.Count > 0)
                {
                    str11 = str11 + this.objCountryMasterDT.Rows[0]["CountryName"] + ".<br />";
                }
            }
            this.lblCompanyAddress.Text = str11;
            Label  label10 = this.lblCompanyAddress;
            string str12   = label10.Text + (object)"Email: <a href=\"mailto:" + (string)this.objCompanyMasterDT.Rows[0]["CompanyEmail"] + "\">" + (string)this.objCompanyMasterDT.Rows[0]["CompanyEmail"] + "</a><br />";

            label10.Text = str12;
            Label  label11 = this.lblCompanyAddress;
            string str13   = label11.Text + (object)"Phone: " + (string)this.objCompanyMasterDT.Rows[0]["CompanyPhone"];

            label11.Text = str13;
            this.objCompanyClientMasterDT       = this.objCompanyClientMasterBll.GetDataByCompanyClientID(int.Parse(this.objEstimateMasterDT.Rows[0]["ClientId"].ToString()));
            this.lblClientOrganizationName.Text = this.objCompanyClientMasterDT.Rows[0]["OrganizationName"].ToString();
            this.lblClientFullName.Text         = (string)this.objCompanyClientMasterDT.Rows[0]["FirstName"] + (object)" " + (string)this.objCompanyClientMasterDT.Rows[0]["LastName"];
            string str14 = string.Empty + this.objCompanyClientMasterDT.Rows[0]["Address1"] + ",<br />" + this.objCompanyClientMasterDT.Rows[0]["Address2"] + ",<br />";

            if (!string.IsNullOrEmpty(this.objCompanyClientMasterDT.Rows[0]["CityID"].ToString()))
            {
                this.objCityMasterDT = this.objCityMasterBll.GetDataByCityID(int.Parse(this.objCompanyClientMasterDT.Rows[0]["CityID"].ToString()));
                if (this.objCityMasterDT.Rows.Count > 0)
                {
                    str14 = str14 + this.objCityMasterDT.Rows[0]["CityName"] + " ";
                }
            }
            if (!string.IsNullOrEmpty(this.objCompanyClientMasterDT.Rows[0]["StateID"].ToString()))
            {
                this.objStateMasterDT = this.objStateMasterBll.GetDataByStateID(int.Parse(this.objCompanyClientMasterDT.Rows[0]["StateID"].ToString()));
                if (this.objStateMasterDT.Rows.Count > 0)
                {
                    str14 = str14 + this.objStateMasterDT.Rows[0]["StateName"] + " ";
                }
            }
            string str15 = string.Concat(new object[4]
            {
                (object)str14,
                (object)" - ",
                this.objCompanyClientMasterDT.Rows[0]["ZipCode"],
                (object)",<br />"
            });

            if (!string.IsNullOrEmpty(this.objCompanyClientMasterDT.Rows[0]["CountryID"].ToString()))
            {
                this.objCountryMasterDT = this.objCountryMasterBll.GetDataByCountryID(int.Parse(this.objCompanyClientMasterDT.Rows[0]["CountryID"].ToString()));
                str15 += this.objCountryMasterDT.Rows[0]["CountryName"].ToString();
            }
            this.lblClientAddress.Text = str15;
            switch (this.objEstimateMasterDT.Rows[0]["EstimateStatus"].ToString())
            {
            case "draft":
                this.divStatus.Attributes.Add("class", "status-draft");
                break;

            case "draft-partial":
                this.divStatus.Attributes.Add("class", "status-draft-partial");
                break;

            case "created":
                this.divStatus.Attributes.Add("class", "status-created");
                break;

            case "sent":
                this.divStatus.Attributes.Add("class", "status-received");
                break;

            case "viewed":
                this.divStatus.Attributes.Add("class", "status-received");
                break;

            case "disputed":
                this.divStatus.Attributes.Add("class", "status-disputed");
                break;

            case "paid":
                this.divStatus.Attributes.Add("class", "status-paid");
                break;

            case "partial":
                this.divStatus.Attributes.Add("class", "status-partial");
                break;

            case "pending":
                this.divStatus.Attributes.Add("class", "status-pending");
                break;

            case "declined":
                this.divStatus.Attributes.Add("class", "status-declined");
                break;

            case "auto-paid":
                this.divStatus.Attributes.Add("class", "status-auto-paid");
                break;

            case "retry":
                this.divStatus.Attributes.Add("class", "status-retry");
                break;

            case "failed":
                this.divStatus.Attributes.Add("class", "status-failed");
                break;

            case "replied":
                this.divStatus.Attributes.Add("class", "status-replied");
                break;

            case "commented":
                this.divStatus.Attributes.Add("class", "status-commented");
                break;

            case "resolved":
                this.divStatus.Attributes.Add("class", "status-resolved");
                break;

            case "invoiced":
                this.divStatus.Attributes.Add("class", "status-invoiced");
                break;

            case "accepted":
                this.divStatus.Attributes.Add("class", "status-accepted");
                break;

            case "Estimated":
                this.divStatus.Attributes.Add("class", "status-Estimated");
                break;

            case "outstanding":
                this.divStatus.Attributes.Add("class", "status-outstanding");
                break;

            case "open":
                this.divStatus.Attributes.Add("class", "status-open");
                break;

            default:
                this.divStatus.Attributes.Add("class", "status-created");
                break;
            }
            string s3 = this.objEstimateMasterDT.Rows[0]["CurrencyID"].ToString();

            if (string.IsNullOrEmpty(s3))
            {
                return;
            }
            this.objCurrencyMasterDT = this.objCurrencyMasterBll.GetDataByCurrencyID(int.Parse(s3));
            if (this.objCurrencyMasterDT.Rows.Count <= 0)
            {
                return;
            }
            this.lblCurCodeView1.Text   = this.lblCurCodeView2.Text = this.objCurrencyMasterDT.Rows[0]["CurrencyCode"].ToString();
            this.lblCurSymbolView1.Text = this.lblCurSymbolView2.Text = this.objCurrencyMasterDT.Rows[0]["CurrencySymbol"].ToString();
        }
Example #10
0
 public virtual int Update(CloudAccountDA.TaxMasterDataTable dataTable)
 {
     return(this.Adapter.Update(dataTable));
 }
Example #11
0
        private void ViewRecord(string id)
        {
            bool flag = false;

            this.objCreditMasterDT = this.objCreditMasterBll.GetDataByCreditID(int.Parse(id));
            if (this.objCreditMasterDT.Rows.Count > 0)
            {
                flag = this.objCreditMasterDT.Rows[0]["ClientID"].ToString() == this.hfClientID.Value;
            }
            if (this.objCreditMasterDT.Rows.Count > 0 && flag)
            {
                this.hfCompanyID.Value     = this.objCreditMasterDT.Rows[0]["CompanyID"].ToString();
                this.objTemplateSettingsDT = this.objTemplateSettingsBll.GetDataByCompanyID(int.Parse(this.hfCompanyID.Value));
                if (this.objTemplateSettingsDT.Rows.Count > 0)
                {
                    this.lblCreditTitle.Text     = (string)this.objTemplateSettingsDT.Rows[0]["CreditTitle"] + (object)" #";
                    this.lblCreditTitleDate.Text = (string)this.objTemplateSettingsDT.Rows[0]["CreditTitle"] + (object)" Date";
                }
                this.hfCreditID.Value        = this.objCreditMasterDT.Rows[0]["CreditID"].ToString();
                this.lblCreditNum.Text       = this.objCreditMasterDT.Rows[0]["CreditNumber"].ToString();
                this.lblTerms.Text           = this.objCreditMasterDT.Rows[0]["Terms"].ToString();
                this.lblNotes.Text           = this.objCreditMasterDT.Rows[0]["Notes"].ToString();
                this.lblCreditNumHead.Text   = "Credit: " + this.objCreditMasterDT.Rows[0]["CreditNumber"];
                this.lblCreditDate.Text      = DateTime.Parse(this.objCreditMasterDT.Rows[0]["CreditDate"].ToString()).ToString("MMMM dd, yyyy");
                this.lblCreditTotalView.Text = Decimal.Round(Decimal.Parse(this.objCreditMasterDT.Rows[0]["CreditTotal"].ToString()), 2).ToString();
                if (this.objCreditMasterDT.Rows[0]["CreditStatus"].ToString().ToLower() == "sent")
                {
                    this.objCreditMasterBll.UpdateCreditStatus(int.Parse(this.hfCreditID.Value), "viewed");
                }
                this.lblCreditAmount.Text = Decimal.Parse(this.lblCreditTotalView.Text).ToString();
                this.lblCreditAmount.Text = Decimal.Round(Decimal.Parse(this.lblCreditAmount.Text), 2).ToString();
                this.divTaxValueView.Controls.Clear();
                this.divTaxView.Controls.Clear();
                Hashtable hashtable = new Hashtable();
                if (this.gvTaskView.Rows.Count > 0)
                {
                    for (int index = 0; index < this.gvTaskView.Rows.Count; ++index)
                    {
                        string text1 = this.gvTaskView.Rows[index].Cells[2].Text;
                        string text2 = this.gvTaskView.Rows[index].Cells[3].Text;
                        string text3 = this.gvTaskView.Rows[index].Cells[4].Text;
                        string text4 = this.gvTaskView.Rows[index].Cells[5].Text;
                        try
                        {
                            if (!string.IsNullOrEmpty(text3) && !text3.Contains("&"))
                            {
                                this.objTaxMasterDT = this.objTaxMasterBll.GetDataByTaxName(int.Parse(this.hfCompanyID.Value), text3);
                                if (this.objTaxMasterDT.Rows.Count > 0)
                                {
                                    string  s      = this.objTaxMasterDT.Rows[0]["TaxRate"].ToString();
                                    Decimal d      = Decimal.Parse(text1) * Decimal.Parse(text2) * Decimal.Parse(s) / new Decimal(100);
                                    Label   label1 = new Label()
                                    {
                                        Text = this.gvTaskView.Rows[index].Cells[4].Text + "(" + s + ")"
                                    };
                                    Label label2 = new Label()
                                    {
                                        Text = string.Concat((object)Decimal.Round(d, 2))
                                    };
                                    if (hashtable.ContainsKey((object)label1.Text))
                                    {
                                        object  obj = hashtable[(object)label1.Text];
                                        Decimal num = d + Decimal.Parse(obj.ToString());
                                        hashtable.Remove((object)label1.Text);
                                        hashtable.Add((object)label1.Text, (object)num.ToString());
                                    }
                                    else
                                    {
                                        hashtable.Add((object)label1.Text, (object)label2.Text);
                                    }
                                }
                            }
                            if (!string.IsNullOrEmpty(text4))
                            {
                                if (!text4.Contains("&"))
                                {
                                    this.objTaxMasterDT = this.objTaxMasterBll.GetDataByTaxName(int.Parse(this.hfCompanyID.Value), text4);
                                    if (this.objTaxMasterDT.Rows.Count > 0)
                                    {
                                        string  s      = this.objTaxMasterDT.Rows[0]["TaxRate"].ToString();
                                        Decimal d      = Decimal.Parse(text1) * Decimal.Parse(text2) * Decimal.Parse(s) / new Decimal(100);
                                        Label   label1 = new Label()
                                        {
                                            Text = this.gvTaskView.Rows[index].Cells[5].Text + "(" + s + ")"
                                        };
                                        Label label2 = new Label()
                                        {
                                            Text = string.Concat((object)Decimal.Round(d, 2))
                                        };
                                        if (hashtable.ContainsKey((object)label1.Text))
                                        {
                                            object  obj = hashtable[(object)label1.Text];
                                            Decimal num = d + Decimal.Parse(obj.ToString());
                                            hashtable.Remove((object)label1.Text);
                                            hashtable.Add((object)label1.Text, (object)num.ToString());
                                        }
                                        else
                                        {
                                            hashtable.Add((object)label1.Text, (object)label2.Text);
                                        }
                                    }
                                }
                            }
                        }
                        catch (Exception ex)
                        {
                            this.gvTaskView.Rows[index].Cells[4].Text = "";
                            this.gvTaskView.Rows[index].Cells[5].Text = "";
                        }
                    }
                }
                if (this.gvItemView.Rows.Count > 0)
                {
                    for (int index = 0; index < this.gvItemView.Rows.Count; ++index)
                    {
                        string text1 = this.gvItemView.Rows[index].Cells[2].Text;
                        string text2 = this.gvItemView.Rows[index].Cells[3].Text;
                        string text3 = this.gvItemView.Rows[index].Cells[4].Text;
                        string text4 = this.gvItemView.Rows[index].Cells[5].Text;
                        try
                        {
                            if (!string.IsNullOrEmpty(text3) && !text3.Contains("&"))
                            {
                                this.objTaxMasterDT = this.objTaxMasterBll.GetDataByTaxName(int.Parse(this.hfCompanyID.Value), text3);
                                if (this.objTaxMasterDT.Rows.Count > 0)
                                {
                                    string  s      = this.objTaxMasterDT.Rows[0]["TaxRate"].ToString();
                                    Decimal d      = Decimal.Parse(text1) * Decimal.Parse(text2) * Decimal.Parse(s) / new Decimal(100);
                                    Label   label1 = new Label()
                                    {
                                        Text = this.gvItemView.Rows[index].Cells[4].Text + "(" + s + ")"
                                    };
                                    Label label2 = new Label()
                                    {
                                        Text = string.Concat((object)Decimal.Round(d, 2))
                                    };
                                    if (hashtable.ContainsKey((object)label1.Text))
                                    {
                                        object  obj = hashtable[(object)label1.Text];
                                        Decimal num = d + Decimal.Parse(obj.ToString());
                                        hashtable.Remove((object)label1.Text);
                                        hashtable.Add((object)label1.Text, (object)num.ToString());
                                    }
                                    else
                                    {
                                        hashtable.Add((object)label1.Text, (object)label2.Text);
                                    }
                                }
                            }
                            if (!string.IsNullOrEmpty(text4))
                            {
                                if (!text4.Contains("&"))
                                {
                                    this.objTaxMasterDT = this.objTaxMasterBll.GetDataByTaxName(int.Parse(this.hfCompanyID.Value), text4);
                                    if (this.objTaxMasterDT.Rows.Count > 0)
                                    {
                                        string  s      = this.objTaxMasterDT.Rows[0]["TaxRate"].ToString();
                                        Decimal d      = Decimal.Parse(text1) * Decimal.Parse(text2) * Decimal.Parse(s) / new Decimal(100);
                                        Label   label1 = new Label()
                                        {
                                            Text = this.gvItemView.Rows[index].Cells[5].Text + "(" + s + ")"
                                        };
                                        Label label2 = new Label()
                                        {
                                            Text = string.Concat((object)Decimal.Round(d, 2))
                                        };
                                        if (hashtable.ContainsKey((object)label1.Text))
                                        {
                                            object  obj = hashtable[(object)label1.Text];
                                            Decimal num = d + Decimal.Parse(obj.ToString());
                                            hashtable.Remove((object)label1.Text);
                                            hashtable.Add((object)label1.Text, (object)num.ToString());
                                        }
                                        else
                                        {
                                            hashtable.Add((object)label1.Text, (object)label2.Text);
                                        }
                                    }
                                }
                            }
                        }
                        catch (Exception ex)
                        {
                            this.gvItemView.Rows[index].Cells[4].Text = "";
                            this.gvItemView.Rows[index].Cells[5].Text = "";
                        }
                    }
                }
                if (hashtable.Count > 0)
                {
                    foreach (string str in (IEnumerable)hashtable.Keys)
                    {
                        this.divTaxView.Controls.Add((Control) new Label()
                        {
                            Text = str
                        });
                        this.divTaxView.Controls.Add((Control) new LiteralControl("<br />"));
                    }
                    foreach (object obj in (IEnumerable)hashtable.Values)
                    {
                        this.divTaxValueView.Controls.Add((Control) new Label()
                        {
                            Text = ("+" + (object)Decimal.Round(Decimal.Parse(obj.ToString()), 2))
                        });
                        this.divTaxValueView.Controls.Add((Control) new LiteralControl("<br />"));
                    }
                }
                Decimal d1 = new Decimal(0);
                if (this.gvItemView.Rows.Count > 0)
                {
                    for (int index = 0; index < this.gvItemView.Rows.Count; ++index)
                    {
                        string text = this.gvItemView.Rows[index].Cells[6].Text;
                        if (!string.IsNullOrEmpty(text))
                        {
                            d1 += Decimal.Parse(text);
                        }
                    }
                }
                if (this.gvTaskView.Rows.Count > 0)
                {
                    for (int index = 0; index < this.gvTaskView.Rows.Count; ++index)
                    {
                        string text = this.gvTaskView.Rows[index].Cells[6].Text;
                        if (!string.IsNullOrEmpty(text))
                        {
                            d1 += Decimal.Parse(text);
                        }
                    }
                }
                if (this.gvTaskView.Rows.Count <= 0 && this.gvItemView.Rows.Count <= 0)
                {
                    d1 += Decimal.Parse(this.lblCreditAmount.Text);
                }
                this.lblSubTotalView.Text   = Decimal.Round(d1, 2).ToString();
                this.lblAddedTaxesView.Text = Decimal.Round(Decimal.Parse(this.lblCreditAmount.Text) - Decimal.Parse(this.lblSubTotalView.Text), 2).ToString();
                this.objCompanyMasterDT     = this.objCompanyMasterBll.GetDataByCompanyID(int.Parse(this.hfCompanyID.Value));
                this.imgLogo.ImageUrl       = "../Handler/CompanyLogoFile.ashx?id=" + this.objCompanyMasterDT.Rows[0]["CompanyID"];
                this.lblCompanyName.Text    = this.objCompanyMasterDT.Rows[0]["CompanyName"].ToString();
                string str1 = string.Empty;
                if (!string.IsNullOrEmpty(this.objCompanyMasterDT.Rows[0]["CompanyAddressStreet1"].ToString()))
                {
                    str1 = str1 + this.objCompanyMasterDT.Rows[0]["CompanyAddressStreet1"] + ",<br />";
                }
                if (!string.IsNullOrEmpty(this.objCompanyMasterDT.Rows[0]["CompanyAddressStreet2"].ToString()))
                {
                    str1 = str1 + this.objCompanyMasterDT.Rows[0]["CompanyAddressStreet2"] + ",<br />";
                }
                if (!string.IsNullOrEmpty(this.objCompanyMasterDT.Rows[0]["CompanyCityID"].ToString()))
                {
                    this.objCityMasterDT = this.objCityMasterBll.GetDataByCityID(int.Parse(this.objCompanyMasterDT.Rows[0]["CompanyCityID"].ToString()));
                    if (this.objCityMasterDT.Rows.Count > 0)
                    {
                        str1 = str1 + this.objCityMasterDT.Rows[0]["CityName"] + " - ";
                    }
                }
                if (!string.IsNullOrEmpty(this.objCompanyMasterDT.Rows[0]["CompanyZipCode"].ToString()))
                {
                    str1 = str1 + this.objCompanyMasterDT.Rows[0]["CompanyZipCode"] + ",<br />";
                }
                if (!string.IsNullOrEmpty(this.objCompanyMasterDT.Rows[0]["CompanyStateID"].ToString()))
                {
                    this.objStateMasterDT = this.objStateMasterBll.GetDataByStateID(int.Parse(this.objCompanyMasterDT.Rows[0]["CompanyStateID"].ToString()));
                    if (this.objStateMasterDT.Rows.Count > 0)
                    {
                        str1 = str1 + this.objStateMasterDT.Rows[0]["StateName"] + ",<br />";
                    }
                }
                if (!string.IsNullOrEmpty(this.objCompanyMasterDT.Rows[0]["CompanyCountryID"].ToString()))
                {
                    this.objCountryMasterDT = this.objCountryMasterBll.GetDataByCountryID(int.Parse(this.objCompanyMasterDT.Rows[0]["CompanyCountryID"].ToString()));
                    if (this.objCountryMasterDT.Rows.Count > 0)
                    {
                        str1 = str1 + this.objCountryMasterDT.Rows[0]["CountryName"] + ".<br />";
                    }
                }
                this.lblCompanyAddress.Text = str1;
                Label  label3 = this.lblCompanyAddress;
                string str2   = label3.Text + (object)"Email: <a href=\"mailto:" + (string)this.objCompanyMasterDT.Rows[0]["CompanyEmail"] + "\">" + (string)this.objCompanyMasterDT.Rows[0]["CompanyEmail"] + "</a><br />";
                label3.Text = str2;
                Label  label4 = this.lblCompanyAddress;
                string str3   = label4.Text + (object)"Phone: " + (string)this.objCompanyMasterDT.Rows[0]["CompanyPhone"];
                label4.Text = str3;
                this.objCompanyClientMasterDT       = this.objCompanyClientMasterBll.GetDataByCompanyClientID(int.Parse(this.objCreditMasterDT.Rows[0]["ClientId"].ToString()));
                this.lblClientOrganizationName.Text = this.objCompanyClientMasterDT.Rows[0]["OrganizationName"].ToString();
                this.lblClientFullName.Text         = (string)this.objCompanyClientMasterDT.Rows[0]["FirstName"] + (object)" " + (string)this.objCompanyClientMasterDT.Rows[0]["LastName"];
                string str4 = string.Empty + this.objCompanyClientMasterDT.Rows[0]["Address1"] + ",<br />" + this.objCompanyClientMasterDT.Rows[0]["Address2"] + ",<br />";
                if (!string.IsNullOrEmpty(this.objCompanyClientMasterDT.Rows[0]["CityID"].ToString()))
                {
                    this.objCityMasterDT = this.objCityMasterBll.GetDataByCityID(int.Parse(this.objCompanyClientMasterDT.Rows[0]["CityID"].ToString()));
                    if (this.objCityMasterDT.Rows.Count > 0)
                    {
                        str4 = str4 + this.objCityMasterDT.Rows[0]["CityName"] + " ";
                    }
                }
                if (!string.IsNullOrEmpty(this.objCompanyClientMasterDT.Rows[0]["StateID"].ToString()))
                {
                    this.objStateMasterDT = this.objStateMasterBll.GetDataByStateID(int.Parse(this.objCompanyClientMasterDT.Rows[0]["StateID"].ToString()));
                    if (this.objStateMasterDT.Rows.Count > 0)
                    {
                        str4 = str4 + this.objStateMasterDT.Rows[0]["StateName"] + " ";
                    }
                }
                string str5 = string.Concat(new object[4]
                {
                    (object)str4,
                    (object)" - ",
                    this.objCompanyClientMasterDT.Rows[0]["ZipCode"],
                    (object)",<br />"
                });
                if (!string.IsNullOrEmpty(this.objCompanyClientMasterDT.Rows[0]["CountryID"].ToString()))
                {
                    this.objCountryMasterDT = this.objCountryMasterBll.GetDataByCountryID(int.Parse(this.objCompanyClientMasterDT.Rows[0]["CountryID"].ToString()));
                    str5 += this.objCountryMasterDT.Rows[0]["CountryName"].ToString();
                }
                this.lblClientAddress.Text = str5;
                switch (this.objCreditMasterDT.Rows[0]["CreditStatus"].ToString())
                {
                case "draft":
                    this.divStatus.Attributes.Add("class", "status-draft");
                    break;

                case "draft-partial":
                    this.divStatus.Attributes.Add("class", "status-draft-partial");
                    break;

                case "created":
                    this.divStatus.Attributes.Add("class", "status-created");
                    break;

                case "sent":
                case "viewed":
                    this.divStatus.Attributes.Add("class", "status-received");
                    break;

                case "disputed":
                    this.divStatus.Attributes.Add("class", "status-disputed");
                    break;

                case "paid":
                    this.divStatus.Attributes.Add("class", "status-paid");
                    break;

                case "partial":
                    this.divStatus.Attributes.Add("class", "status-partial");
                    break;

                case "pending":
                    this.divStatus.Attributes.Add("class", "status-pending");
                    break;

                case "declined":
                    this.divStatus.Attributes.Add("class", "status-declined");
                    break;

                case "auto-paid":
                    this.divStatus.Attributes.Add("class", "status-auto-paid");
                    break;

                case "retry":
                    this.divStatus.Attributes.Add("class", "status-retry");
                    break;

                case "failed":
                    this.divStatus.Attributes.Add("class", "status-failed");
                    break;

                case "replied":
                    this.divStatus.Attributes.Add("class", "status-replied");
                    break;

                case "commented":
                    this.divStatus.Attributes.Add("class", "status-commented");
                    break;

                case "resolved":
                    this.divStatus.Attributes.Add("class", "status-resolved");
                    break;

                case "accepted":
                    this.divStatus.Attributes.Add("class", "status-accepted");
                    break;

                case "Creditd":
                    this.divStatus.Attributes.Add("class", "status-Creditd");
                    break;

                case "outstanding":
                    this.divStatus.Attributes.Add("class", "status-outstanding");
                    break;

                case "open":
                    this.divStatus.Attributes.Add("class", "status-open");
                    break;

                default:
                    this.divStatus.Attributes.Add("class", "status-created");
                    break;
                }
                string s1 = this.objCreditMasterDT.Rows[0]["CurrencyID"].ToString();
                if (string.IsNullOrEmpty(s1))
                {
                    return;
                }
                this.objCurrencyMasterDT = this.objCurrencyMasterBll.GetDataByCurrencyID(int.Parse(s1));
                if (this.objCurrencyMasterDT.Rows.Count <= 0)
                {
                    return;
                }
                this.lblCurCodeView1.Text   = this.lblCurCodeView2.Text = this.objCurrencyMasterDT.Rows[0]["CurrencyCode"].ToString();
                this.lblCurSymbolView1.Text = this.lblCurSymbolView2.Text = this.objCurrencyMasterDT.Rows[0]["CurrencySymbol"].ToString();
            }
            else
            {
                this.pnlViewAll.Visible = true;
                this.pnlView.Visible    = false;
                this.BindGrid();
            }
        }
Example #12
0
        protected void gv_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType != DataControlRowType.DataRow)
            {
                return;
            }
            string[] strArray = e.Row.Cells[2].Text.Split(' ');
            e.Row.Cells[2].Text = strArray[0];
            string s1 = e.Row.Cells[5].Text.Replace("&nbsp;", "");

            if (!string.IsNullOrEmpty(s1))
            {
                e.Row.Cells[5].Text = Decimal.Round(Decimal.Parse(s1), 2).ToString();
            }
            string s2 = e.Row.Cells[6].Text.Replace("&nbsp;", "");

            if (!string.IsNullOrEmpty(s2))
            {
                e.Row.Cells[6].Text = Decimal.Round(Decimal.Parse(s2), 2).ToString();
            }
            string s3 = e.Row.Cells[9].Text.Replace("&nbsp;", "");

            if (!string.IsNullOrEmpty(s3))
            {
                e.Row.Cells[9].Text = Decimal.Round(Decimal.Parse(s3), 2).ToString();
            }
            if (!string.IsNullOrEmpty(e.Row.Cells[7].Text.Replace("&nbsp;", "")))
            {
                try
                {
                    this.objTaxMasterDT = this.objTaxMasterBll.GetDataByTaxID(int.Parse(e.Row.Cells[7].Text));
                    if (this.objTaxMasterDT.Rows.Count > 0)
                    {
                        string s4   = this.objTaxMasterDT.Rows[0]["TaxRate"].ToString();
                        string text = e.Row.Cells[9].Text;
                        if (string.IsNullOrEmpty(text))
                        {
                            if (string.IsNullOrEmpty(s4))
                            {
                                goto label_15;
                            }
                        }
                        Decimal d = Decimal.Parse(s4) * Decimal.Parse(text) / new Decimal(100);
                        e.Row.Cells[7].Text = Decimal.Round(d, 2).ToString();
                    }
                    else
                    {
                        e.Row.Cells[7].Text = "0.00";
                    }
                }
                catch (Exception ex)
                {
                    e.Row.Cells[7].Text = "0.00";
                }
            }
            else
            {
                e.Row.Cells[7].Text = "0.00";
            }
label_15:
            if (!string.IsNullOrEmpty(e.Row.Cells[8].Text.Replace("&nbsp;", "")))
            {
                try
                {
                    this.objTaxMasterDT = this.objTaxMasterBll.GetDataByTaxID(int.Parse(e.Row.Cells[8].Text));
                    if (this.objTaxMasterDT.Rows.Count > 0)
                    {
                        string s4   = this.objTaxMasterDT.Rows[0]["TaxRate"].ToString();
                        string text = e.Row.Cells[9].Text;
                        if (string.IsNullOrEmpty(text) && string.IsNullOrEmpty(s4))
                        {
                            return;
                        }
                        Decimal d = Decimal.Parse(s4) * Decimal.Parse(text) / new Decimal(100);
                        e.Row.Cells[8].Text = Decimal.Round(d, 2).ToString();
                    }
                    else
                    {
                        e.Row.Cells[8].Text = "0.00";
                    }
                }
                catch (Exception ex)
                {
                    e.Row.Cells[8].Text = "0.00";
                }
            }
            else
            {
                e.Row.Cells[8].Text = "0.00";
            }
        }