public bool ExistEmployedFormat(String sTextEmployed) { var et = new employedCompositeType(); var em = new EmployedManager(); int iIdEmployed = Util.SeparaID_AutoComplete(sTextEmployed); et = iIdEmployed > 0 ? em.getEmployedById(iIdEmployed) : null; bool exist = et != null; return(exist); }
public string Employed(string iIdEmployed, int iNumber, string sName, string sMLastName, string sFLastName, string sEMail, int iIdArea, int iIdPlant, int iBoss, int iSubstitute, out byte status) { int id = 0; if (!string.IsNullOrEmpty(iIdEmployed)) { id = int.Parse(iIdEmployed); } var em = new EmployedManager(); if (id == 0) { if (em.ExistEmployed(iNumber, sEMail)) { status = 3; return("El correo o número de empleado ya existe, no es posible duplicar registros."); } else { em.AddEmployed(iNumber, sName, sMLastName, sFLastName, sEMail, iIdArea, iIdPlant, iBoss, iSubstitute); } status = 5; return(string.Empty); } else { em.UpdateEmployed(id, iNumber, sName, sMLastName, sFLastName, sEMail, iIdArea, iIdPlant, iBoss, iSubstitute); status = 6; return(string.Empty); } status = (byte)0; return(null); }