public FrmCollectionControl()
        {
            SplashScreenManager.ShowForm(this, typeof(WaitForm1), true, true, false);

            InitializeComponent();

            publicStreetGroup = this;

            setImages();

            ToolStripEvent();

            iTransType = TransactionTypeCode.New;

            Load += OnFormLoad;

            openForm();

            gridView1.DoubleClick += gridView1_DoubleClick;

            cboBank.KeyPress += cboBank_KeyPress;

            txtClosing.Leave += txtClosing_Leave;

            //txtOpening.LostFocus += txtOpening_LostFocus;
            txtOpening.Leave += txtOpening_Leave;

            //txtTransfer.LostFocus += txtTransfer_LostFocus;
            txtTransfer.Leave += txtTransfer_Leave;

            txtTrans.EditValueChanged += txtTrans_EditValueChanged;

            txtTrans.Leave += txtTrans_Leave;

            bttnUpdate.Click += bttnUpdate_Click;

            bttnReport.Click += bttnReport_Click;

            bttnPay.Click += bttnPay_Click;

            bttnIGR.Click += bttnIGR_Click;

            //dtpStart.ValueChanged += dtpStart_ValueChanged;

            //dtpEnd.ValueChanged += dtpEnd_ValueChanged;

            cboAccount.SelectedIndexChanged += cboAccount_SelectedIndexChanged;

            cboBank.SelectedIndexChanged += cboBank_SelectedIndexChanged;

            txtClose.Leave += txtClose_Leave;

            txtopen.Leave += txtopen_Leave;

            txtAdvance.Leave += txtAdvance_Leave;

            txtCharges.Leave += TxtCharges_Leave;

            OnFormLoad(null, null);

            SplashScreenManager.CloseForm(false);
        }
Beispiel #2
0
 private void docBookRating_LinkPressed(object sender, NavBarLinkEventArgs e)
 {
     SplashScreenManager.ShowForm(this, typeof(Base.Waiting), true, true, false);
     DocumentLoading("AllRating.repx");
     SplashScreenManager.CloseForm(false);
 }
        private void btnImport_Click(object sender, EventArgs e)
        {
            SplashScreenManager.ShowForm(typeof(WaitForm2));
            // data from file
            SITES_BUS                 busSite         = new SITES_BUS();
            FACILITY_BUS              busFacility     = new FACILITY_BUS();
            MANUFACTURER_BUS          busManufacture  = new MANUFACTURER_BUS();
            DESIGN_CODE_BUS           busDesign       = new DESIGN_CODE_BUS();
            EQUIPMENT_MASTER_BUS      busEqMaster     = new EQUIPMENT_MASTER_BUS();
            COMPONENT_MASTER_BUS      busComMaster    = new COMPONENT_MASTER_BUS();
            RW_ASSESSMENT_BUS         busAss          = new RW_ASSESSMENT_BUS();
            RW_EQUIPMENT_BUS          busEq           = new RW_EQUIPMENT_BUS();
            RW_COMPONENT_BUS          buscom          = new RW_COMPONENT_BUS();
            RW_EXTCOR_TEMPERATURE_BUS busExcort       = new RW_EXTCOR_TEMPERATURE_BUS();
            RW_STREAM_BUS             busStream       = new RW_STREAM_BUS();
            RW_MATERIAL_BUS           busMaterial     = new RW_MATERIAL_BUS();
            RW_COATING_BUS            busCoat         = new RW_COATING_BUS();
            RW_INPUT_CA_LEVEL_1_BUS   busInputCA      = new RW_INPUT_CA_LEVEL_1_BUS();
            FACILITY_RISK_TARGET_BUS  busRiskTarget   = new FACILITY_RISK_TARGET_BUS();
            Bus_PLANT_PROCESS_Excel   busExcelProcess = new Bus_PLANT_PROCESS_Excel();

            busExcelProcess.path = txtPathFileExcel.Text;
            List <SITES> listSite = busExcelProcess.getAllSite();

            foreach (SITES s in listSite)
            {
                if (!busSite.checkExist(s.SiteName))
                {
                    busSite.add(s);
                }
                else
                {
                    busSite.edit(s);
                }
            }

            List <FACILITY> listFacility = busExcelProcess.getFacility();

            foreach (FACILITY f in listFacility)
            {
                if (busFacility.checkExist(f.FacilityName))
                {
                    busFacility.edit(f);
                }
                else
                {
                    busFacility.add(f);
                    int FaciID = busFacility.getLastFacilityID();
                    FACILITY_RISK_TARGET riskTarget = new FACILITY_RISK_TARGET();
                    riskTarget.FacilityID = FaciID;
                    busRiskTarget.add(riskTarget);
                }
            }

            List <string> manufacture = busExcelProcess.getAllManufacture();

            for (int i = 0; i < manufacture.Count; i++)
            {
                MANUFACTURER manu = new MANUFACTURER();
                manu.ManufacturerID   = busManufacture.getIDbyName(manufacture[i]);
                manu.ManufacturerName = manufacture[i];
                if (busManufacture.getIDbyName(manufacture[i]) == 0)
                {
                    busManufacture.add(manu);
                }
                else
                {
                    busManufacture.edit(manu);
                }
            }

            List <String> designcode = busExcelProcess.getAllDesigncode();

            for (int i = 0; i < designcode.Count; i++)
            {
                DESIGN_CODE design = new DESIGN_CODE();
                design.DesignCodeID  = busDesign.getIDbyName(designcode[i]);
                design.DesignCode    = designcode[i];
                design.DesignCodeApp = "";
                if (design.DesignCodeID == 0)
                {
                    busDesign.add(design);
                }
                else
                {
                    busDesign.edit(design);
                }
            }

            List <EQUIPMENT_MASTER> listEpMaster = busExcelProcess.getEquipmentMaster();

            foreach (EQUIPMENT_MASTER eqM in listEpMaster)
            {
                if (busEqMaster.check(eqM.EquipmentNumber))
                {
                    busEqMaster.edit(eqM);
                }
                else
                {
                    busEqMaster.add(eqM);
                }
            }

            List <COMPONENT_MASTER> listComMaster = busExcelProcess.getComponentMaster();

            foreach (COMPONENT_MASTER comM in listComMaster)
            {
                if (busComMaster.checkExist(comM.ComponentNumber))
                {
                    busComMaster.edit(comM);
                }
                else
                {
                    busComMaster.add(comM);
                }
            }

            List <RW_ASSESSMENT> listRW_Assessment = busExcelProcess.getAssessment();
            List <int>           editExcel         = new List <int>();
            List <int>           addExcel          = new List <int>();

            foreach (RW_ASSESSMENT rwAss in listRW_Assessment)
            {
                //kiem tra xem Proposal add bang file Excel hay add bang tay
                List <int[]> ID_checkAddbyExcel = busAss.getCheckAddExcel_ID(rwAss.ComponentID, rwAss.EquipmentID);
                if (ID_checkAddbyExcel.Count != 0)
                {
                    for (int i = 0; i < ID_checkAddbyExcel.Count; i++)
                    {
                        if (ID_checkAddbyExcel[i][0] != 0) //kiem tra xem co phai Assessment nay duoc them tu file Excel ko, !=0 la them tu file Excel
                        {
                            rwAss.ID = ID_checkAddbyExcel[i][1];
                            editExcel.Add(rwAss.ID);
                            busAss.edit(rwAss);
                        }
                    }
                }
                else
                {
                    rwAss.AddByExcel = 1;
                    busAss.add(rwAss);
                    int assID = busAss.getLastID();
                    addExcel.Add(assID);
                    RW_INPUT_CA_LEVEL_1 inputCA = new RW_INPUT_CA_LEVEL_1();
                    inputCA.ID = assID;
                    busInputCA.add(inputCA);
                }
            }

            List <RW_EQUIPMENT> listRw_eq = busExcelProcess.getRwEquipment();

            for (int i = 0; i < listRw_eq.Count; i++)
            {
                if (editExcel.Count != 0)
                {
                    for (int j = 0; j < editExcel.Count; j++)
                    {
                        if (listRw_eq[i].ID == editExcel[j])
                        {
                            busEq.edit(listRw_eq[i]);
                        }
                    }
                }
                if (addExcel.Count != 0)
                {
                    for (int j = 0; j < addExcel.Count; j++)
                    {
                        if (listRw_eq[i].ID == addExcel[j])
                        {
                            busEq.add(listRw_eq[i]);
                        }
                    }
                }
            }

            List <RW_COMPONENT> listRw_com = busExcelProcess.getRwComponent();

            for (int i = 0; i < listRw_com.Count; i++)
            {
                if (editExcel.Count != 0)
                {
                    for (int j = 0; j < editExcel.Count; j++)
                    {
                        if (listRw_com[i].ID == editExcel[j])
                        {
                            buscom.edit(listRw_com[i]);
                        }
                    }
                }
                if (addExcel.Count != 0)
                {
                    for (int j = 0; j < addExcel.Count; j++)
                    {
                        if (listRw_com[i].ID == addExcel[j])
                        {
                            buscom.add(listRw_com[i]);
                        }
                    }
                }
            }

            List <RW_EXTCOR_TEMPERATURE> listRw_extcor = busExcelProcess.getRwExtTemp();

            //MessageBox.Show(listRw_extcor.Count.ToString());
            for (int i = 0; i < listRw_extcor.Count; i++)
            {
                if (editExcel.Count != 0)
                {
                    for (int j = 0; j < editExcel.Count; j++)
                    {
                        if (listRw_extcor[i].ID == editExcel[j])
                        {
                            //MessageBox.Show("add file excel");
                            busExcort.edit(listRw_extcor[i]);
                        }
                    }
                }
                if (addExcel.Count != 0)
                {
                    for (int j = 0; j < addExcel.Count; j++)
                    {
                        if (listRw_extcor[i].ID == addExcel[j])
                        {
                            //MessageBox.Show("add file excel");
                            busExcort.add(listRw_extcor[i]);
                        }
                    }
                }
            }

            List <RW_STREAM> listRw_stream = busExcelProcess.getRwStream();

            for (int i = 0; i < listRw_stream.Count; i++)
            {
                if (editExcel.Count != 0)
                {
                    for (int j = 0; j < editExcel.Count; j++)
                    {
                        if (listRw_stream[i].ID == editExcel[j])
                        {
                            busStream.edit(listRw_stream[i]);
                        }
                    }
                }
                if (addExcel.Count != 0)
                {
                    for (int j = 0; j < addExcel.Count; j++)
                    {
                        if (listRw_stream[i].ID == addExcel[j])
                        {
                            busStream.add(listRw_stream[i]);
                        }
                    }
                }
            }

            List <RW_MATERIAL> listRw_material = busExcelProcess.getRwMaterial();

            for (int i = 0; i < listRw_material.Count; i++)
            {
                if (editExcel.Count != 0)
                {
                    for (int j = 0; j < editExcel.Count; j++)
                    {
                        if (listRw_material[i].ID == editExcel[j])
                        {
                            busMaterial.edit(listRw_material[i]);
                        }
                    }
                }
                if (addExcel.Count != 0)
                {
                    for (int j = 0; j < addExcel.Count; j++)
                    {
                        if (listRw_material[i].ID == addExcel[j])
                        {
                            busMaterial.add(listRw_material[i]);
                        }
                    }
                }
            }

            List <RW_COATING> listRw_coat = busExcelProcess.getRwCoating();

            for (int i = 0; i < listRw_coat.Count; i++)
            {
                if (editExcel.Count != 0)
                {
                    for (int j = 0; j < editExcel.Count; j++)
                    {
                        if (listRw_coat[i].ID == editExcel[j])
                        {
                            busCoat.edit(listRw_coat[i]);
                        }
                    }
                }
                if (addExcel.Count != 0)
                {
                    for (int j = 0; j < addExcel.Count; j++)
                    {
                        if (listRw_coat[i].ID == addExcel[j])
                        {
                            busCoat.add(listRw_coat[i]);
                        }
                    }
                }
            }
            ButtonOKClicked = true;
            SplashScreenManager.CloseForm();
            MessageBox.Show("All data have been saved! You need to add Risk Target in Facility!", "Cortek RBI", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            this.Close();
        }
Beispiel #4
0
        void bttnUpdate_Click(object sender, EventArgs e)
        {
            DataRowView oDataRowView = cboBatch.SelectedItem as DataRowView;

            if (radioGroup1.SelectedIndex == -1)
            {
                Common.setEmptyField("IGR Report Options...", Program.ApplicationName);
                return;
            }
            else
            {
                try
                {
                    SplashScreenManager.ShowForm(this, typeof(WaitForm1), true, true, false);

                    if (oDataRowView != null)
                    {
                        if (radioGroup1.EditValue == "Bank")//Call Report for bank Reconciliation
                        {
                            using (SqlConnection connect = new SqlConnection(Logic.ConnectionString))
                            {
                                connect.Open();
                                _command = new SqlCommand("doIGRReport", connect)
                                {
                                    CommandType = CommandType.StoredProcedure
                                };
                                _command.Parameters.Add(new SqlParameter("@Type", SqlDbType.VarChar)).Value      = "Bank";
                                _command.Parameters.Add(new SqlParameter("@BatchCode", SqlDbType.VarChar)).Value = oDataRowView.Row["BatchCode"];
                                _command.CommandTimeout = 0;
                                using (System.Data.DataSet ds = new System.Data.DataSet())
                                {
                                    ds.Clear();
                                    adp = new SqlDataAdapter(_command);
                                    adp.Fill(ds);
                                    connect.Close();

                                    if (ds.Tables[0].Rows[0]["returnCode"].ToString() == "00")
                                    {
                                        XtraRepGen report = new XtraRepGen();
                                        report.xrLabel18.Text = String.Format(" for the month of : [{0}]", oDataRowView.Row["BatchName"]);
                                        report.DataSource     = ds.Tables[1];
                                        report.DataMember     = "table";
                                        report.ShowPreviewDialog();
                                    }
                                    else
                                    {
                                        return;
                                    }
                                }
                            }
                        }
                        else if (radioGroup1.EditValue == "Agency")
                        {
                            using (SqlConnection connect = new SqlConnection(Logic.ConnectionString))
                            {
                                connect.Open();
                                _command = new SqlCommand("doIGRReport", connect)
                                {
                                    CommandType = CommandType.StoredProcedure
                                };
                                _command.Parameters.Add(new SqlParameter("@Type", SqlDbType.VarChar)).Value      = "Agency";
                                _command.Parameters.Add(new SqlParameter("@BatchCode", SqlDbType.VarChar)).Value = oDataRowView.Row["BatchCode"];
                                _command.CommandTimeout = 0;
                                using (System.Data.DataSet ds = new System.Data.DataSet())
                                {
                                    ds.Clear();
                                    adp = new SqlDataAdapter(_command);
                                    adp.Fill(ds);
                                    connect.Close();

                                    if (ds.Tables[0].Rows[0]["returnCode"].ToString() == "00")
                                    {
                                        XtraRepSummrayAgency repAgency = new XtraRepSummrayAgency()
                                        {
                                            DataSource = ds, DataMember = "table"
                                        };
                                        repAgency.xrLabel32.Text = string.Format(" {0} STATE GOVERNMENT ", Program.StateName.ToUpper());

                                        repAgency.xrLabel33.Text = string.Format("Summary of Collection by Agencies for the Month of  {0}", oDataRowView.Row["BatchName"]);
                                        repAgency.DataSource     = ds.Tables[1];
                                        repAgency.DataMember     = "ViewReconciliationAgencyDetails";
                                        repAgency.ShowPreviewDialog();
                                    }
                                    else
                                    {
                                        return;
                                    }
                                }
                            }
                        }
                        else if (radioGroup1.EditValue == "Revenue")
                        {
                            using (SqlConnection connect = new SqlConnection(Logic.ConnectionString))
                            {
                                connect.Open();
                                _command = new SqlCommand("doIGRReport", connect)
                                {
                                    CommandType = CommandType.StoredProcedure
                                };
                                _command.Parameters.Add(new SqlParameter("@Type", SqlDbType.VarChar)).Value      = "Revenue";
                                _command.Parameters.Add(new SqlParameter("@BatchCode", SqlDbType.VarChar)).Value = oDataRowView.Row["BatchCode"];
                                _command.CommandTimeout = 0;
                                using (System.Data.DataSet ds = new System.Data.DataSet())
                                {
                                    ds.Clear();
                                    adp = new SqlDataAdapter(_command);
                                    adp.Fill(ds);
                                    connect.Close();

                                    if (ds.Tables[0].Rows[0]["returnCode"].ToString() == "00")
                                    {
                                        XtraRepSummRevenue report = new XtraRepSummRevenue()
                                        {
                                            DataSource = ds.Tables[1], DataMember = "table"
                                        };
                                        //report.paramMonths.Value = dtpStart.Value.Month;
                                        //report.paramYear.Value = dtpStart.Value.Year;

                                        report.xrLabel32.Text = string.Format(" {0} STATE GOVERNMENT ", Program.StateName.ToUpper());

                                        report.xrLabel33.Text = string.Format("Summary of Collection by Revenue Type for the Month of  {0}", oDataRowView.Row["BatchName"]);

                                        report.ShowPreviewDialog();
                                    }
                                    else
                                    {
                                        return;
                                    }
                                }
                            }
                        }
                        else if (radioGroup1.EditValue == "Details")
                        {
                            using (SqlConnection connect = new SqlConnection(Logic.ConnectionString))
                            {
                                connect.Open();
                                _command = new SqlCommand("doIGRReport", connect)
                                {
                                    CommandType = CommandType.StoredProcedure
                                };
                                _command.Parameters.Add(new SqlParameter("@Type", SqlDbType.VarChar)).Value      = "Details";
                                _command.Parameters.Add(new SqlParameter("@BatchCode", SqlDbType.VarChar)).Value = oDataRowView.Row["BatchCode"];
                                _command.CommandTimeout = 0;
                                using (System.Data.DataSet ds = new System.Data.DataSet())
                                {
                                    ds.Clear();
                                    adp = new SqlDataAdapter(_command);
                                    adp.Fill(ds);
                                    connect.Close();

                                    if (ds.Tables[0].Rows[0]["returnCode"].ToString() == "00")
                                    {
                                        XtraRepAgencyDetails report = new XtraRepAgencyDetails();

                                        report.xrLabel32.Text = string.Format(" {0} STATE GOVERNMENT ", Program.StateName.ToUpper());
                                        report.xrLabel33.Text = string.Format("Summary of Collection by Agencies Details for the Month of  {0}", oDataRowView.Row["BatchName"]);

                                        //report.paramMonths.Value = dtpStart.Value.Month;
                                        //report.paramYears.Value = dtpStart.Value.Year;
                                        report.DataSource = ds.Tables[1];
                                        report.DataMember = "ViewReconciliationAgencyDetails";
                                        //report.DataAdapter
                                        report.ShowPreviewDialog();
                                    }
                                    else
                                    {
                                        return;
                                    }
                                }
                            }
                        }
                        else if (radioGroup1.EditValue == "Account")
                        {
                            using (SqlConnection connect = new SqlConnection(Logic.ConnectionString))
                            {
                                connect.Open();
                                _command = new SqlCommand("doIGRReport", connect)
                                {
                                    CommandType = CommandType.StoredProcedure
                                };
                                _command.Parameters.Add(new SqlParameter("@Type", SqlDbType.VarChar)).Value      = "Account";
                                _command.Parameters.Add(new SqlParameter("@BatchCode", SqlDbType.VarChar)).Value = oDataRowView.Row["BatchCode"];
                                _command.CommandTimeout = 0;
                                using (System.Data.DataSet ds = new System.Data.DataSet())
                                {
                                    ds.Clear();
                                    adp = new SqlDataAdapter(_command);
                                    adp.Fill(ds);
                                    connect.Close();

                                    if (ds.Tables[0].Rows[0]["returnCode"].ToString() == "00")
                                    {
                                        //XtraRepIGRSummary repsumary = new XtraRepIGRSummary();

                                        XtraRepIGRAccounts repacct = new XtraRepIGRAccounts();

                                        //repsumary.xrLabel13.Text = string.Format("{0} State Government", Program.StateName);

                                        //repsumary.xrLabel14.Text = string.Format("Summary of {0} State Government IGR Accounts for {1}", Program.StateName, oDataRowView.Row["BatchName"]);

                                        repacct.xrLabel27.Text = string.Format(" {0} STATE GOVERNMENT ", Program.StateName.ToUpper());

                                        repacct.xrLabel28.Text = string.Format(" DETAILS OF TRANSFER / CHARGES FOR {0}", oDataRowView.Row["BatchName"]);

                                        repacct.DataSource = ds.Tables[1];
                                        repacct.DataMember = "table";
                                        repacct.ShowPreviewDialog();
                                    }
                                    else
                                    {
                                        return;
                                    }
                                }
                            }
                        }
                        else if (radioGroup1.EditValue == "Consolidate")
                        {
                            using (SqlConnection connect = new SqlConnection(Logic.ConnectionString))
                            {
                                connect.Open();
                                _command = new SqlCommand("doIGRReport", connect)
                                {
                                    CommandType = CommandType.StoredProcedure
                                };
                                _command.Parameters.Add(new SqlParameter("@Type", SqlDbType.VarChar)).Value      = "Consolidate";
                                _command.Parameters.Add(new SqlParameter("@BatchCode", SqlDbType.VarChar)).Value = oDataRowView.Row["BatchCode"];
                                _command.CommandTimeout = 0;
                                using (System.Data.DataSet ds = new System.Data.DataSet())
                                {
                                    ds.Clear();
                                    adp = new SqlDataAdapter(_command);
                                    adp.Fill(ds);
                                    connect.Close();

                                    if (ds.Tables[0].Rows[0]["returnCode"].ToString() == "00")
                                    {
                                        XtraRepSummary repsummary = new XtraRepSummary();
                                        repsummary.xrLabel32.Text = string.Format("{0} STATE GOVERNMENT ", Program.StateName.ToUpper());
                                        repsummary.xrLabel33.Text = string.Format("CONSOLIDATED SUMMARY ACCOUNT OF IGR FOR THE MONTH OF {0}", oDataRowView.Row["BatchName"]);

                                        repsummary.DataSource = ds.Tables[1];

                                        repsummary.DataMember = "ViewConsolidateDetailsTransactions";

                                        //repsummary.paramPeriod.Value = dtpStart.Value.Month;
                                        //repsummary.paramYear.Value = dtpStart.Value.Year;
                                        repsummary.ShowPreviewDialog();
                                    }
                                    else
                                    {
                                        return;
                                    }
                                }
                            }
                        }
                        else if (radioGroup1.EditValue == "Bank Details")
                        {
                            using (SqlConnection connect = new SqlConnection(Logic.ConnectionString))
                            {
                                connect.Open();
                                _command = new SqlCommand("doIGRReport", connect)
                                {
                                    CommandType = CommandType.StoredProcedure
                                };
                                _command.Parameters.Add(new SqlParameter("@Type", SqlDbType.VarChar)).Value      = "Bank Details";
                                _command.Parameters.Add(new SqlParameter("@BatchCode", SqlDbType.VarChar)).Value = oDataRowView.Row["BatchCode"];
                                _command.CommandTimeout = 0;
                                using (System.Data.DataSet ds = new System.Data.DataSet())
                                {
                                    ds.Clear();
                                    adp = new SqlDataAdapter(_command);
                                    adp.Fill(ds);
                                    connect.Close();

                                    if (ds.Tables[0].Rows[0]["returnCode"].ToString() == "00")
                                    {
                                        XtraRepBankDetails bankdetails = new XtraRepBankDetails();

                                        var list = (from DataRow row in ds.Tables[1].Rows
                                                    select new Dataset.BankDetails
                                        {
                                            Amount = Convert.ToDecimal(row["Amount"]),
                                            PaymentDate = Convert.ToDateTime(row["PaymentDate"]),
                                            BankName = row["BankName"] as string,
                                            BankCode = row["BankCode"] as string,
                                            Description = row["Description"] as string,
                                            PayerName = row["PayerName"] as string,
                                            RevenueCode = row["RevenueCode"] as string,
                                            AccountNumber = row["AccountNumber"] as string,

                                            //Branchname = row["Branchname"] as string
                                        }
                                                    ).ToList();

                                        bankdetails.xrLabel17.Text = string.Format("{0} State Government", Program.StateName);

                                        bankdetails.xrLabel18.Text = string.Format("Bank Details of {0} State Government IGR Accounts for {1}", Program.StateName, oDataRowView.Row["BatchName"]);

                                        //bankdetails.DataSource = ds.Tables[1];
                                        //bankdetails.DataMember = "table";

                                        var binding = (BindingSource)bankdetails.DataSource;

                                        binding.Clear();

                                        binding.DataSource = list;

                                        bankdetails.ShowPreviewDialog();
                                    }
                                    else
                                    {
                                        return;
                                    }
                                }
                            }
                        }
                        else if (radioGroup1.EditValue == "Summary")
                        {
                            using (SqlConnection connect = new SqlConnection(Logic.ConnectionString))
                            {
                                connect.Open();
                                _command = new SqlCommand("doIGRReport", connect)
                                {
                                    CommandType = CommandType.StoredProcedure
                                };
                                _command.Parameters.Add(new SqlParameter("@Type", SqlDbType.VarChar)).Value      = "Summary";
                                _command.Parameters.Add(new SqlParameter("@BatchCode", SqlDbType.VarChar)).Value = oDataRowView.Row["BatchCode"];
                                _command.CommandTimeout = 0;

                                using (System.Data.DataSet ds = new System.Data.DataSet())
                                {
                                    ds.Clear();
                                    adp = new SqlDataAdapter(_command);
                                    adp.Fill(ds);
                                    connect.Close();

                                    if (ds.Tables[0].Rows[0]["returnCode"].ToString() == "00")
                                    {
                                        XtraRepIGRSummary repsumary = new XtraRepIGRSummary();

                                        repsumary.xrLabel13.Text = string.Format("{0} State Government", Program.StateName);

                                        repsumary.xrLabel14.Text = string.Format("Summary of {0} State Government IGR Accounts for {1}", Program.StateName, oDataRowView.Row["BatchName"]);
                                        repsumary.DataSource     = ds.Tables[1];
                                        repsumary.DataMember     = "table";
                                        repsumary.ShowPreviewDialog();
                                    }
                                    else
                                    {
                                        return;
                                    }
                                }
                            }
                        }
                    }
                    else
                    {
                    }
                }
                catch (Exception ex)
                {
                    Tripous.Sys.ErrorBox(ex);
                }
                finally
                {
                    SplashScreenManager.CloseForm(false);
                }
            }
        }
        private bool Validation()
        {
            if (txt_name.Text == "")
            {
                SplashScreenManager.CloseForm(false);
                XtraMessageBox.Show("Enter Your_Name");
                txt_yourname.Focus();
                return(false);
            }
            else if (txt_Email_address.Text == "")
            {
                SplashScreenManager.CloseForm(false);
                XtraMessageBox.Show("Enter Email_Address");
                txt_Email_address.Focus();
                return(false);
            }
            else if (txt_Incoming_server.Text == "")
            {
                SplashScreenManager.CloseForm(false);
                XtraMessageBox.Show("Enter Incoming Server details");
                txt_Incoming_server.Focus();
                return(false);
            }
            else if (txt_Outgoing_server.Text == "")
            {
                SplashScreenManager.CloseForm(false);
                XtraMessageBox.Show("Enter Outgoing server details");
                txt_Outgoing_server.Focus();
                return(false);
            }
            else if (txt_User_Name.Text == "")
            {
                SplashScreenManager.CloseForm(false);
                XtraMessageBox.Show("Enter User Name");
                txt_User_Name.Focus();
                return(false);
            }
            else if (txt_password.Text == "")
            {
                SplashScreenManager.CloseForm(false);
                XtraMessageBox.Show("Enter Password");
                txt_password.Focus();
                return(false);
            }
            //else if (txt_IS.Text == "")
            //{
            //    MessageBox.Show("please enter the Incoming Port");
            //    txt_IS.Focus();
            //    return false;

            //}
            else if (((txt_IS.Text != "" && (Convert.ToInt32(txt_IS.Text.Length) > 4)) || txt_IS.Text == ""))
            {
                SplashScreenManager.CloseForm(false);
                XtraMessageBox.Show("incoming port must be less than 4....And please enter Incoming port");
                txt_IS.Focus();
                return(false);
            }
            //else if (txt_OS.Text == "")
            //{
            //    MessageBox.Show("Please enter the Outgoing Server Port");
            //    txt_OS.Focus();
            //    return false;
            //}
            else if (((txt_OS.Text != "" && (Convert.ToInt32(txt_OS.Text.Length) > 4) || txt_OS.Text == "")))
            {
                SplashScreenManager.CloseForm(false);
                XtraMessageBox.Show("Outgoing port must be less than 4.....And please enter Outgoing port");
                txt_OS.Focus();
                return(false);
            }
            Regex myRegularExpression = new Regex("^([0-9a-zA-Z]([-\\.\\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\\w]*[0-9a-zA-Z]\\.)+[a-zA-Z]{2,9})$");

            if (myRegularExpression.IsMatch(txt_Email_address.Text))
            {
            }
            else
            {
                SplashScreenManager.CloseForm(false);
                XtraMessageBox.Show("Email Address Not Valid");
                txt_Email_address.Focus();
                return(false);
            }

            return(true);
        }
 /// <summary>
 ///     [EN] ShowWaitForm
 ///     Create By: ManhNV1 -Date:02/25/2016
 ///     Descripton: ShowWaitForm
 /// </summary>
 /// <param name="frmWaitForm">Form Used</param>
 /// <param name="strCaption">
 ///     Title WaitForm:
 ///     if strCaption = null => Value = Please Wait
 ///     else => Value = strCaption
 /// </param>
 /// <param name="strDescription">Description WaitForm</param>
 /// <returns>SplashScreenManager Type</returns>
 public static SplashScreenManager ShowWaitForm(Form frmWaitForm, string strCaption
     , string strDescription)
 {
     var splashScreenManager = new SplashScreenManager(frmWaitForm
         , typeof (WaitFormPlease), true, true);
     splashScreenManager.ShowWaitForm();
     if (strCaption == null)
         splashScreenManager.SetWaitFormCaption(SEDConst.SET_PLEASE_WAIT);
     else splashScreenManager.SetWaitFormCaption(strCaption);
     // Nếu Null thì dùng strDescription không thì  Set_Loading
     splashScreenManager.SetWaitFormDescription(strDescription ?? SEDConst.SET_LOADING);
     return splashScreenManager;
 }
Beispiel #7
0
 private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     // MetalMaskGlobal.waitForm.Close();
     SplashScreenManager.CloseForm();
 }
Beispiel #8
0
 private void GirisForm_Load(object sender, System.EventArgs e)
 {
     SplashScreenManager.ShowForm(typeof(Baslatiliyor));
     Yukle();
     SplashScreenManager.CloseForm();
 }
 public uc_Configuration(SplashScreenManager spl)
 {
     InitializeComponent();
     this.spl = spl;
 }
Beispiel #10
0
 protected CommonChildForm()
 {
     InitializeComponent();
     ssManager = new SplashScreenManager(this, typeof(XtraWaitForm), true, true);
 }
Beispiel #11
0
        /// <summary>
        /// Abre el formulario de edicion de una orden de trabajo específica
        /// </summary>
        /// <param name="anOrdenDeTrabajoId"></param>
        /// <param name="obligaEditarFechas">si es true luego de abrir el formulario limpia los cambios de fecha
        /// util para cuando se duplica una orden de trabajo</param>
        public EditOtXtraForm(Guid anOrdenDeTrabajoId, bool obligaEditarFechas = false)
        {
            try
            {
                SplashScreenManager.ShowForm(MdiParent, typeof(WaitForm1), true, true);
            }
            catch (Exception)
            {
                SplashScreenManager.CloseForm();
                SplashScreenManager.ShowForm(MdiParent, typeof(WaitForm1), true, true);
            }


            AIsAnUpdate = true;
            InitializeComponent();
            AgrupacionControl.Properties.Buttons[1].Enabled = true;
            FechaConfecciontimeEdit.DateTime = DateTime.Today;
            AOrdenDeTrabajoId = anOrdenDeTrabajoId;

            GlobalActividad =
                AGLobalDataContext.OrdenDeTrabajo.FirstOrDefault(c => c.OrdenDeTrabajoID == AOrdenDeTrabajoId);
            Text            += " " + GlobalActividad.ConsecutivoString;
            ATipoDeActividad = (Enumerados.TipoActividad)Enum.Parse(typeof(Enumerados.TipoActividad),
                                                                    GlobalActividad.TipoActividad.ToString());
            if (GlobalActividad != null)
            {
                PopulaControles();
                if (ATipoDeActividad == Enumerados.TipoActividad.Factura)
                {
                    EsProyeco_checkEdit.Checked = GlobalActividad.ProyectosId != null;
                    PopulaImporteGridControl();
                }
            }
            AcomodaSegunTipoActividad();
            NumOT_labelControl.Text                = GlobalActividad.NumeroDeOrden;
            NumOT_labelControl.ForeColor           = Color.DarkBlue;
            FechaConfecciontimeEdit.EditValue      = GlobalActividad.FechaConfeccion;
            fechaIncialActividadDateEdit.EditValue = GlobalActividad.FechaIncialActividad;
            fechaFinalActividadDateEdit.EditValue  = GlobalActividad.FechaFinalActividad;
            if (!GlobalActividad.Agrupacion.PerteneceACatalogo)
            {
                CargaTodasAgrupaciones();
            }
            AgrupacionControl.EditValue = GlobalActividad.AgrupacionId;
            monedaLookUpEdit.EditValue  = GlobalActividad.TipoMonedaId;
            clienteQueContrataIdComboBoxEdit.EditValue = GlobalActividad.ClienteQueContrataId;
            if (GlobalActividad.ProyectosId != null)
            {
                Proyectos_SearchlookUpEdit.EditValue = GlobalActividad.ProyectosId;
            }
            Observaciones_memoExEdit.EditValue    = GlobalActividad.Observaciones;
            Cover_checkEdit.Checked               = GlobalActividad.EsPorCover;
            lugarDePresentacionTextEdit.Text      = GlobalActividad.LugarDePresentacion;
            importePorActividadTextEdit.EditValue = GlobalActividad.ImportePorActividad;
            NumeroContrato_textEdit.Text          = GlobalActividad.NumeroContrato;
            cantidadActividadesSpinEdit.EditValue = GlobalActividad.CantidadActividades;
            Recordatorio_memoEdit.Text            = GlobalActividad.Nota;
            if (obligaEditarFechas)
            {
                fechaIncialActividadDateEdit.Text = "";
                fechaFinalActividadDateEdit.Text  = "";
            }
        }
Beispiel #12
0
 /// <summary>
 ///  显示进度条
 /// </summary>
 /// <param name="manager">进度条</param>
 /// <param name="caption">标题</param>
 /// <param name="description">描述</param>
 /// Author  : Napoleon
 /// Created : 2015-02-26 20:30:27
 protected void ShowManager(SplashScreenManager manager, string caption, string description)
 {
     manager.ShowWaitForm();
     manager.SetWaitFormCaption(caption);
     manager.SetWaitFormDescription(description);
 }
Beispiel #13
0
 /// <summary>
 ///  隐藏进度条
 /// </summary>
 /// <param name="manager">进度条</param>
 /// <param name="showForm">需要显示的窗体</param>
 /// <param name="hideForm">需要隐藏的窗体</param>
 /// Author  : Napoleon
 /// Created : 2015-02-26 20:33:22
 protected void HideManager(SplashScreenManager manager, Form showForm, Form hideForm)
 {
     hideForm.Hide();
     manager.CloseWaitForm();
     showForm.Show();
 }
 //TODO Comment
 public static bool CheckConnectTimeOutWait(SplashScreenManager splashScreenManager)
 {
     if (IsConnectedToInternet() == false)
     {
         splashScreenManager.ShowWaitForm();
         //TODO Set Constant
         splashScreenManager.SetWaitFormCaption("Checking the network connection!");
         splashScreenManager.SetWaitFormDescription(SEDConst.SET_PLEASE_WAIT);
         Thread.Sleep(7000);
         splashScreenManager.CloseWaitForm();
         if (IsConnectedToInternet() == false)
         {
             //TODO Set Constant
             XtraMessageBox.Show("Connect Timout. Checking the network connection...!",
                 SEDConst.MESSAGE_WARNING_DISCONNECTED);
             return false;
         }
         return true;
     }
     return true;
 }
Beispiel #15
0
 public F配置()
 {
     SplashScreenManager.ShowForm(this.FindForm(), typeof(DevExpress.XtraWaitForm.DemoWaitForm), false, true, false);
     InitializeComponent();
 }
Beispiel #16
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            /*   gvGdwu.DataSource = null;
             * adpter = new MySqlDataAdapter("SELECT a.KHID,a.CMND, a.TenKH, b.NgayGD, b.GioGD, b.TongTien FROM ql.khachhang a, ql.giaodich b where a.KHID = b.khachhang_KHID and b.NgayGD between '" + dtNgaybatdau.Text + "' and '" + dtNgayketthuc.Text + "'", cn.conn);
             * ds = new DataSet();
             * adpter.Fill(ds);
             * gvGdwu.DataSource = ds.Tables[0];
             * string text = "";
             * text += "Giao dịch WU từ ngày: " + dtNgaybatdau.Text + " đến ngày: " + dtNgayketthuc.Text;
             * gridView1.ViewCaption = text;*/
            try
            {
                nb = 1;
                gvGdwu.DataSource = null;
                SplashScreenManager.ShowForm(this, typeof(frmWait2), true, true);
                a = true;
                cn.openconnection();
                MySqlCommand cmd = new MySqlCommand();
                cmd.CommandType = CommandType.Text;
                //  cmd.CommandText = "SELECT a.KHID,a.CMND, a.TenKH, b.NgayGD, b.GioGD, b.TongTien,b.QuocGiaGui,b.DiemChiTra,IF(b.GiaoDichWU = 1, 'Có', N'Không') AS 'GiaoDichWU',b.MSNT FROM khachhang a, giaodich b where a.KHID = b.khachhang_KHID and b.NgayGD between '" + dtNgaybatdau.Text + "' and '" + dtNgayketthuc.Text + "'";
                //  cmd.CommandText = "SELECT a.KHID,a.CMND, a.TenKH, b.NgayGD, b.GioGD, b.TongTien,b.QuocGiaGui,b.DiemChiTra,IF(b.GiaoDichWU = 1, 'Có', N'Không') AS 'GiaoDichWU',b.MSNT FROM khachhang a, giaodich b where a.KHID = b.khachhang_KHID and b.NgayGD >= STR_TO_DATE('" + dtNgaybatdau.EditValue + "','%d/%m/%Y %H:%i:%s') and b.NgayGD <= STR_TO_DATE('" + dtNgayketthuc.EditValue + "','%d/%m/%Y %H:%i:%s') ORDER BY b.NgayGD DESC";
                cmd.CommandText = "SELECT b.idGiaoDich,a.KHID,a.CMND, a.TenKH, b.NgayGD, b.GioGD,b.NgayGiaoDich, b.TongTien,b.QuocGiaGui,b.DiemChiTra,IF(b.GiaoDichWU = 1, 'Có', N'Không') AS 'GiaoDichWU',b.MSNT FROM khachhang a, giaodich b where b.IsXoa = 1 and a.KHID = b.khachhang_KHID and b.NgayGiaoDich >= STR_TO_DATE('" + dtNgaybatdau.EditValue + "','%d/%m/%Y %H:%i:%s') and b.NgayGiaoDich <= STR_TO_DATE('" + dtNgayketthuc.EditValue + "','%d/%m/%Y %H:%i:%s') ORDER BY b.NgayGiaoDich DESC";
                cmd.Connection  = cn.conn;
                DataTable dt = new DataTable();
                dt.Columns.Add("idGiaoDich");
                dt.Columns.Add("STT");
                dt.Columns.Add("KHID");
                dt.Columns.Add("CMND");
                dt.Columns.Add("TenKH");
                dt.Columns.Add("NgayGD");
                dt.Columns.Add("GioGD");
                dt.Columns.Add("NgayGiaoDich");
                dt.Columns.Add("TongTien");
                dt.Columns.Add("QuocGiaGui");
                dt.Columns.Add("DiemChiTra");
                dt.Columns.Add("GiaoDichWU");
                dt.Columns.Add("MSNT");

                MySqlDataReader rd = cmd.ExecuteReader();
                while (rd.Read())
                {
                    DataRow row = dt.NewRow();
                    row["idGiaoDich"] = rd["idGiaoDich"];
                    row["STT"]        = nb;
                    nb           = nb + 1;
                    row["KHID"]  = rd["KHID"];
                    row["CMND"]  = rd["CMND"];
                    row["TenKH"] = rd["TenKH"];
                    string s = rd["NgayGD"].ToString();
                    int    r = s.Length;
                    s                   = Left(s, 10);
                    row["NgayGD"]       = s;
                    row["GioGD"]        = rd["GioGD"];
                    row["NgayGiaoDich"] = rd["NgayGiaoDich"];
                    row["TongTien"]     = rd["TongTien"];
                    row["QuocGiaGui"]   = rd["QuocGiaGui"];
                    row["DiemChiTra"]   = rd["DiemChiTra"];
                    row["GiaoDichWU"]   = rd["GiaoDichWU"];
                    row["MSNT"]         = rd["MSNT"];
                    dt.Rows.Add(row);
                }

                rd.Close();
                gvGdwu.DataSource = dt;
                //      gridView1.Columns[0].Visible = false;

                text = "Giao dịch từ ngày: " + dtNgaybatdau.EditValue + " đến ngày: " + dtNgayketthuc.EditValue;

                gridView1.ViewCaption = text;
                SplashScreenManager.CloseForm();
                a = false;
                //gridColumn10.BestFit();
                //gridColumn5.BestFit();
                //gridColumn9.BestFit();
                textEdit1.Text = "";

                /*  gridView1.GroupSummary.Clear();
                 * GridSummaryItem summaryItemMaxOrderSum = gridView1.GroupSummary.Add(DevExpress.Data.SummaryItemType.Sum, "TongTien", null, "(Tổng tiền giao dịch: {0:c0})");
                 * GridSummaryItem summaryItemMaxOrderSum1 = gridView1.GroupSummary.Add(DevExpress.Data.SummaryItemType.Count, null, null, "Số lần giao dịch: {0}");*/
                //      t.Abort();

                //  gridColumn3.BestFit();
            }
            catch (Exception ex)
            {
                if (a == true)
                {
                    SplashScreenManager.CloseForm();
                    a = false;
                }
                XtraMessageBox.Show(ex.Message);
            }
            finally
            {
                cn.closeconnection();
                cn.conn.Dispose();
            }
        }
Beispiel #17
0
        private void Btn_Guardar_Click(object sender, EventArgs e)
        {
            //-- Boton Guardar Documento

            SplashScreenManager.ShowForm(this, typeof(WaitForm1), true, true, false);
            SplashScreenManager.Default.SetWaitFormDescription("Grabando información...");

            Model.Formulacion_Detalle_Personal   MFDP = new Model.Formulacion_Detalle_Personal();
            Service.Formulacion_Detalle_Personal SFDP = new Service.Formulacion_Detalle_Personal();

            workbook = spreadsheetControl.Document;
            Worksheet worksheet_HojaTrabajo = workbook.Worksheets[0];

            int _Rows = 9;
            int intIdFormulacion_Detalle_Personal = 0;

            while (true)
            {
                if (string.IsNullOrEmpty(Convert.ToString(worksheet_HojaTrabajo.Cells[_Rows, 3].Value.TextValue)))
                {
                    break;
                }



                MFDP.IidFormulacion_Detalle_Personal = Convert.ToInt32(worksheet_HojaTrabajo.Cells[_Rows, 30].Value.NumericValue);
                MFDP.CañoProceso     = strAñoProceso;
                MFDP.Cversion        = strVersion;
                MFDP.CcodCeCo        = Convert.ToString(worksheet_HojaTrabajo.Cells[_Rows, 6].Value.TextValue);
                MFDP.CcodCeCo_Gestor = strCodCentroCosto;
                MFDP.CcodPosPre      = Convert.ToString(worksheet_HojaTrabajo.Cells[_Rows, 6].Value.TextValue);
                MFDP.CcodConcepto    = FS.TraerDescripcion_DataTable(DS_Concepto.Tables[0],
                                                                     1,
                                                                     0,
                                                                     Convert.ToString(worksheet_HojaTrabajo.Cells[_Rows, 9].Value.TextValue)
                                                                     );
                if (string.IsNullOrEmpty(Convert.ToString(worksheet_HojaTrabajo.Cells[_Rows, 10].Value.TextValue)))
                {
                    MFDP.CTipoOrden   = "";
                    MFDP.CNumeroOrden = "";
                }
                else
                {
                    MFDP.CTipoOrden   = Convert.ToString(worksheet_HojaTrabajo.Cells[_Rows, 10].Value.TextValue).Substring(0, 2);
                    MFDP.CNumeroOrden = Convert.ToString(worksheet_HojaTrabajo.Cells[_Rows, 10].Value.TextValue).Substring(3, 10);
                }


                MFDP.CcodFuenteFinanciamiento = "001";
                MFDP.CcodTipoFormulacion      = strCodTipoFormulacion;

                //MFDP.CcodProyecto = strCodProyecto;
                MFDP.CcodProyecto         = "CORPORATIVOS  ";
                MFDP.CcodClaseGasto       = "02";
                MFDP.TdescripcionGasto    = Convert.ToString(worksheet_HojaTrabajo.Cells[_Rows, 11].Value.TextValue);
                MFDP.FvalorAnterior       = Convert.ToDouble(worksheet_HojaTrabajo.Cells[_Rows, 12].Value.NumericValue);
                MFDP.FvalorRestoActual    = Convert.ToDouble(worksheet_HojaTrabajo.Cells[_Rows, 13].Value.NumericValue);
                MFDP.FvalorFormulacion    = Convert.ToDouble(worksheet_HojaTrabajo.Cells[_Rows, 26].Value.NumericValue);
                MFDP.FvalorFormulacionUno = Convert.ToDouble(worksheet_HojaTrabajo.Cells[_Rows, 27].Value.NumericValue);
                MFDP.FvalorFormulacionDos = Convert.ToDouble(worksheet_HojaTrabajo.Cells[_Rows, 28].Value.NumericValue);

                if (Convert.ToString(worksheet_HojaTrabajo.Cells[_Rows, 1].Value.TextValue) == "Año Anterior")
                {
                    MFDP.IcodTipoInserccion = 2; // 2 Automatico
                }
                else
                {
                    MFDP.IcodTipoInserccion = 1; //- 1 Manual
                }
                MFDP.Cusuario = MyStuff.CodigoEmpleado;

                MFDP.Fmes_01 = Convert.ToDouble(worksheet_HojaTrabajo.Cells[_Rows, 14].Value.NumericValue);
                MFDP.Fmes_02 = Convert.ToDouble(worksheet_HojaTrabajo.Cells[_Rows, 15].Value.NumericValue);
                MFDP.Fmes_03 = Convert.ToDouble(worksheet_HojaTrabajo.Cells[_Rows, 16].Value.NumericValue);
                MFDP.Fmes_04 = Convert.ToDouble(worksheet_HojaTrabajo.Cells[_Rows, 17].Value.NumericValue);
                MFDP.Fmes_05 = Convert.ToDouble(worksheet_HojaTrabajo.Cells[_Rows, 18].Value.NumericValue);
                MFDP.Fmes_06 = Convert.ToDouble(worksheet_HojaTrabajo.Cells[_Rows, 19].Value.NumericValue);
                MFDP.Fmes_07 = Convert.ToDouble(worksheet_HojaTrabajo.Cells[_Rows, 20].Value.NumericValue);
                MFDP.Fmes_08 = Convert.ToDouble(worksheet_HojaTrabajo.Cells[_Rows, 21].Value.NumericValue);
                MFDP.Fmes_09 = Convert.ToDouble(worksheet_HojaTrabajo.Cells[_Rows, 22].Value.NumericValue);
                MFDP.Fmes_10 = Convert.ToDouble(worksheet_HojaTrabajo.Cells[_Rows, 23].Value.NumericValue);
                MFDP.Fmes_11 = Convert.ToDouble(worksheet_HojaTrabajo.Cells[_Rows, 24].Value.NumericValue);
                MFDP.Fmes_12 = Convert.ToDouble(worksheet_HojaTrabajo.Cells[_Rows, 25].Value.NumericValue);

                if (ValidaLineaGrabacion(MFDP, _Rows) == false)
                {
                    if (MFDP.IidFormulacion_Detalle_Personal == 0)
                    {
                        if (MyStuff.UsaWCF == true)
                        {
                            intIdFormulacion_Detalle_Personal = objWCF.Graba_FormulacionDetalle_Personal(MFDP);
                        }
                        else
                        {
                            intIdFormulacion_Detalle_Personal = SFDP.Graba_FormulacionDetalle_Personal(MFDP);
                        }
                        string Rango = traeRangoCelda(1, _Rows + 1, 1, _Rows + 1);
                        workbook = spreadsheetControl.Document;
                        Range      range           = worksheet_HojaTrabajo.Range[Rango];
                        Formatting rangeFormatting = range.BeginUpdateFormatting();
                        rangeFormatting.Fill.BackgroundColor = Color.Green;
                        range.EndUpdateFormatting(rangeFormatting);

                        worksheet_HojaTrabajo.Cells[_Rows, 30].Value = intIdFormulacion_Detalle_Personal;
                    }
                    else
                    {
                        if (MyStuff.UsaWCF == true)
                        {
                            intIdFormulacion_Detalle_Personal = objWCF.Modifica_FormulacionDetalle_Personal(MFDP);
                        }
                        else
                        {
                            intIdFormulacion_Detalle_Personal = SFDP.Modifica_FormulacionDetalle_Personal(MFDP);
                        }
                    }
                }

                _Rows++;
            }

            SplashScreenManager.CloseForm();
        }
 public DataBaseErrorForm()
 {
     SplashScreenManager.CloseForm(false);
     InitializeComponent();
 }
 protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
 {
     if (keyData == Keys.Delete)
     {
         if (select == "qt")
         {
             if (XtraMessageBox.Show("Xoá quá trình đang chọn?", "Xoá", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
             {
                 gridView1.DeleteSelectedRows();
                 unitQUATRINH.CommitChanges();
             }
             return(true);
         }
         if (select == "qh")
         {
             if (XtraMessageBox.Show("Xoá quan hệ đang chọn?", "Xoá", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
             {
                 gridView2.DeleteSelectedRows();
                 unitQUANHE.CommitChanges();
             }
             return(true);
         }
         if (select == "ta")
         {
             if (XtraMessageBox.Show("Xoá tiền án đang chọn?", "Xoá", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
             {
                 gridView21.DeleteSelectedRows();
                 unitTIENAN.CommitChanges();
             }
             return(true);
         }
         if (select == "db")
         {
             if (XtraMessageBox.Show("Xoá diễn biến đang chọn?", "Xoá", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
             {
                 gridView4.DeleteSelectedRows();
                 unitDIENBIEN.CommitChanges();
             }
             return(true);
         }
         if (select == "tv")
         {
             if (XtraMessageBox.Show("Xoá tạm trú-tạm vắng đang chọn?", "Xoá", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
             {
                 gridView6.DeleteSelectedRows();
                 unitTAMVANG.CommitChanges();
             }
             return(true);
         }
         if (keyData == (Keys.Control | Keys.S))
         {
             SplashScreenManager.ShowDefaultWaitForm("Đang tải", "Vui lòng chờ...");
             try
             {
                 unitNHANKHAU.CommitChanges();
                 unitQUATRINH.CommitChanges();
                 unitQUANHE.CommitChanges();
                 unitTIENAN.CommitChanges();
                 unitDIENBIEN.CommitChanges();
                 unitTAMVANG.CommitChanges();
                 alertControl1.Show(this, "Thông báo", "Đã lưu");
             }
             catch (Exception)
             { }
             SplashScreenManager.CloseDefaultWaitForm();
         }
         return(true);
     }
     return(base.ProcessCmdKey(ref msg, keyData));
 }
Beispiel #20
0
        private void btnSearchCEP_Click(object sender, EventArgs e)
        {
            if (!validatorSearchCEP.Validate())
            {
                return;
            }

            tfCep.SelectAll();

            try
            {
                if (Util.isConnectedWeb() && (tfCep.EditValue != null && !String.IsNullOrEmpty(tfCep.EditValue.ToString())))
                {
                    SplashScreenManager.ShowForm(desk, typeof(PleaseWaitForm), false, false, false);
                    WebCEP wcep = new WebCEP(tfCep.EditValue.ToString(), WebCEP.TypeCase.Upper);

                    ((address)bdgAddress.Current).state_id = 0;
                    cbStateAddress.EditValue = 0;
                    ((address)bdgAddress.Current).city_id = 0;
                    cbCity.EditValue = 0;
                    ((address)bdgAddress.Current).district = "";
                    tfDistrict.EditValue = "";
                    ((address)bdgAddress.Current).name = "";
                    tfAddress.EditValue = "";

                    if (wcep.RESULTADO == 0)
                    {
                        ((address)bdgAddress.Current).cep = "";
                        tfCep.EditValue = "";

                        SplashScreenManager.CloseForm(false);
                        XtraMessageBox.Show("O CEP informado não foi encontrado!\nVerifique e tente novamente ou informe o endereço manualmente.",
                                            "CADORE TECNOLOGIA");
                        return;
                    }
                    else
                    {
                        state s = state.SingleOrDefault("WHERE symbol ILIKE @0", state.Concat(wcep.UF));
                        if (s != null)
                        {
                            ((address)bdgAddress.Current).state_id = s.id;
                            cbStateAddress.EditValue = s.id;
                        }

                        Console.WriteLine(wcep.CIDADE);
                        city c = city.SingleOrDefault("WHERE remove_character(name) ILIKE remove_character(@0)", city.Concat(wcep.CIDADE));
                        if (c != null)
                        {
                            ((address)bdgAddress.Current).city_id = c.id;
                            cbCity.EditValue = c.id;
                        }

                        if (wcep.RESULTADO == 1)
                        {
                            ((address)bdgAddress.Current).district = wcep.BAIRRO;
                            tfDistrict.EditValue = wcep.BAIRRO;

                            string street = String.Format("{0} {1}", wcep.TIPOLAGRADOURO, wcep.LAGRADOURO);
                            ((address)bdgAddress.Current).name = street;
                            tfAddress.EditValue = street;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(String.Format("Ocorreu um erro\n\n{0}\n{1}", ex.Message, ex.InnerException));
            }
            finally
            {
                SplashScreenManager.CloseForm(false);
            }
        }
        private void btnLuu_ItemClick(object sender, ItemClickEventArgs e)
        {
            // Kiểm tra thông tin nhập vào
            if (string.IsNullOrEmpty(txtEmail.Text.ToString().Trim()))
            {
                MessageBox.Show("Email nhân viên không được để trống", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtEmail.Focus();
                return;
            }
            else if (string.IsNullOrEmpty(txtMatKhau.Text.ToString().Trim()))
            {
                MessageBox.Show("Mật khẩu khách hàng không được để trống", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtMatKhau.Focus();
                return;
            }
            else if (Commons.KiemTraEmailHopLe(txtEmail.Text.ToString().Trim()) != true)
            {
                MessageBox.Show("Email không được định dạng đúng", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtEmail.Focus();
                return;
            }
            else
            {
                SplashScreenManager.ShowForm(this, typeof(WaitLoadFrm));
                string taikhoan = cboTaiKhoan.EditValue.ToString().Trim();
                string matkhau  = txtMatKhau.EditValue.ToString().Trim();
                string email    = txtEmail.EditValue.ToString().Trim();

                TaiKhoanNV nv = new TaiKhoanNV();
                nv.TaiKhoan  = taikhoan;
                nv.MatKhau   = matkhau;
                nv.Email     = email;
                nv.TinhTrang = 0;
                if (nhanVien.ThemTKNhanVien(nv))
                {
                    try
                    {
                        NhanVien nvv = new NhanVien();
                        nvv = nhanVien.LayTTNhanVien(taikhoan);
                        GMail gMail = new GMail();
                        gMail.GuiEmailTaiKhoan(email, nvv.HoTenNV, taikhoan, matkhau);
                        SplashScreenManager.CloseDefaultSplashScreen();
                        MessageBox.Show("Tạo tài khoản cho mã khách hàng " + cboTaiKhoan.EditValue.ToString() + " thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        FrmTaiKhoanNV_Load(null, null);
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show("Tạo tài khoản cho mã khách hàng " + cboTaiKhoan.EditValue.ToString() + " thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        MessageBox.Show("Không gửi được gmail cho khách hàng " + cboTaiKhoan.EditValue.ToString(), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        FrmTaiKhoanNV_Load(null, null);
                        throw;
                    }
                }
                else
                {
                    MessageBox.Show("Lỗi tạo tài khoản cho khách hàng " + cboTaiKhoan.EditValue.ToString(), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    SplashScreenManager.CloseDefaultSplashScreen();
                    FrmTaiKhoanNV_Load(null, null);
                }
            }
        }
 public virtual void RefreshLogs(SplashScreenManager splash)
 {
     splash.ShowWaitForm();
     trackRecordLogs = GetTrackRecordLogs();
     splash.CloseWaitForm();
 }
        private async void btn_save_Click(object sender, EventArgs e)
        {
            try
            {
                if (Validation() != false)
                {
                    if (emailId == 0 && btn_save.Text == "Save" && (await Usercheck()) != false)
                    {
                        SplashScreenManager.ShowForm(this, typeof(WaitForm1), true, true, false);
                        txt_IS.Enabled = true;
                        txt_OS.Enabled = true;
                        var dictionary = new Dictionary <string, object>();
                        {
                            dictionary.Add("@Trans", "INSERT");
                            dictionary.Add("@Your_Name", txt_name.Text);
                            dictionary.Add("@Email_Address", txt_Email_address.Text);
                            dictionary.Add("@Incoming_Mail_Server", txt_Incoming_server.Text);
                            dictionary.Add("@Outgoing_Mail_Server", txt_Outgoing_server.Text);
                            dictionary.Add("@Incoming_Server_Port", txt_IS.Text);
                            dictionary.Add("@Outgoing_Server_Port", txt_OS.Text);
                            dictionary.Add("@User_Name", txt_User_Name.Text);
                            dictionary.Add("@Password", txt_password.Text);
                            dictionary.Add("@Connection_SSL", check_connection_SSL.Checked);
                        };
                        var data = new StringContent(JsonConvert.SerializeObject(dictionary), Encoding.UTF8, "application/json");
                        using (var httpClient = new HttpClient())
                        {
                            var response = await httpClient.PostAsync(Base_Url.Url + "/EmailSettings/Insert", data);

                            if (response.IsSuccessStatusCode)
                            {
                                if (response.StatusCode == HttpStatusCode.OK)
                                {
                                    var result = await response.Content.ReadAsStringAsync();

                                    SplashScreenManager.CloseForm(false);
                                    XtraMessageBox.Show(txt_User_Name.Text + " Created Successfully ");
                                    grid_Email_Address_list();
                                    Clear();
                                }
                            }
                        }
                    }
                    if (btn_save.Text == "Edit")
                    {
                        var dictionary1 = new Dictionary <string, object>();
                        {
                            dictionary1.Add("@Trans", "UPDATE");
                            dictionary1.Add("@ID", emailId);
                            dictionary1.Add("@Your_Name", txt_name.Text);
                            dictionary1.Add("@Email_Address", txt_Email_address.Text);
                            dictionary1.Add("@Incoming_Mail_Server", txt_Incoming_server.Text);
                            dictionary1.Add("@Outgoing_Mail_Server", txt_Outgoing_server.Text);
                            dictionary1.Add("@Connection_SSL", check_connection_SSL.Checked);
                            dictionary1.Add("@Incoming_Server_Port", txt_IS.Text);
                            dictionary1.Add("@Outgoing_Server_Port", txt_OS.Text);
                            dictionary1.Add("@User_Name", txt_User_Name.Text);
                            dictionary1.Add("@Password", txt_password.Text);
                        };

                        var data = new StringContent(JsonConvert.SerializeObject(dictionary1), Encoding.UTF8, "application/json");
                        using (var httpClient = new HttpClient())
                        {
                            var response = await httpClient.PutAsync(Base_Url.Url + "/EmailSettings/Update", data);

                            if (response.IsSuccessStatusCode)
                            {
                                if (response.StatusCode == HttpStatusCode.OK)
                                {
                                    var result = await response.Content.ReadAsStringAsync();

                                    SplashScreenManager.CloseForm(false);
                                    XtraMessageBox.Show(txt_User_Name.Text + " Updated Successfully ");
                                    grid_Email_Address_list();
                                    Clear();
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                SplashScreenManager.CloseForm(false);
                MessageBox.Show(ex.Message.ToString());
            }
            finally
            {
                SplashScreenManager.CloseForm(false);
            }
        }
        private void btnAdd_Click(object sender, EventArgs e)
        {
            SplashScreenManager.ShowForm(this, typeof(WaitForm1), true, true, false);
            try
            {
                if (Convert.ToInt32(lookUpEditType.EditValue) == 0)
                {
                    SplashScreenManager.CloseForm(false);
                    XtraMessageBox.Show("Select Type");
                    lookUpEditType.Focus();
                    return;
                }
                if (string.IsNullOrEmpty(textEditOption.Text.Trim()))
                {
                    SplashScreenManager.CloseForm(false);
                    XtraMessageBox.Show("Enter option");
                    textEditOption.Focus();
                    return;
                }

                if (Convert.ToInt32(lookUpEditType.EditValue) == 1)
                {
                    if (btnAdd.Text == "Add")
                    {
                        var htInsert = new Hashtable();
                        htInsert.Add("@Trans", "INSERT_BREAK_TYPE");
                        htInsert.Add("@Break_Mode", textEditOption.Text);
                        htInsert.Add("@Status", true);
                        htInsert.Add("@User_Id", User_ID);
                        var id = da.ExecuteSPForScalar("Sp_Break_Mode", htInsert);
                        SplashScreenManager.CloseForm(false);
                        if (Convert.ToInt32(id) > 0)
                        {
                            MessageBox.Show("Break Mode Added Successfully");
                            BindBreakTypes();
                        }
                    }
                    if (btnAdd.Text == "Update")
                    {
                        var htInsert = new Hashtable();
                        htInsert.Add("@Trans", "UPDATE_BREAK_TYPE");
                        htInsert.Add("@Break_Mode", textEditOption.Text);
                        htInsert.Add("@Status", true);
                        htInsert.Add("@User_Id", User_ID);
                        htInsert.Add("@Break_Mode_Id", ID);
                        var id = da.ExecuteSPForScalar("Sp_Break_Mode", htInsert);
                        SplashScreenManager.CloseForm(false);
                        XtraMessageBox.Show("Break Mode Updated Successfully");
                        BindBreakTypes();
                    }
                }

                if (Convert.ToInt32(lookUpEditType.EditValue) == 2)
                {
                    if (btnAdd.Text == "Add")
                    {
                        var htInsert = new Hashtable();
                        htInsert.Add("@Trans", "INSERT_IDLE_TYPE");
                        htInsert.Add("@Idle_Type", textEditOption.Text);
                        htInsert.Add("@User_Id", User_ID);
                        htInsert.Add("@Status", true);
                        var id = da.ExecuteSPForScalar("SP_User_Idle_Timings", htInsert);
                        SplashScreenManager.CloseForm(false);
                        if (Convert.ToInt32(id) > 0)
                        {
                            XtraMessageBox.Show("Idle Mode Added Successfully");
                            BindIdleTypes();
                        }
                    }
                    if (btnAdd.Text == "Update")
                    {
                        var htInsert = new Hashtable();
                        htInsert.Add("@Trans", "UPDATE_IDLE_TYPE");
                        htInsert.Add("@Idle_Type", textEditOption.Text);
                        htInsert.Add("@User_Id", User_ID);
                        htInsert.Add("@Idle_Mode_Id", ID);
                        var id = da.ExecuteSPForScalar("SP_User_Idle_Timings", htInsert);
                        SplashScreenManager.CloseForm(false);
                        XtraMessageBox.Show("Idle Mode Updated Successfully");
                        BindIdleTypes();
                    }
                }
                textEditOption.Text = "";
                btnAdd.Text         = "Add";
            }
            catch (Exception ex)
            {
                SplashScreenManager.CloseForm(false);
                MessageBox.Show("Error Occured Please Check With Administrator");
            }
            finally
            {
                SplashScreenManager.CloseForm(false);
            }
        }
Beispiel #25
0
 private void splashscreenBarButtonItem_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     SplashScreenManager.ShowForm(typeof(SplashScreen1));
     //SplashScreenManager.CloseForm( );
 }
Beispiel #26
0
        private void xbbiImport_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            SplashScreenManager.ShowDefaultWaitForm();

            var listCPCOfficialFile =
                xgvOfficialFile.GetSelectedRows()
                .Select(h => xgvOfficialFile.GetRow(h) as CPCOfficialFile)
                .Where(f => f != null)
                .ToList();

            listCPCOfficialFile.ForEach(f =>
            {
                var dtNow = DateTime.Now;
                f.Note    = string.Empty;
                Application.DoEvents();
                try
                {
                    if (f.SendDate == DateTime.MinValue)
                    {
                        f.Note += "官方发文日为空,该官文无法导入";
                        return;
                    }
                    if (string.IsNullOrWhiteSpace(f.CPCOfficialFileConfig.Dealer))
                    {
                        f.Note += "请填写处理人";
                        return;
                    }
                    if (!string.IsNullOrWhiteSpace(f.AppNo) && !f.AppNo.Contains('.'))
                    {
                        f.AppNo = f.AppNo.Insert(f.AppNo.Length - 1, ".");
                    }
                    var dtCase = ExistCase(f.AppNo, f.CPCSerial);
                    if (dtCase.Rows.Count < 1)
                    {
                        f.Note += "未找到案件";
                        return;
                    }
                    if (dtCase.Rows.Count > 1)
                    {
                        f.Note += "找到多个案件";
                        return;
                    }
                    f.CaseSerial = dtCase.Rows[0]["OURNO"].ToString();
                    f.ClientNo   = dtCase.Rows[0]["CLIENT"].ToString();
                    f.ClientName = dtCase.Rows[0]["CLIENT_NAME"].ToString();
                    f.WithDrew   = dtCase.Rows[0]["WITHDREW"].ToString();
                    if (!string.IsNullOrWhiteSpace(dtCase.Rows[0]["DIV_FILINGDATE"].ToString()))
                    {
                        f.DivFilingDate = Convert.ToDateTime(dtCase.Rows[0]["DIV_FILINGDATE"]);
                    }
                    f.Applicants = new Hashtable();
                    for (int i = 1; i <= 5; i++)
                    {
                        if (string.IsNullOrWhiteSpace(dtCase.Rows[0][$"APPL_CODE{i}"].ToString()))
                        {
                            continue;
                        }
                        f.Applicants.Add(dtCase.Rows[0][$"APPL_CODE{i}"].ToString(), !string.IsNullOrWhiteSpace(dtCase.Rows[0][$"APPLICANT{i}"].ToString()) ? dtCase.Rows[0][$"APPLICANT{i}"].ToString() : dtCase.Rows[0][$"APPLICANT_CH{i}"].ToString());
                    }
                    if (ExistFile(f.CaseSerial, f.AppNo, f.FileName, f.SendDate))
                    {
                        f.Note += "通知书已在系统中存在";
                        return;
                    }

                    var filePatent              = _objectSpace.FindObject <FilePatent>(CriteriaOperator.Parse("s_OurNo = ?", f.CaseSerial)) ?? _objectSpace.CreateObject <FilePatent>();
                    filePatent.s_OurNo          = f.CaseSerial;
                    var fileInOfficial          = _objectSpace.FindObject <FileInOfficial>(CriteriaOperator.Parse("s_OfficialNo = ?", f.SendSerial)) ?? _objectSpace.CreateObject <FileInOfficial>();
                    fileInOfficial.s_OfficialNo = f.SendSerial;
                    if (fileInOfficial.FilePatent == null)
                    {
                        fileInOfficial.FilePatent = filePatent;
                    }

                    var strSql = new List <string>();
                    if (!string.IsNullOrWhiteSpace(f.AppNo))
                    {
                        if (!string.IsNullOrWhiteSpace(dtCase.Rows[0]["APPLICATION_NO"].ToString()) &&
                            dtCase.Rows[0]["APPLICATION_NO"].ToString() != f.AppNo)
                        {
                            var dialogResult = XtraMessageBox.Show(
                                $"通知书申请号与PatentCase系统中的申请号不一致,请确认是否进行更新,\r\n系统内申请号:{dtCase.Rows[0]["APPLICATION_NO"].ToString()}\r\n通知书申请号:{f.AppNo}", "冲突提醒", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);

                            if (dialogResult == DialogResult.Cancel)
                            {
                                f.Note += "存在冲突,已跳过";
                                return;
                            }
                            if (dialogResult == DialogResult.Yes)
                            {
                                strSql.Add($"update PATENTCASE set APPLICATION_NO = '{f.AppNo}' where OURNO = '{f.CaseSerial}'");
                            }
                        }
                        else
                        {
                            strSql.Add($"update PATENTCASE set APPLICATION_NO = '{f.AppNo}' where OURNO = '{f.CaseSerial}'");
                        }
                    }
                    if (f.FileCode == "210307" || f.FileCode == "210308")
                    {
                        strSql.Add($"update PATENTCASE set SE_INITIATED = 'Y', SE_DATE = to_date('{f.SendDate:yyyy/MM/dd HH:mm:ss}','yyyy/MM/dd hh24:mi:ss') where OURNO = '{f.CaseSerial}'");
                    }
                    strSql.Add($"insert into RECEIVINGLOG (PID,ISSUEDATE,RECEIVED,SENDERID,SENDER,OURNO,APPNO,CLIENTNO,CONTENT,COPIES,COMMENTS,STATUS,HANDLER) values ('{DateTime.Now:yyyyMMdd_HHmmss_ffffff_0}',to_date('{f.SendDate.Date:yyyy/MM/dd}','yyyy/MM/dd'),to_date('{DateTime.Now.Date:yyyy/MM/dd}','yyyy/MM/dd'),'SIPO','SIPO','{dtCase.Rows[0][0]}','{dtCase.Rows[0][1]}','{dtCase.Rows[0][2]}','other','1','{f.FileName}','P','{f.CPCOfficialFileConfig?.Dealer}')");

                    fileInOfficial.dt_OfficialSendDate = f.SendDate;
                    fileInOfficial.dt_ReceiveDate      = DateTime.Now;
                    fileInOfficial.s_FileCode          = f.FileCode;
                    fileInOfficial.s_FileName          = f.FileName;
                    fileInOfficial.Handler             = _objectSpace.FindObject <SysUser>(CriteriaOperator.Parse("Code = ?", f.CPCOfficialFileConfig?.Dealer));

                    if (f.CPCOfficialFileConfig?.DeadlineFiledType != null)
                    {
                        switch (f.CPCOfficialFileConfig.DeadlineFiledType.Value)
                        {
                        case DeadlineFiledType.Case:
                            if (f.CPCOfficialFileConfig.DeadlineFiled == "GRANTNOTIC_DATE")
                            {
                                strSql.Add($"update PATENTCASE set GRANTNOTIC_DATE=to_date('{f.SendDate.Date:yyyy/MM/dd}','yyyy/MM/dd'),REGFEE_DL=to_date('{f.SendDate.Date.AddDays(15).AddMonths(2):yyyy/MM/dd}','yyyy/MM/dd') where OURNO = '{f.CaseSerial}'");    //更新办登信息
                            }
                            else if (f.CPCOfficialFileConfig.DeadlineFiled == "PRE_EXAM_PASSED")
                            {
                                strSql.Add($"update PATENTCASE set PRE_EXAM_PASSED=to_date('{f.SendDate.Date:yyyy/MM/dd}','yyyy/MM/dd') where OURNO = '{f.CaseSerial}'");    //更新初审合格日
                            }
                            break;

                        case DeadlineFiledType.OA:
                            strSql.Add(
                                $"insert into GENERALALERT (CREATED,TYPEID,OURNO,TRIGERDATE1,DUEDATE,OATYPE,COMMENTS) values (to_date('{DateTime.Now:yyyy/MM/dd HH:mm:ss}','yyyy/MM/dd hh24:mi:ss'),'invoa','{f.CaseSerial}',to_date('{f.SendDate.Date:yyyy/MM/dd}','yyyy/MM/dd'),to_date('{f.SendDate.Date.AddDays(f.CPCOfficialFileConfig.AddDays).AddMonths(f.CPCOfficialFileConfig.AddMonths):yyyy/MM/dd}','yyyy/MM/dd'),'{f.CPCOfficialFileConfig.DeadlineFiled}','{f.CPCOfficialFileConfig.DeadlineFiledNote}')");
                            break;

                        case DeadlineFiledType.Deadline:
                            if (f.FileCode == "200702" && !IsValidCase(f.AppNo))    //如果是专利权终止通知书且案件已届满
                            {
                                break;
                            }
                            strSql.Add(
                                $"insert into GENERALALERT (CREATED,TYPEID,OURNO,DUEDATE,COMMENTS) values (to_date('{DateTime.Now:yyyy/MM/dd HH:mm:ss}','yyyy/MM/dd hh24:mi:ss'),'{f.CPCOfficialFileConfig.DeadlineFiled}','{f.CaseSerial}',to_date('{f.SendDate.Date.AddDays(f.CPCOfficialFileConfig.AddDays).AddMonths(f.CPCOfficialFileConfig.AddMonths):yyyy/MM/dd}','yyyy/MM/dd'),'{f.CPCOfficialFileConfig.DeadlineFiledNote}')");
                            break;

                        case DeadlineFiledType.FCaseDeadline:
                            break;
                        }
                    }

                    SendEmail(f);
                    var array = new ArrayList();
                    array.AddRange(strSql);
                    DbHelperOra.ExecuteSqlTran(array);
                    if (File.Exists(f.BizFilePath))
                    {
                        fileInOfficial.InFileData = _objectSpace.CreateObject <FileData>();
                        fileInOfficial.InFileData.LoadFromStream(Path.GetFileName(f.BizFilePath), File.OpenRead(f.BizFilePath));
                    }
                    fileInOfficial.Save();
                    filePatent.GetCaseInfo();
                    filePatent.Save();
                    _objectSpace.CommitChanges();
                    f.Note = "已导入";
                }
                catch (Exception exception)
                {
                    f.Note += exception.ToString();
                    _objectSpace.Rollback();
                }
                while (dtNow.AddSeconds(1) > DateTime.Now)
                {
                }
            });
            xgvOfficialFile.RefreshData();
            SplashScreenManager.CloseDefaultWaitForm();
        }
Beispiel #27
0
 // 查询
 private void SearchLocal(int pageNum)
 {
     try
     {
         SplashScreenManager.ShowForm(typeof(DevWaitForm));
         //获取总数目
         int dataCount = queryCount();
         //是否显示全部
         if (this.spanNumber.Enabled)
         {
             var dtQuery = queryByPage(pageNum);
             dtQuery.Columns.Add("check", System.Type.GetType("System.Boolean"));
             dtQuery.Columns["check"].ReadOnly = false;
             for (int i = 0; i < dtQuery.Rows.Count; i++)
             {
                 dtQuery.Rows[i]["check"] = false;
             }
             this.gcDataInfo.DataSource = dtQuery;
             this.gvDataInfo.BestFitColumns();
             int pageSize  = Convert.ToInt32(this.spanNumber.Text);
             int pageCount = dataCount / pageSize;
             if (dataCount % pageSize > 0)
             {
                 pageCount++;
             }
             int dataLast;
             if (pageNum == pageCount)
             {
                 dataLast = dataCount;
             }
             else
             {
                 dataLast = pageSize * pageNum;
             }
             this.lblSum.Text  = String.Format("共{0}条", dataCount);
             this.labPage.Text = String.Format("当前显示{0}至{1}条", (pageSize * (pageNum - 1) + 1), dataLast);
             this.txtPage.Text = String.Format("{0}/{1}", pageNum, pageCount);
         }
         else
         {
             var dtQuery = queryAll();
             dtQuery.Columns.Add("check", System.Type.GetType("System.Boolean"));
             dtQuery.Columns["check"].ReadOnly = false;
             for (int i = 0; i < dtQuery.Rows.Count; i++)
             {
                 dtQuery.Rows[i]["check"] = false;
             }
             this.gcDataInfo.DataSource = dtQuery;
             this.gvDataInfo.BestFitColumns();
             this.lblSum.Text  = String.Format("共{0}条", dataCount);
             this.labPage.Text = String.Format("当前显示{0}至{1}条", 1, dataCount);
             this.txtPage.Text = String.Format("{0}/{1}", 1, 1);
         }
         if (dataCount == 0)
         {
             this.labPage.Text = "当前显示0至0条";
             this.txtPage.Text = "0/0";
         }
     }
     catch (Exception ex)
     {
         XtraMessageBox.Show("操作出现错误:" + ex.Message, "异常", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     finally
     {
         SplashScreenManager.CloseForm();
     }
 }
Beispiel #28
0
        public void LoadCPCFiles()
        {
            SplashScreenManager.ShowDefaultWaitForm();
            var listFiles = GetFiles().Rows.Cast <DataRow>().Select(r => new CPCOfficialFile(r)).ToList();

            listFiles.ForEach(f =>
            {
                try
                {
                    if (f.SendDate == DateTime.MinValue)
                    {
                        f.Note += "官方发文日为空,该官文无法导入";
                        return;
                    }
                    if (!string.IsNullOrWhiteSpace(f.AppNo) && !f.AppNo.Contains('.'))
                    {
                        f.AppNo = f.AppNo.Insert(f.AppNo.Length - 1, ".");
                    }
                    var dtCase = ExistCase(f.AppNo, f.CPCSerial);
                    if (dtCase.Rows.Count < 1)
                    {
                        f.Note += "未找到案件";
                        return;
                    }
                    if (dtCase.Rows.Count > 1)
                    {
                        f.Note += "找到多个案件";
                        return;
                    }
                    if (string.IsNullOrWhiteSpace(f.AppNo))
                    {
                        f.AppNo = dtCase.Rows[0][1].ToString();
                    }

                    if (dtCase.Rows[0][3]?.ToString().Trim().ToUpper() == "T")
                    {
                        f.CPCOfficialFileConfig.Dealer = "GS";
                    }
                    f.CaseSerial = dtCase.Rows[0]["OURNO"].ToString();
                    f.ClientNo   = dtCase.Rows[0]["CLIENT"].ToString();
                    f.ClientName = dtCase.Rows[0]["CLIENT_NAME"].ToString();
                    f.WithDrew   = dtCase.Rows[0]["WITHDREW"].ToString();
                    if (!string.IsNullOrWhiteSpace(dtCase.Rows[0]["DIV_FILINGDATE"].ToString()))
                    {
                        f.DivFilingDate = Convert.ToDateTime(dtCase.Rows[0]["DIV_FILINGDATE"]);
                    }
                    if (f.FileCode == "210304" || f.FileCode == "250304")
                    {
                        var listCode = new List <string> {
                            "3667", "3443"
                        };
                        if (listCode.Contains(dtCase.Rows[0]["APPL_CODE1"].ToString()) ||
                            listCode.Contains(dtCase.Rows[0]["APPL_CODE2"].ToString()) ||
                            listCode.Contains(dtCase.Rows[0]["APPL_CODE3"].ToString()) ||
                            listCode.Contains(dtCase.Rows[0]["APPL_CODE4"].ToString()) ||
                            listCode.Contains(dtCase.Rows[0]["APPL_CODE5"].ToString()) ||
                            listCode.Contains(dtCase.Rows[0]["CLIENT"].ToString()))
                        {
                            f.CPCOfficialFileConfig.Dealer = "GK";
                        }
                    }
                    f.CPCOfficialFileConfig.Dealer = HandlerRedistribution(f.CaseSerial, f.CPCOfficialFileConfig.Dealer, f.CPCOfficialFileConfig?.DeadlineFiledType != null);
                    GeneratePDFFile(f);
                }
                catch (Exception exception)
                {
                    f.Note += exception.ToString();
                }
            });
            xgcOfficialFile.DataSource = listFiles;
            xgcOfficialFile.Refresh();
            SplashScreenManager.CloseDefaultWaitForm();
        }
Beispiel #29
0
 public ucChauffeur(SplashScreenManager spl)
 {
     InitializeComponent();
     this.spl = spl;
 }
        public void Execute(object parameter)
        {
            HourGlass.Enable = true;
            TableView view = parameter as TableView;

            if (view == null)
            {
                return;
            }

            MainViewModel mainViewModel = view.DataContext as MainViewModel;

            PrintHelper.Instance.Header = mainViewModel != null
                ? string.Format("Код справочника НСИ: {0}\r\nНаименование справочника НСИ: {1}\r\nКод группы справочников НСИ: {2}\r\nГруппа: {3}",
                                mainViewModel.SelectedNsi.ReferenceId ?? string.Empty,
                                mainViewModel.SelectedNsi.ReferenceName ?? string.Empty,
                                mainViewModel.SelectedNsi.ReferenceGroupId ?? string.Empty,
                                mainViewModel.SelectedNsi.UserGroupId ?? string.Empty)
                : "Справочник";

            SaveFileDialog saveFileDialog = new SaveFileDialog
            {
                DefaultExt       = ".xlsx",
                InitialDirectory = @"C:\",
                Filter           = "excel file (*.xlsx)|*.xlsx"
            };

            if (saveFileDialog.ShowDialog() == true)
            {
                SplashScreenManager.ShowForm(typeof(frmWaitForm), true, true);
                SplashScreenManager.Default.SetWaitFormCaption("Экспортирую...");
                var             pathToSave = saveFileDialog.FileName;
                var             excelApp   = new Excel.Application();
                Excel.Workbook  excelBook  = excelApp.Workbooks.Add(true);
                Excel.Worksheet worksheet  = (Excel.Worksheet)excelBook.ActiveSheet;
                Excel.Range     cells      = excelBook.Worksheets[1].Cells;
                cells.NumberFormat = "@";
                try
                {
                    SplashScreenManager.Default.SetWaitFormDescription("Экспорт Бизнес записей");
                    worksheet.Cells[1, 1] = "Код справочника НСИ";
                    worksheet.Cells[1, 2] = mainViewModel.SelectedNsi.ReferenceId ?? string.Empty;
                    worksheet.Cells[2, 1] = "Наименование справочника НСИ";
                    worksheet.Cells[2, 2] = mainViewModel.SelectedNsi.ReferenceName ?? string.Empty;
                    worksheet.Cells[3, 1] = "Код группы справочников НСИ";
                    worksheet.Cells[3, 2] = mainViewModel.SelectedNsi.ReferenceGroupId ?? string.Empty;
                    worksheet.Cells[4, 1] = "Группа";
                    worksheet.Cells[4, 2] = mainViewModel.SelectedNsi.UserGroupId ?? string.Empty;

                    worksheet.Cells[6, 1] = "RecordId";
                    worksheet.Cells[6, 2] = "RecordName";
                    worksheet.Cells[7, 1] = "Бизнес-ИД записи";
                    worksheet.Cells[7, 2] = "Описание записи справочника";
                    worksheet.Cells[8, 1] = "String";
                    worksheet.Cells[8, 2] = "String";
                    int columnIndex = 1;
                    int RowIndex    = 9;
                    foreach (var record in mainViewModel.Records)
                    {
                        if (!mainViewModel.isExcel)
                        {
                            worksheet.Cells[RowIndex, columnIndex]     = record.ValueDictionary.Values.ElementAtOrDefault(1);
                            worksheet.Cells[RowIndex, columnIndex + 1] = record.ValueDictionary.Values.ElementAtOrDefault(2);
                        }
                        else
                        {
                            worksheet.Cells[RowIndex, columnIndex]     = record.ValueDictionary.Values.ElementAtOrDefault(0);
                            worksheet.Cells[RowIndex, columnIndex + 1] = record.ValueDictionary.Values.ElementAtOrDefault(1);
                        }
                        RowIndex++;
                    }
                    SplashScreenManager.Default.SetWaitFormDescription("Экспорт таблицы");
                    columnIndex = 3;
                    foreach (var MVM in mainViewModel.ReferenceAttributeCollection)
                    {
                        worksheet.Cells[6, columnIndex] = MVM.ReferenceAttributeId;
                        worksheet.Cells[7, columnIndex] = MVM.ReferenceAttributeName;
                        worksheet.Cells[8, columnIndex] = Convertation(MVM.ReferenceAttributeType, MVM.RefReferenceId);
                        RowIndex = 9;
                        foreach (var record in mainViewModel.Records)
                        {
                            foreach (var pair in record.ValueDictionary)
                            {
                                if (pair.Key == MVM.ReferenceAttributeName)
                                {
                                    worksheet.Cells[RowIndex, columnIndex] = pair.Value;
                                    RowIndex++;
                                    break;
                                }
                            }
                        }
                        columnIndex++;
                    }


                    worksheet.Columns.AutoFit();
                    excelBook.SaveAs(pathToSave);
                }
                catch (Exception e)
                {
                    MessageBox.Show("Что-то пошло не так :( " + e);
                }
                finally
                {
                    HourGlass.Enable = false;
                    SplashScreenManager.CloseForm();
                    excelBook.Close(0);
                    excelApp.Quit();
                }
            }
        }
Beispiel #31
0
 private TWaitting()
 {
     ssm = new SplashScreenManager(null, typeof(frmWaitting), true, true);
     ssm.Properties.ClosingDelay = 500;
 }
        private void btnupload_Click(object sender, EventArgs e)
        {
            _objMain.lblStatus.Caption = "Status: Uploading Route";

            bool chk = checkSerialKeyForInstrument(PublicClass.currentInstrument);

            if (PublicClass.currentInstrument == "Impaq-Benstone")
            {
                chk = true;
            }
            if (chk)
            {
                //objupdown = new frmupdownload();
                upload = new frmUpload();
                string text1           = null;
                string CurrentInstName = PublicClass.currentInstrument;
                try
                {
                    if (PublicClass.routename != null)
                    {
                        upload.SelectedRouteName = PublicClass.routename;
                        upload.ShowDialog();
                        IsInstrument = upload.IsInstrumentSelected;
                        if (CurrentInstName == "Kohtect-C911")
                        {
                            try
                            {
                                if (IsInstrument == false)
                                {
                                    PathToUpLoad     = upload.PCPath;
                                    PublicClass.Path = PathToUpLoad;
                                }
                                else
                                {
                                    PathToUpLoad     = upload.textBox1.Text;
                                    PublicClass.Path = PathToUpLoad;
                                }
                                if (upload.IsCancelClicked == false)
                                {
                                    SplashScreenManager.ShowForm(typeof(WaitForm3));
                                    bool            testbool  = false;
                                    string[]        splitpath = PublicClass.Path.Split(new string[] { "\\" }, StringSplitOptions.RemoveEmptyEntries);
                                    DirectoryInfo   obj       = new DirectoryInfo(splitpath[0]);
                                    DirectoryInfo[] folders   = obj.GetDirectories();
                                    if (folders.Length > 0)
                                    {
                                        for (int a = 0; a < folders.Length; a++)
                                        {
                                            if (PublicClass.routename == folders[a].ToString())
                                            {
                                                DialogResult Drslt = MessageBox.Show("Route Name Already Exist." + "\n" + "Do you want to Overrite?", "Route Transfer", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                                                if (Drslt == DialogResult.Yes)
                                                {
                                                    testbool = true;
                                                    DirectoryInfo dir = new DirectoryInfo(PublicClass.Path);
                                                    foreach (FileInfo files in dir.GetFiles())
                                                    {
                                                        files.Delete();
                                                    }
                                                    foreach (DirectoryInfo dirs in dir.GetDirectories())
                                                    {
                                                        dirs.Delete(true);
                                                    }
                                                    Directory.Delete(PublicClass.Path);
                                                }
                                            }
                                            else
                                            {
                                                testbool = true;
                                            }
                                        }
                                    }
                                    else
                                    {
                                        testbool = true;
                                    }
                                    if (testbool == true)
                                    {
                                        clsdb.Main = _objMain;
                                        clsdb.C911uploaddata(PublicClass.routename, PublicClass.Path);
                                        if (clsdb.check == "true")
                                        {
                                            _objMain.lblStatus.Caption = "Status: Uploading Route Successfully In Instrument";
                                            MessageBox.Show("Route Create Sucessfully", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                            _objMain.ribbonControl1.Enabled = true;
                                            this.Enabled = true;
                                            this.Close();
                                        }
                                        else
                                        {
                                            MessageBox.Show("No point In Route", "Message", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                                            _objMain.ribbonControl1.Enabled = true;
                                            this.Enabled = true;
                                            this.Close();
                                        }
                                    }
                                    SplashScreenManager.CloseForm();
                                }
                            }
                            catch { SplashScreenManager.CloseForm(); }
                        }
                        else if (CurrentInstName == "SKF/DI")
                        {
                            try
                            {
                                if (IsInstrument == false)
                                {
                                    PathToUpLoad     = upload.PCPath;
                                    PublicClass.Path = PathToUpLoad;
                                }
                                else
                                {
                                    string path = Path.GetTempPath();
                                    text1        = upload.textBox1.Text;
                                    PathToUpLoad = path + PublicClass.routename + ".dat";
                                }
                                if (upload.IsCancelClicked == false)
                                {
                                    clsdb.Main = _objMain;
                                    _objMain.ribbonControl1.Enabled = false;
                                    this.Enabled = false;
                                    if (text1 == null)
                                    {
                                        clsdb.UsbSelected = true;
                                        clsdb.DIuploaddata(PublicClass.routename);
                                        if (clsdb.check == "true")
                                        {
                                            _objMain.lblStatus.Caption = "Status: Uploading Route Successfully In Instrument";
                                            MessageBox.Show("Route Create Sucessfully", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                            SplashScreenManager.CloseForm();
                                            _objMain.ribbonControl1.Enabled = true;
                                            this.Enabled = true;
                                            this.Close();
                                        }
                                        else
                                        {
                                            MessageBox.Show("No point In Route", "Message", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                                            SplashScreenManager.CloseForm();
                                            _objMain.ribbonControl1.Enabled = true;
                                            this.Enabled = true;
                                            this.Close();
                                        }
                                    }
                                    else
                                    {
                                        clsdb.DIuploaddata(PublicClass.routename);
                                        if (clsdb.check == "true")
                                        {
                                            _objMain.lblStatus.Caption = "Status: Uploading Route Successfully In Instrument";
                                            MessageBox.Show("Route Create Sucessfully In Instrument", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                            //SplashScreenManager.CloseForm();
                                            _objMain.ribbonControl1.Enabled = true;
                                            this.Enabled = true;
                                            this.Close();
                                        }
                                        else
                                        {
                                            MessageBox.Show("No point In Route", "Message", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                                            //SplashScreenManager.CloseForm();
                                            _objMain.ribbonControl1.Enabled = true;
                                            this.Enabled = true;
                                            this.Close();
                                        }
                                    }
                                }
                                else
                                {
                                    _objMain.lblStatus.Caption = "Status: Error";
                                    MessageBox.Show("Route not Created", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                    this.Enabled = true;
                                    _objMain.ribbonControl1.Enabled = true;
                                    this.Close();
                                }
                                SplashScreenManager.CloseForm();
                            }
                            catch { SplashScreenManager.CloseForm(); }
                        }
                        else
                        {
                            if (IsInstrument == false)
                            {
                                PathToUpLoad = upload.PCPath;
                            }
                            else
                            {
                                if (m_objRAPI.DevicePresent)
                                {
                                    m_objRAPI.Connect();
                                    string path = Path.GetTempPath();
                                    text1        = upload.textBox1.Text;
                                    PathToUpLoad = path + PublicClass.routename + ".sdf";
                                }
                                else
                                {
                                    SplashScreenManager.CloseForm();
                                    MessageBox.Show(this, "Device Not Connected....", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                    return;
                                }
                            }
                            if (upload.IsCancelClicked == false)
                            {
                                _objMain.ribbonControl1.Enabled = false;
                                this.Enabled = false;
                                bool sStatus = CheckDemoSdf();
                                if (sStatus == true)
                                {
                                    if (text1 != null)
                                    {
                                        getRouteInformation(PublicClass.routename);
                                        UploadData _objupload = new UploadData();
                                        _objupload.Main = _objMain;
                                        _objupload.UploadValuesToBenstone();
                                        _objMain.lblStatus.Caption = "Status: Uploading Route";
                                        StartTheThread();
                                        _objMain.lblStatus.Caption = "Status: Uploading Route Successfully In Instrument";
                                        MessageBox.Show("Route Create Sucessfully In Instrument", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                        _objMain.ribbonControl1.Enabled = true;
                                        this.Enabled = true;
                                    }
                                    else
                                    {
                                        getRouteInformation(PublicClass.routename);
                                        UploadData _objupload = new UploadData();
                                        _objupload.Main = _objMain;
                                        _objupload.UploadValuesToBenstone();
                                        _objMain.lblStatus.Caption = "Status: Uploading Route Successfully";
                                        MessageBox.Show("Route Create Sucessfully", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                        _objMain.ribbonControl1.Enabled = true;
                                        this.Enabled = true;
                                    }
                                }
                                else
                                {
                                    _objMain.lblStatus.Caption = "Status: Error";
                                    MessageBox.Show("Route not Created", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                    this.Enabled = true;
                                    _objMain.ribbonControl1.Enabled = true;
                                    this.Close();
                                }
                            }
                            if (PublicClass.routename != null)
                            {
                                this.Close();
                            }
                            SplashScreenManager.CloseForm();
                        }
                    }
                }
                catch { SplashScreenManager.CloseForm(); }
            }
            else
            {
                //MessageBox.Show("please connect correct instrumnet !","Error", MessageBoxIcon.Error,MessageBoxButtons.OK);
            }
        }
Beispiel #33
0
        private void MostrarFiltro(Boolean blnSalir)
        {
            WINformulacion.Movimiento.Frm_ActualizaFormulacion_Personal_Filtro frm = new WINformulacion.Movimiento.Frm_ActualizaFormulacion_Personal_Filtro();
            frm.ShowMe();
            if (frm.blnProcesaExcel == true)
            {
                SplashScreenManager.ShowForm(this, typeof(WaitForm1), true, true, false);
                SplashScreenManager.Default.SetWaitFormDescription("Recopilando informaciòn...");

                //Habilita Opciones

                this.Btn_BuscaClasificador.Enabled        = true;
                this.Btn_DistribuyeLineaFormulada.Enabled = true;
                this.Btn_Guardar.Enabled  = true;
                this.Btn_Imprimir.Enabled = true;

                //Traer Dato de la tabla



                Model.Formulacion_Cabecera   MFC = new Model.Formulacion_Cabecera();
                Service.Formulacion_Cabecera SFC = new Service.Formulacion_Cabecera();

                if (MyStuff.UsaWCF == true)
                {
                    MFC = objWCF.Recupera_FormulacionCabecera(MyStuff.AñoProceso);
                }
                else
                {
                    MFC = SFC.Recupera_FormulacionCabecera(MyStuff.AñoProceso);
                }


                strAñoProceso         = MFC.CañoProceso;
                strVersion            = MFC.Cversion;
                strCodTipoFormulacion = "05";
                strCodCentroCosto     = frm.strCodCentroCosto;

                //-- Recuperar Datos



                Service.DataGeneral SDG = new Service.DataGeneral();
                Service.CentroCosto SCC = new Service.CentroCosto();

                if (MyStuff.UsaWCF == true)
                {
                    DS_CentroCosto = objWCF.Ayuda_CentroCosto_Todos();

                    DS_Concepto = objWCF.Ayuda_Concepto();
                }
                else
                {
                    DS_CentroCosto = SCC.Ayuda_CentroCosto_Todos();

                    DS_Concepto = SDG.Ayuda_Concepto();
                }

                Service.Formulacion_Detalle_Personal SFDP = new Service.Formulacion_Detalle_Personal();
                if (MyStuff.UsaWCF == true)
                {
                    DS_Formulacion = objWCF.Lista_FormulacionDetalle_Personal("000000", strCodCentroCosto, strCodTipoFormulacion);
                }
                else
                {
                    DS_Formulacion = SFDP.Lista_FormulacionDetalle_Personal("000000", strCodCentroCosto, strCodTipoFormulacion);
                }

                workbook = spreadsheetControl.Document;
                string sRutaInterna = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"Excel\Formulacion_Personal.xlsx");
                //workbook.LoadDocument(@"Excel\Formulacion_Proyecto_Inversion.xlsx", DocumentFormat.Xlsx);
                workbook.LoadDocument(sRutaInterna, DocumentFormat.Xlsx);

                Worksheet worksheet_HojaTrabajo = workbook.Worksheets[0];

                worksheet_HojaTrabajo.Cells[3, 2].Value = frm.strNomProyecto;
                worksheet_HojaTrabajo.Cells[4, 2].Value = frm.strNomCentroCosto;



                worksheet_HojaTrabajo.Cells[2, 26].Value = MFC.CañoProceso;
                worksheet_HojaTrabajo.Cells[3, 26].Value = MFC.Cversion;
                worksheet_HojaTrabajo.Cells[4, 26].Value = "Gastos de Personal";

                DV_Excel = DS_Formulacion.Tables[0].DefaultView;
                worksheet_HojaTrabajo.DataBindings.BindToDataSource(DV_Excel, 9, 1);

                //int intLinea = 9;
                //foreach (DataRow oRow1 in DS_Formulacion.Tables[0].Rows)
                //{
                //    string Rango = traeRangoCelda(1, intLinea + 1, 1, intLinea + 1);
                //    workbook = spreadsheetControl.Document;
                //    Range range = worksheet_HojaTrabajo.Range[Rango];
                //    Formatting rangeFormatting = range.BeginUpdateFormatting();
                //    rangeFormatting.Fill.BackgroundColor = Color.Green;
                //    range.EndUpdateFormatting(rangeFormatting);

                //    worksheet_HojaTrabajo.Cells[intLinea, 1].Value = Convert.ToString(oRow1["vNomTipoInserccion"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 2].Value = Convert.ToString(oRow1["vNomCentroCosto"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 3].Value = Convert.ToString(oRow1["vNomClaseGasto"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 4].Value = Convert.ToString(oRow1["cCodClasificador"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 5].Value = Convert.ToString(oRow1["vNomClasificador"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 6].Value = Convert.ToString(oRow1["cCodPosPre"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 7].Value = Convert.ToString(oRow1["vNomPosPre"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 8].Value = Convert.ToString(oRow1["vNomFuenteFinanciamiento"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 9].Value = Convert.ToString(oRow1["vNomConcepto"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 10].Value = Convert.ToString(oRow1["Orden"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 11].Value = Convert.ToString(oRow1["tDescripcionGasto"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 12].Value = Convert.ToDouble(oRow1["fValorAnterior"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 13].Value = Convert.ToDouble(oRow1["fValorRestoActual"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 14].Value = Convert.ToDouble(oRow1["fMes_01"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 15].Value = Convert.ToDouble(oRow1["fMes_02"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 16].Value = Convert.ToDouble(oRow1["fMes_03"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 17].Value = Convert.ToDouble(oRow1["fMes_04"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 18].Value = Convert.ToDouble(oRow1["fMes_05"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 19].Value = Convert.ToDouble(oRow1["fMes_06"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 20].Value = Convert.ToDouble(oRow1["fMes_07"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 21].Value = Convert.ToDouble(oRow1["fMes_08"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 22].Value = Convert.ToDouble(oRow1["fMes_09"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 23].Value = Convert.ToDouble(oRow1["fMes_10"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 24].Value = Convert.ToDouble(oRow1["fMes_11"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 25].Value = Convert.ToDouble(oRow1["fMes_12"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 26].Value = Convert.ToDouble(oRow1["fValorFormulacion"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 27].Value = Convert.ToDouble(oRow1["fValorFormulacionUno"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 28].Value = Convert.ToDouble(oRow1["fValorFormulacionDos"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 29].Value = Convert.ToDouble(oRow1["Distribucion"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 30].Value = Convert.ToInt32(oRow1["iidFormulacion_Detalle_Personal"]);

                //    //worksheet_HojaTrabajo.Cells[intLinea, 1000].Value = Convert.ToString(oRow1["vNomFuenteFinanciamiento"]);

                //    this.FormatoCeldas(intLinea);
                //    intLinea = intLinea + 1;
                //    //}
                //}

                this.ValidarColumnas();

                SplashScreenManager.CloseForm();
            }
            else
            {
                //if (blnSalir == true)
                //this.Close();
            }
        }
 private void btnRefresh_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     SplashScreenManager.ShowForm(typeof(WaitForm1));
     LoadCategory();
     SplashScreenManager.CloseForm();
 }
Beispiel #35
0
 IOverlaySplashScreenHandle ShowProgressPanel(OverlayWindowOptions option, System.Windows.Forms.Control strlenh)
 {
     return(SplashScreenManager.ShowOverlayForm(strlenh, option));
 }
 //TODO Comment and Function
 private void barBtnFoxnews_ItemClick(object sender, ItemClickEventArgs e)
 {
     var splashScreenManagerCheckConnect = new SplashScreenManager(this
        , typeof(WaitFormPlease), true, true);
     if (SEDInternetConnection.CheckConnectTimeOutWait(splashScreenManagerCheckConnect) == false) return;
     var splashScreenManager = SEDFuncCall.ShowWaitForm(this, null, null);
     var frm = CheckFormExists(typeof(PE03FrmParseFoxnews));
     if (frm != null)
     {
         frm.Activate();
     }
     else
     {
         var f = new PE03FrmParseFoxnews { MdiParent = this };
         f.Show();
     }
     splashScreenManager.CloseWaitForm();
 }