public ReturnResult <JobPosition> UpdateStatusJobPosition(JobPosition JobPosition) { ReturnResult <JobPosition> result = new ReturnResult <JobPosition>();; DbProvider db; try { db = new DbProvider(); db.SetQuery("JobPosition_UpdateStatus", CommandType.StoredProcedure); db.SetParameter("Status", SqlDbType.TinyInt, JobPosition.Status); db.SetParameter("ErrorCode", SqlDbType.Int, DBNull.Value, ParameterDirection.Output); db.SetParameter("ErrorMessage", SqlDbType.NVarChar, DBNull.Value, 4000, ParameterDirection.Output); db.ExcuteNonQuery(); db.Complete(); db.GetOutValue("ErrorCode", out string errorCode); db.GetOutValue("ErrorMessage", out string errorMessage); if (errorCode.ToString() == "0") { result.ErrorCode = "0"; result.ErrorMessage = ""; } else { result.Failed(errorCode, errorMessage); } } catch (Exception ex) { result.Failed("-1", ex.Message); } return(result); }
/// <summary> /// cập nhật cơ quan /// </summary> /// <param name="coQuan"></param> /// <returns></returns> public ReturnResult <CoQuan> UpdateCoQuan(CoQuan coQuan) { ReturnResult <CoQuan> result = new ReturnResult <CoQuan>();; DbProvider db; try { db = new DbProvider(); db.SetQuery("Organ_EDIT", CommandType.StoredProcedure); db.SetParameter("CoQuanID", SqlDbType.Int, coQuan.CoQuanID); db.SetParameter("OrganCode", SqlDbType.NVarChar, coQuan.OrganCode); db.SetParameter("DiaChiID", SqlDbType.Int, coQuan.DiaChiID); db.SetParameter("TenCoQuan", SqlDbType.NVarChar, coQuan.TenCoQuan, 500); db.SetParameter("LoaiCoQuan", SqlDbType.Int, coQuan.LoaiCoQuanID); db.SetParameter("AddressDetail", SqlDbType.NVarChar, coQuan.AddressDetail, 500); db.SetParameter("TinhID", SqlDbType.Int, coQuan.TinhID); db.SetParameter("HuyenID", SqlDbType.Int, coQuan.HuyenID); db.SetParameter("XaPhuongID", SqlDbType.Int, coQuan.XaPhuongID); db.SetParameter("UpdatedBy", SqlDbType.NVarChar, coQuan.UpdatedBy, 50); db.SetParameter("Description", SqlDbType.NVarChar, coQuan.Description, 1000); db.SetParameter("Notes", SqlDbType.NVarChar, coQuan.Notes, 1000); db.SetParameter("ErrorCode", SqlDbType.Int, DBNull.Value, ParameterDirection.Output); db.SetParameter("ErrorMessage", SqlDbType.NVarChar, DBNull.Value, 4000, ParameterDirection.Output); db.ExcuteNonQuery(); db.Complete(); db.GetOutValue("ErrorCode", out string errorCode); db.GetOutValue("ErrorMessage", out string errorMessage); if (errorCode.ToString() == "0") { result.ErrorCode = "0"; result.ErrorMessage = ""; } else { result.Failed(errorCode, errorMessage); } } catch (Exception ex) { result.Failed("-1", ex.Message); } return(result); }
public ReturnResult <BranchContact> UpdateBranchContact(BranchContact BranchContact) { ReturnResult <BranchContact> result = new ReturnResult <BranchContact>();; DbProvider db; try { db = new DbProvider(); db.SetQuery("BranchContact_Update", CommandType.StoredProcedure); db.SetParameter("BranchContactId", SqlDbType.Int, BranchContact.BranchContactId); db.SetParameter("BranchContactCode", SqlDbType.NVarChar, BranchContact.BranchContactCode); db.SetParameter("BranchContactName", SqlDbType.NVarChar, BranchContact.BranchContactName); db.SetParameter("ContactName", SqlDbType.NVarChar, BranchContact.ContactName); db.SetParameter("Email", SqlDbType.NVarChar, BranchContact.Email); db.SetParameter("Hotline", SqlDbType.NVarChar, BranchContact.Hotline); db.SetParameter("IPPhone", SqlDbType.NVarChar, BranchContact.IPPhone); db.SetParameter("OperateStatus", SqlDbType.Int, BranchContact.OperateStatus); db.SetParameter("ErrorCode", SqlDbType.Int, DBNull.Value, ParameterDirection.Output); db.SetParameter("ErrorMessage", SqlDbType.NVarChar, DBNull.Value, 4000, ParameterDirection.Output); db.ExcuteNonQuery(); db.Complete(); db.GetOutValue("ErrorCode", out string errorCode); db.GetOutValue("ErrorMessage", out string errorMessage); if (errorCode.ToString() == "0") { result.ErrorCode = "0"; result.ErrorMessage = ""; } else { result.Failed(errorCode, errorMessage); } } catch (Exception ex) { result.Failed("-1", ex.Message); } return(result); }
public ReturnResult <Vacancy> UpdateVacancy(Vacancy Vacancy) { ReturnResult <Vacancy> result = new ReturnResult <Vacancy>();; DbProvider db; try { db = new DbProvider(); db.SetQuery("Vacancy_Update", CommandType.StoredProcedure); db.SetParameter("Id", SqlDbType.Int, Vacancy.ID); db.SetParameter("VacancyName", SqlDbType.NVarChar, Vacancy.VacancyName); db.SetParameter("IsActivated", SqlDbType.Int, Vacancy.IsActivated); db.SetParameter("VacancyCode", SqlDbType.NVarChar, Vacancy.VacancyCode); db.SetParameter("DescriptionVN", SqlDbType.NVarChar, Vacancy.DescriptionVN); db.SetParameter("UpdatedBy", SqlDbType.NVarChar, Vacancy.UpdatedBy); db.SetParameter("ErrorCode", SqlDbType.Int, DBNull.Value, ParameterDirection.Output); db.SetParameter("ErrorMessage", SqlDbType.NVarChar, DBNull.Value, 4000, ParameterDirection.Output); db.ExcuteNonQuery(); db.Complete(); db.GetOutValue("ErrorCode", out string errorCode); db.GetOutValue("ErrorMessage", out string errorMessage); if (errorCode.ToString() == "0") { result.ErrorCode = "0"; result.ErrorMessage = ""; } else { result.Failed(errorCode, errorMessage); } } catch (Exception ex) { result.Failed("-1", ex.Message); } return(result); }
public ReturnResult <Skills> UpdateSkills(Skills Skills) { ReturnResult <Skills> result = new ReturnResult <Skills>();; DbProvider db; try { db = new DbProvider(); db.SetQuery("Skills_Update", CommandType.StoredProcedure); db.SetParameter("SkillId", SqlDbType.Int, Skills.SkillId); db.SetParameter("SkillName", SqlDbType.NVarChar, Skills.SkillName); db.SetParameter("Description", SqlDbType.NVarChar, Skills.Description); db.SetParameter("ModifiedUser", SqlDbType.NVarChar, Skills.ModifiedDate); db.SetParameter("Status", SqlDbType.TinyInt, Skills.Status); db.SetParameter("ErrorCode", SqlDbType.Int, DBNull.Value, ParameterDirection.Output); db.SetParameter("ErrorMessage", SqlDbType.NVarChar, DBNull.Value, 4000, ParameterDirection.Output); db.ExcuteNonQuery(); db.Complete(); db.GetOutValue("ErrorCode", out string errorCode); db.GetOutValue("ErrorMessage", out string errorMessage); if (errorCode.ToString() == "0") { result.ErrorCode = "0"; result.ErrorMessage = ""; } else { result.Failed(errorCode, errorMessage); } } catch (Exception ex) { result.Failed("-1", ex.Message); } return(result); }