public string edit_comp_img2( string img_stg, int comp, int c_serv ) { img_stg_p ims = img_stgs_p.get(img_stg ); string r = ""; if (ims == null ) { r += "Could not locate the image" + "<br>"; } if (!r.Equals("") ) { //2 = error return("2" + s240 + r); } ims.purge(); component_p c = components_p.get(comp ); c.revise("img", ims.img ); c.revise("format", ims.format ); return("0" + s240 + comp + s240 + imgs.byte_to_base64(ims.img, ims.format )); }
public string create_sub_comp2( string name, int type, int super_comp, string img_stg, string client, int c_serv ) { string r = ""; name = name.Trim(); if (name == "" ) { r += "You must provide the <i>name</i> for this component" + "<br>"; } if (type == 0 ) { r += "<i>Type</i> is required for this component" + "<br>"; } if (img_stg == "" ) { r += "<i>Image</i> is required for this component" + "<br>"; } img_stg_p ims = img_stgs_p.get(img_stg ); if (ims == null ) { r += "Could not locate the image" + "<br>"; } if (!r.Equals("") ) { //2 = error return("2" + s240 + r); } ims.purge(); string cur = DateTime.Now.Ticks.ToString(); component_p comp = new component_p(); comp.name = name; if (super_comp == 0 ) { comp.name = cur; } comp.comp_type = type; comp.super_comp = super_comp; comp.img = ims.img; comp.format = ims.format; comp.submit(); if (super_comp == 0 ) { comp = components_p.get(cur); comp.name = name; comp.revise("name", name ); int i = comps_pgt[client].Count; comps_pgt[client][i].Add(comp ); } return("0" + s240 + super_comp); }