Example #1
0
        public string get_comp(int comp, string client,
                               int c_serv
                               )
        {
            string cur = client;

            cli_p c    = clis[cur];
            bool  edit = !true;

            if (c.group_ == 1
                )
            {
                edit = true;
            }

            component_p comp_ = components_p.get(comp
                                                 );

            string type = type_s.get(comp_.comp_type
                                     ).type;

            string r = "";

            r += get_record("Name", comp_.name, "edit_comp_name(" + comp +
                            ");", "edit_comp_name", edit
                            );

            r += get_record("Type", type, "edit_comp_type(" + comp +
                            ");", "edit_comp_type", edit
                            );
            string edit_img = "";

            if (edit
                )
            {
                edit_img = Properties.Resources.ht_edit_img_choose.Replace("//comp//", comp.ToString()
                                                                           );
            }
            string resu = Properties.Resources.ht_edit_comp.Replace("//content//", r
                                                                    )
                          .Replace("//src//", imgs.byte_to_base64(comp_.img, comp_.format
                                                                  )
                                   )
                          .Replace("//edit img//", edit_img
                                   );

            return(resu);
        }
Example #2
0
        public string logon2(string cli, string pcode
                             )
        {
            cli_p c = clis_p.get(cli, pcode
                                 );

            if (c == null
                )
            {
                string r = "Either the logon or passocde is not correct";

                return("4" + s240 + r);
            }
            string u = DateTime.Now.Ticks.ToString();

            clis.Add(u, c
                     );

            return("0" + s240 + u);
        }
Example #3
0
        public string get_sub_comps(
            int comp, int pgt_cur, string client, string search,
            int c_serv
            )
        {
            string cur = client;
            cli_p  c_  = clis[cur];
            List <component_p
                  > comps = null;
            string  pgt   = "";
            string  mx    = "";

            if (comp == 0
                )
            {
                search = search.Trim();
                {
                    search = search.ToUpper();
                    if (!search_cur.ContainsKey(client
                                                )
                        )
                    {
                        search_cur.Add(client, search
                                       );
                        if (comps_pgt.ContainsKey(client
                                                  )
                            )
                        {
                            comps_pgt.Remove(client);
                        }
                    }
                    else
                    {
                        if (search == search_cur[client]
                            )
                        {
                        }
                        else
                        {
                            search_cur[client] =
                                search;
                            if (comps_pgt.ContainsKey(client
                                                      )
                                )
                            {
                                comps_pgt.Remove(client);
                            }
                        }
                    }
                }

                if (!comps_pgt.ContainsKey(client
                                           )
                    )
                {
                    List <component_p
                          >
                    compss = null;

                    if (search == ""
                        )
                    {
                        compss =
                            components_p.get_sub_comps(0);
                    }
                    else
                    {
                        compss =
                            components_p.search(search);
                    }

                    int i     = 17;
                    int cur_i = 0;
                    comps_pgt.Add(client, new SortedList <int, List <component_p
                                                                     >
                                                          >()
                                  );
                    foreach (component_p c in compss
                             )
                    {
                        i++;

                        if (17 < i
                            )
                        {
                            i = 1;

                            cur_i++;

                            comps_pgt[client].Add(cur_i, new List <component_p
                                                                   >()
                                                  );
                        }
                        comps_pgt[client][cur_i].Add(c);
                    }
                    pgt = Properties.Resources.ht_pgt;
                }

                if (comps_pgt[client].Count == 0
                    )
                {
                    comps_pgt[client].Add(1, new List <business.component_p
                                                       >()
                                          );
                }
                mx = comps_pgt[client]
                     .Count.ToString();
                comps = comps_pgt[client][pgt_cur];
            }
            else
            {
                comps = components_p.get_sub_comps(comp);
            }

            string r = "";
            string filter_content = "";

            foreach (component_p c in comps
                     )
            {
                if (!filter_content.Equals("")
                    )
                {
                    filter_content += s242;
                }
                r += "<div " +
                     "class = ''" +
                     "id = 'comp_prim_" + c.ID +
                     "'" +
                     ">";
                filter_content += c.ID + s241 + c.name;
                r += "<div " +
                     "class = 'get_sub' " +
                     "onclick = 'get_sub_comps(" + c.ID +
                     ");" +
                     "'" +
                     ">";

                r += "<img class = 'get_comp_img" +
                     "'" +
                     "src='" + "../imgs/get_subs.png" +
                     "'" +
                     " id = 'get_comp_img_" + c.ID +
                     "'" +
                     " xpnd = '0'" +
                     "/>";

                r += "</div>";

                r += "<div " +
                     "class = 'comp'" +
                     "id = 'comp_" + c.ID +
                     "'" +
                     ">";
                if (c_.group_ == 1
                    )
                {
                    r += "<div " +
                         "class = 'get_sub' " +
                         "title = 'Create Sub Component" +
                         "' " +
                         "onclick = 'create_sub_comp(" + c.ID +
                         ");" +
                         "'" +
                         ">";

                    r += "<img src='" + "../imgs/create_sub.png" +
                         "'" +
                         "/>";

                    r += "</div>";

                    r += "<div " +
                         "class = 'get_sub' " +
                         "title='Delete Component" +
                         "' " +
                         "onclick = 'purge_comp(" + c.ID +
                         ");" +
                         "'" +
                         ">";

                    r += "<img src='../imgs/reject.png" +
                         "'" +
                         "/>";

                    r += "</div>";
                }

                r += "<div " +
                     "class = 'l'" +
                     "onclick = 'get_comp(" + c.ID +
                     ")" +
                     "'" +
                     ">";
                r += "<div " +
                     "class = 'l'" +
                     ">";
                r += "<img class = 'comp_img" +
                     "'" +
                     "id = 'comp_img_" + c.ID +
                     "'" +
                     "src = '" + imgs.byte_to_base64(c.img, c.format
                                                     ) +
                     "'" +
                     "/>";

                r += "</div>";
                r += "<div " +
                     "class = 'l'" +
                     " id='comp_name_" + c.ID +
                     "'" +
                     ">";
                r += c.name;

                r += "</div>";

                r += "<div " +
                     "class = 'cls'" +
                     ">";
                r += "</div>";

                r += "</div>";

                r += "<div " +
                     "class = 'cls'" +
                     ">";
                r += "</div>";

                r += "</div>";

                r += "<div " +
                     "class = 'cls'" +
                     ">";
                r += "</div>";

                r += "<div " +
                     "class = 'sub_comps" +
                     "'" + " " +
                     "id = 'sub_comps_" + c.ID +
                     "'" +
                     ">";

                r += "</div>";
                r += "</div>";
            }
            if (r == ""
                )
            {
                r = "<i>" + "No Sub Components" +
                    "</i>";
            }

            return(r + s240 + comp + s240 + pgt + s240 + mx + s240 + filter_content);
        }