Esempio n. 1
0
    protected void Delete_Click(object sender, EventArgs e)
    {
        int     taxFormID = -1;
        ETaxEmp c         = new ETaxEmp();

        c.TaxEmpID = CurID;
        if (db.select(dbConn, c))
        {
            taxFormID = c.TaxFormID;
        }

        WebUtils.StartFunction(Session, FUNCTION_CODE, c.EmpID);
        db.delete(dbConn, c);
        {
            DBFilter taxEmpPaymentFilter = new DBFilter();
            taxEmpPaymentFilter.add(new Match("TaxEmpID", CurID));
            ArrayList taxEmpPaymentList = ETaxEmpPayment.db.select(dbConn, taxEmpPaymentFilter);
            foreach (ETaxEmpPayment taxEmpPayment in taxEmpPaymentList)
            {
                ETaxEmpPayment.db.delete(dbConn, taxEmpPayment);
            }
        }
        {
            DBFilter taxEmpPoRFilter = new DBFilter();
            taxEmpPoRFilter.add(new Match("TaxEmpID", CurID));
            ArrayList taxEmpPoRList = ETaxEmpPlaceOfResidence.db.select(dbConn, taxEmpPoRFilter);
            foreach (ETaxEmpPlaceOfResidence taxEmpPoR in taxEmpPoRList)
            {
                ETaxEmpPlaceOfResidence.db.delete(dbConn, taxEmpPoR);
            }
        }
        WebUtils.EndFunction(dbConn);

        ETaxForm taxForm = new ETaxForm();

        taxForm.TaxFormID = taxFormID;
        if (ETaxForm.db.select(dbConn, taxForm))
        {
            if (taxForm.TaxFormType.Equals("B", StringComparison.CurrentCultureIgnoreCase))
            {
                TaxationGeneration.RearrangeSheetNo(dbConn, taxFormID);
            }
            HROne.Common.WebUtility.RedirectURLwithEncryptedQueryString(Response, Session, "Taxation_Adjustment_List.aspx?TaxCompID=" + taxForm.TaxCompID + "&TaxFormType=" + taxForm.TaxFormType + "&TaxFormID=" + taxForm.TaxFormID);
        }
        HROne.Common.WebUtility.RedirectURLwithEncryptedQueryString(Response, Session, "Taxation_Adjustment_List.aspx");
    }
Esempio n. 2
0
        public override ReportDocument GenerateReport()
        {
            if (TaxFormID > 0)
            {
                if (reportDocument == null)
                {
                    reportDocument = new ReportTemplate.Report_Taxation_ControlList();
                }
                else
                {
                }

                System.Data.DataSet dataSet = TaxationGeneration.GenerateTaxationDataSet(dbConn, TaxFormID, null);

                reportDocument.SetDataSource(dataSet);
                reportDocument.SetParameterValue("NameOfSignature", NameOfSignature);
                return(reportDocument);
            }
            else
            {
                return(null);
            }
        }
    protected void Delete_Click(object sender, EventArgs e)
    {
        ArrayList list = new ArrayList();

        foreach (RepeaterItem item in Repeater.Items)
        {
            CheckBox        c = (CheckBox)item.FindControl("ItemSelect");
            HtmlInputHidden h = (HtmlInputHidden)item.FindControl("TaxEmpID");
            if (c.Checked)
            {
                ETaxEmp obj = new ETaxEmp();
                obj.TaxEmpID = Int32.Parse(h.Value);
                list.Add(obj);
            }
        }

        foreach (ETaxEmp obj in list)
        {
            if (ETaxEmp.db.select(dbConn, obj))
            {
                WebUtils.StartFunction(Session, FUNCTION_CODE, obj.EmpID);
                db.delete(dbConn, obj);
                {
                    DBFilter taxEmpPaymentFilter = new DBFilter();
                    taxEmpPaymentFilter.add(new Match("TaxEmpID", obj.TaxEmpID));
                    ArrayList taxEmpPaymentList = ETaxEmpPayment.db.select(dbConn, taxEmpPaymentFilter);
                    foreach (ETaxEmpPayment taxEmpPayment in taxEmpPaymentList)
                    {
                        ETaxEmpPayment.db.delete(dbConn, taxEmpPayment);
                    }
                }
                {
                    DBFilter taxEmpPoRFilter = new DBFilter();
                    taxEmpPoRFilter.add(new Match("TaxEmpID", obj.TaxEmpID));
                    ArrayList taxEmpPoRList = ETaxEmpPlaceOfResidence.db.select(dbConn, taxEmpPoRFilter);
                    foreach (ETaxEmpPlaceOfResidence taxEmpPoR in taxEmpPoRList)
                    {
                        ETaxEmpPlaceOfResidence.db.delete(dbConn, taxEmpPoR);
                    }
                }
                WebUtils.EndFunction(dbConn);
            }
        }

        //if (DecryptedRequest["TaxFormID"] != null)
        //{
        //    try
        //    {
        //        CurrentTaxFormID = Int32.Parse(DecryptedRequest["TaxFormID"]);
        //    }
        //    catch
        //    {

        //    }
        //}
        //else if (!Int32.TryParse(TaxFormID.SelectedValue, out CurrentTaxFormID))
        //{
        //        CurrentTaxFormID = 0;
        //        //EPayrollGroup obj = new EPayrollGroup();
        //        //obj.PayGroupID = CurID;
        //        //if (!db.select(dbConn, obj))
        //        //    CurPayPeriodID = obj.CurrentPayPeriodID;
        //}
        if (CurrentTaxFormID > 0)
        {
            ETaxForm taxForm = new ETaxForm();
            taxForm.TaxFormID = CurrentTaxFormID;
            ETaxForm.db.select(dbConn, taxForm);

            if (taxForm.TaxFormType.Equals("B", StringComparison.CurrentCultureIgnoreCase))
            {
                TaxationGeneration.RearrangeSheetNo(dbConn, CurrentTaxFormID);
            }
        }
        view = loadData(info, db, Repeater);
        //Response.Redirect(Request.Url.LocalPath + "?" + Request.QueryString);
    }