Ejemplo n.º 1
0
        private void btnCreateFolder_Click(object sender, EventArgs e)
        {
            try
            {
                string[] Pfad;
                //int lastLevel = 0;
                //int Level = 0;
                DomeaHelper domea = new DomeaHelper(sysSession);
                domea.startWorkGroupSession(newSelectedWorkGroupID);

                foreach (DataGridViewRow row in dgvCreateFolder.Rows)
                {
                    Pfad = row.Cells["PFAD_GESAMT"].Value.ToString().Split('\\');
                    Console.WriteLine(oldSelectedWorkGroupID + " --> " + row.Cells["PFAD_GESAMT"].Value.ToString() + " --> " + newSelectedWorkGroupID);

                    domea.createFolder(Pfad); //, row.Cells["PFAD_GESAMT"].Value.ToString(), oldSelectedWorkGroupID);

                    #region Version 1
                    //Level = Convert.ToInt32(row.Cells["FOLDER_LEVEL"].Value.ToString());
                    //if (Level == 1)
                    //{
                    //    domea.SubFolder = domea.createFolderInWorkList(newSelectedWorkGroupID, Pfad[Pfad.Length - 1]);
                    //}
                    //else
                    //{
                    //    if (Level == lastLevel)
                    //    {
                    //        domea.createFolderInFolder(domea.SubFolder, Pfad[Pfad.Length - 1]);
                    //    }
                    //    else
                    //    {
                    //        domea.SubFolder = domea.createFolderInFolder(domea.SubFolder, Pfad[Pfad.Length - 1]);
                    //    }
                    //}

                    //lastLevel = Level;
                    #endregion
                }
                domea.stopWorkGroupSession();
            }
            catch (Exception ex)
            {
                Console.WriteLine("btnCreateFolder_Click(): " + ex.Message);
            }
        }
Ejemplo n.º 2
0
        private void bwMoveProcessInstance_DoWork(object sender, DoWorkEventArgs e)
        {
            int    maxRows          = dgvBIG_FOLDER_RESTORE_TMP.Rows.Count;
            int    counter          = 0;
            int    percent          = 0;
            int    IGZ              = 0;
            int    workGroupID      = 0;
            int    folderID         = 0;
            string GZ               = "";
            string DESTINATION_NAME = "";
            string PFAD_NEU         = "";
            string message          = "";

            logger.WriteFile(string.Format("IGZ;GZ;DESTINATION_ID;DESTINATION_NAME;PFAD_NEU"));
            DomeaHelper domea = new DomeaHelper(sysSession);

            foreach (DataGridViewRow row in dgvBIG_FOLDER_RESTORE_TMP.Rows)
            {
                if (row.Cells["STATUS"].Value.ToString().Trim() == "")
                {
                    GZ = "";
                    DESTINATION_NAME = "";
                    PFAD_NEU         = "";
                    IGZ         = 0;
                    workGroupID = 0;
                    folderID    = 0;
                    message     = "";
                    IGZ         = Convert.ToInt32(row.Cells["IGZ"].Value);

                    try
                    {
                        //workGroupID = Convert.ToInt32(row.Cells["WGNR"].Value); // => alte WorkGroup
                        workGroupID      = Convert.ToInt32(row.Cells["DESTINATION_ID"].Value); // => neue WorkGroup
                        folderID         = Convert.ToInt32(row.Cells["FOLDERNR"].Value);
                        GZ               = row.Cells["GZ"].Value.ToString();
                        DESTINATION_NAME = row.Cells["DESTINATION_NAME"].Value.ToString();
                        PFAD_NEU         = row.Cells["PFAD_NEU"].Value.ToString();

                        //move WorkItem
                        if (domea.moveWorkItem(IGZ, workGroupID, folderID, out message))
                        {
                            row.Cells["STATUS"].Value = "finished";
                            logger.WriteFile(string.Format("{0};{1};{2};{3};{4}", IGZ, GZ, workGroupID, DESTINATION_NAME, PFAD_NEU));
                            InfoLogger.WriteFile(string.Format("Akt {0} mit der IGZ {1} nach {2} verschoben...", GZ, IGZ, PFAD_NEU));
                        }
                        else
                        {
                            ErrorLogger.WriteFile(string.Format("{0};{1};{2};{3};{4}", IGZ, GZ, workGroupID, DESTINATION_NAME, PFAD_NEU));
                            if (message != "")
                            {
                                ErrorLogger.WriteFile(GZ + ": " + message);
                                Console.WriteLine(GZ + ": " + message);
                                row.Cells["STATUS"].Value = message;
                            }
                            else
                            {
                                row.Cells["STATUS"].Value = "Warning";
                            }
                        }
                        counter = counter + 1;
                        percent = (counter * 100) / maxRows;
                        bwMoveProcessInstance.ReportProgress(percent, row);
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine("IGZ: " + IGZ + " - " + ex.Message);
                    }
                }
            }
            e.Result = counter;
        }