Exemplo n.º 1
0
        public static ResponseModel UpdateUser(UserIfo model)
        {
            ResponseModel response = new ResponseModel();

            try
            {
                List <string> lgp_fields = new List <string>()
                {
                    "Code", "Description1", "Description2"
                };
                List <string> skp_fields = new List <string>()
                {
                    "Number"
                };

                PrepSQL.ErpUpdateData("Units", model, model.UserNr, "UserNr", lgp_fields, skp_fields);
                response.status = 1;
                response.msg    = "Success";
            }
            catch (Exception ex)
            {
                response.status = 0;
                response.msg    = ex.Message;
            }
            return(response);
        }
Exemplo n.º 2
0
        public static ResponseModel SaveUser(UserIfo model)
        {
            int id = 0;

            model.DateEntered  = DateTime.Now;
            model.DateModified = DateTime.Now;
            ResponseModel response = new ResponseModel();

            try
            {
                List <string> lgp_fields = new List <string>()
                {
                    "UserName", "UserPaswr", "EmployeeNumber", "FName", "MIName", "LName", "UserAccount", "UserInactive", "EnteredBy", "DateEntered", "ModifiedBy", "DateModified", "AccessRights", "Branch", "loginStatus", "IsAllow"
                };
                List <string> skp_fields = new List <string>()
                {
                    "UserNr"
                };

                id = PrepSQL.ErpInsertData("User", model, lgp_fields, skp_fields);
                response.status = 1;
                response.msg    = "Success";
            }
            catch (Exception ex)
            {
                response.status = 0;
                response.msg    = ex.Message;
            }
            return(response);
        }