示例#1
0
文件: WFSform.cs 项目: qlik18/Parser
        //public bool _auto
        //{
        //    get { return _auto; }
        //    set { _auto = value; }
        //}

        public WFSform(MainForm form)
        {
            InitializeComponent();
            this.parent = form;

            //Login kk = new Login();
            //Login formLogin = new Login(gujaczWFS, ref helLIU, ref jiraUser);
            uzupelnijFormularz();
            //ServiceLocator locator = ServiceLocator.Instance;
            gujacz2 = Utility.ServiceLocator.Instance.Retrieve <IParserEngineWFS>();

            if (onCallZaznacz())
            {
                cb_CzyOncall.BackColor = Color.Tomato;
                cb_CzyOncall.Checked   = true;
            }

            Dictionary <int, string> sys = gujacz2.getBillingComponents(-1);
            Dictionary <int, string> kat = gujacz2.getBillingComponents(0);
        }
示例#2
0
文件: Workload.cs 项目: qlik18/Parser
 public Workload(IParserEngineWFS gujacz)
     : this()
 {
     this.gujacz = gujacz;
     CheckIfUserLoggingRunning();
 }
示例#3
0
文件: WFSform.cs 项目: qlik18/Parser
        /// <summary>
        /// Konstuktor wykorzystywany przy masowym dodawaniu spraw do WFSa Ten właściwy
        /// </summary>
        /// <param name="zgloszenie"></param>
        public WFSform(BillingIssueDto zgloszenie, bool trans = false, bool newIssue = false, bool auto = false)//: base()
        {
            this._newIssue = newIssue;
            this.issue     = (BillingIssueDtoHelios)zgloszenie;
            mass           = true;

            InitializeComponent();

            //Login formLogin = new Login(gujaczWFS, ref helLIU, ref jiraUser);
            uzupelnijFormularz((BillingIssueDtoHelios)zgloszenie, trans);
            gujacz2 = Utility.ServiceLocator.Instance.Retrieve <IParserEngineWFS>();

            if (onCallZaznacz())
            {
                cb_CzyOncall.BackColor = Color.Tomato;
                cb_CzyOncall.Checked   = true;
            }

            //if (String.IsNullOrWhiteSpace(((BillingIssueDtoHelios)zgloszenie).issueHelios.assigned_to))
            //    MessageBox.Show("Pamiętaj o przydzieleniu zgłoszenia w JIRA!");

            // PIERWOTNIE: "CRM", "CP", "INFOLINIA", "NDTH", "SR", "SOS", "ZCC"
            // "NDTH", "SR", "CP", "CRM", "INFOLINIA", "ZCC", "SOS"
            //stere: string[] kate = new string[16] { "NDTH", "SR", "CP", "CRM", "INFOLINIA", "WIND", "ZCC", "SOS", "SBL", "PLK", "BILL", "KDTH", "NDTHW", "KKK", "ZU", "PRIO" };
            //string[] kate = new string[8] { "CRM", "INFOLINIA", "WIND", "ZCC", "BILL", "KKK", "PRIO", "ZU" };


            Dictionary <int, string> kat = gujacz2.getBillingComponents(0);

            Dictionary <int, string> sys = new Dictionary <int, string>();

            sys = gujacz2.getBillingComponents(kat.Keys.ToArray()[0]); //Dictionary<int, string>

            Dictionary <int, string> rodz = new Dictionary <int, string>();

            rodz = gujacz2.getBillingComponents(sys.Keys.ToArray()[0]); //Dictionary<int, string>

            Dictionary <int, string> typy = new Dictionary <int, string>();

            typy = gujacz2.getBillingComponents(rodz.Keys.ToArray()[0]);

            foreach (KeyValuePair <int, string> s in sys)
            {
                tbSystem.Items.Add(new Entities.BillingDthLBItem()
                {
                    Text = s.Value, Value = s.Key
                });
            }
            foreach (KeyValuePair <int, string> s in kat)
            {
                tbKategoria.Items.Add(new Entities.BillingDthLBItem()
                {
                    Text = s.Value, Value = s.Key
                });
            }
            foreach (KeyValuePair <int, string> s in rodz)
            {
                tbRodzaj.Items.Add(new Entities.BillingDthLBItem()
                {
                    Text = s.Value, Value = s.Key
                });
            }
            foreach (KeyValuePair <int, string> s in typy)
            {
                tbTyp.Items.Add(new Entities.BillingDthLBItem()
                {
                    Text = s.Value, Value = s.Key
                });
            }


            if (!_newIssue)
            {
                /*
                 *  Mapowanie
                 *  Kategoryzacji
                 */
                List <List <string> > MapObszar = gujacz2.ExecuteStoredProcedure("spMapujWartosc", new string[] { issue.issueHelios.projekt, "Obsługa kodu projektu jako nazwy" }, DatabaseName.SupportCP);


                for (int index = 0; index < tbKategoria.Items.Count; index++)
                {
                    if (tbKategoria.Items[index].ToString() == issue.issueHelios.projekt)
                    {
                        tbKategoria.SelectedIndex = index;
                        break;
                    }
                }

                if (tbKategoria.SelectedIndex == -1 && MapObszar.Count > 0)
                {
                    for (int index = 0; index < tbKategoria.Items.Count; index++)
                    {
                        if (tbKategoria.Items[index].ToString() == MapObszar[0][0])
                        {
                            tbKategoria.SelectedIndex = index;
                            break;
                        }
                    }
                }

                //if (tbKategoria.SelectedIndex == -1)
                //{
                //    for (int index = 0; index < tbSystem.Items.Count; index++)
                //    {
                //        if (tbKategoria.Items[index].ToString() == issue.issueHelios.rodzaj_zgloszenia)
                //        {
                //            tbKategoria.SelectedIndex = index;
                //            break;
                //        }

                //    }
                //}

                if (tbKategoria.SelectedIndex == -1)
                {
                    tbKategoria.SelectedIndex = 0;
                }

                string rodzaj, typ;
                rodzaj = typ = string.Empty;


                /**/

                for (int index = 0; index < tbKategoria.Items.Count; index++)
                {
                    if (tbSystem.Items[index].ToString() == issue.issueHelios.rodzaj_zgloszenia)
                    {
                        tbSystem.SelectedIndex = index;
                        break;
                    }
                }


                if (tbKategoria.SelectedIndex == -1)
                {
                    tbKategoria.SelectedIndex = 0;
                }
                /**/
                if (issue.issueHelios.rodzaj_bledu != null)
                {
                    rodzaj = issue.issueHelios.rodzaj_bledu.TrimEnd();

                    for (int i = 0; i < tbRodzaj.Items.Count; i++)
                    {
                        try
                        {
                            //if (issue.issueHelios.projekt == "ZCC")
                            //{
                            //    string[] rodzajTyp = issue.issueHelios.rodzaj_bledu.Split('-');
                            //    rodzaj = rodzajTyp[0].TrimEnd();
                            //    if (rodzajTyp.Length > 1)
                            //        typ = rodzajTyp[1].TrimStart();
                            //}
                            //else


                            if (((BillingDthLBItem)tbRodzaj.Items[i]).Text.Equals(rodzaj, StringComparison.CurrentCultureIgnoreCase))
                            {
                                tbRodzaj.SelectedIndex = i;
                                break;
                            }
                        }
                        catch (Exception e) { }
                    }
                }

                if (tbRodzaj.SelectedIndex == 0 && issue.issueHelios.rodzaj_bledu == null)
                {
                    for (int i = 0; i < tbRodzaj.Items.Count; i++)
                    {
                        if (tbRodzaj.Items[i].ToString().Equals("inne", StringComparison.CurrentCultureIgnoreCase))
                        {
                            tbRodzaj.SelectedIndex = i;
                        }
                    }
                    if (tbRodzaj.SelectedIndex == 0)
                    {
                        for (int i = 0; i < tbRodzaj.Items.Count; i++)
                        {
                            if (tbRodzaj.Items[i].ToString().Equals("brak", StringComparison.CurrentCultureIgnoreCase))
                            {
                                tbRodzaj.SelectedIndex = i;
                            }
                        }
                    }
                }

                typy = gujacz2.getBillingComponents(rodz.Keys.ToArray()[0]);
                if (typ != string.Empty)
                {
                    for (int i = 0; i < tbTyp.Items.Count; i++)
                    {
                        try
                        {
                            if (((BillingDthLBItem)tbTyp.Items[i]).Text.Equals(typ, StringComparison.CurrentCultureIgnoreCase))
                            {
                                tbTyp.SelectedIndex = i;
                                break;
                            }
                        }
                        catch (Exception ex) { }
                    }
                }
            }

            List <List <string> > priorytet = gujacz2.ExecuteStoredProcedure("Billing_GetListOfPriorities", new string[] { }, DatabaseName.SupportADDONS);

            for (int i = 0; i < priorytet.Count; i++)
            {
                tbPriorytet.Items.Add(new BillingDthLBItem()
                {
                    Text = priorytet[i][1], Value = Convert.ToInt32(priorytet[i][0])
                });
            }

            if (!_newIssue)
            {
                for (int i = 0; i < priorytet.Count; i++)
                {
                    string s = priorytet[i][1];
                    if (priorytet[i][0].Equals(issue.issueHelios.severity, StringComparison.InvariantCultureIgnoreCase) ||
                        priorytet[i][1].Equals(issue.issueHelios.severity, StringComparison.InvariantCultureIgnoreCase))
                    {
                        tbPriorytet.SelectedIndex = i;
                        break;
                    }
                }
            }

            if (newIssue)
            {
                User u = gujacz2.getUser();
                tbFirstName.Text         = u.name;
                tbLastName.Text          = u.surname;
                tbEmail.Text             = u.login + "@billennium.pl";
                tbDataOstKoment.Text     = DateTime.Now.ToString();
                tbDataUtworzeniaZgl.Text = tbDataWystBledu.Text = DateTime.Now.ToString();
                tbIdKontraktu.Text       = "-1";
                tbIdZamowienia.Text      = "-1";
                tbNo.Enabled             = false;
                for (int i = 0; i < tbSystem.Items.Count; i++)
                {
                    if (tbSystem.Items[i].ToString().Equals("wewnętrzne", StringComparison.CurrentCultureIgnoreCase))
                    {
                        tbSystem.SelectedIndex = i;
                    }
                }
                for (int i = 0; i < tbKategoria.Items.Count; i++)
                {
                    if (tbKategoria.Items[i].ToString().Equals("zgłoszenie wewnętrzne", StringComparison.CurrentCultureIgnoreCase))
                    {
                        tbKategoria.SelectedIndex = i;
                    }
                }
                for (int i = 0; i < tbPriorytet.Items.Count; i++)
                {
                    if (tbPriorytet.Items[i].ToString().Equals("sredni", StringComparison.CurrentCultureIgnoreCase))
                    {
                        tbPriorytet.SelectedIndex = i;
                    }
                }
            }
            if (auto && !cb_CzyOncall.Checked)
            {
                Logging.Logger.Instance.LogInformation(string.Format("Zgłoszenie {0} dodano automatycznie o godzinie {1}!\n", zgloszenie.Idnumber, DateTime.Now));
                addButton_Click(this, null);
            }
        }
示例#4
0
文件: WFSform.cs 项目: qlik18/Parser
        /// <summary>
        /// Konstuktor wykorzystywany przy masowym dodawaniu spraw do WFSa
        /// </summary>
        /// <param name="zgloszenie"></param>
        public WFSform(BillingIssueDto zgloszenie, int idSystemu, int idKategorii, int idRodzaju, int idTypu, string idKontraktu)//: base()
        {
            this.issue = (BillingIssueDtoHelios)zgloszenie;
            mass       = true;
            InitializeComponent();


            //Login formLogin = new Login(gujaczWFS, ref helLIU, ref jiraUser);
            bool trans = false;

            if (issue.issueHelios.number != issue.issueHelios.oryginalneId)
            {
                trans = true;
            }

            uzupelnijFormularz((BillingIssueDtoHelios)zgloszenie, trans);
            gujacz2 = Utility.ServiceLocator.Instance.Retrieve <IParserEngineWFS>();

            if (onCallZaznacz())
            {
                cb_CzyOncall.BackColor = Color.Tomato;
                cb_CzyOncall.Checked   = true;
            }

            Dictionary <int, string> sys  = gujacz2.getBillingComponents(-1);
            Dictionary <int, string> kat  = gujacz2.getBillingComponents(0);
            Dictionary <int, string> rodz = gujacz2.getBillingComponents(kat.Keys.ToArray()[0]);
            Dictionary <int, string> typy = gujacz2.getBillingComponents(rodz.Keys.ToArray()[0]);

            foreach (KeyValuePair <int, string> s in sys)
            {
                tbSystem.Items.Add(new Entities.BillingDthLBItem()
                {
                    Text = s.Value, Value = s.Key
                });
            }
            foreach (KeyValuePair <int, string> s in kat)
            {
                tbKategoria.Items.Add(new Entities.BillingDthLBItem()
                {
                    Text = s.Value, Value = s.Key
                });
            }
            foreach (KeyValuePair <int, string> s in rodz)
            {
                tbRodzaj.Items.Add(new Entities.BillingDthLBItem()
                {
                    Text = s.Value, Value = s.Key
                });
            }
            foreach (KeyValuePair <int, string> s in typy)
            {
                tbTyp.Items.Add(new Entities.BillingDthLBItem()
                {
                    Text = s.Value, Value = s.Key
                });
            }

            for (int i = 0; i < tbSystem.Items.Count; i++)
            {
                if (((BillingDthLBItem)tbSystem.Items[i]).Value == idSystemu)
                {
                    tbSystem.SelectedIndex = i;
                    break;
                }
            }
            for (int i = 0; i < tbKategoria.Items.Count; i++)
            {
                if (((BillingDthLBItem)tbKategoria.Items[i]).Value == idKategorii)
                {
                    tbKategoria.SelectedIndex = i;
                    break;
                }
            }
            for (int i = 0; i < tbRodzaj.Items.Count; i++)
            {
                if (((BillingDthLBItem)tbRodzaj.Items[i]).Value == idRodzaju)
                {
                    tbRodzaj.SelectedIndex = i;
                    break;
                }
            }
            for (int i = 0; i < tbTyp.Items.Count; i++)
            {
                if (((BillingDthLBItem)tbTyp.Items[i]).Value == idTypu)
                {
                    tbTyp.SelectedIndex = i;
                    break;
                }
            }
        }
示例#5
0
 public UstawieniaProcesow(IParserEngineWFS gujacz)
     : this()
 {
     this.gujacz = gujacz;
 }