public static string toQuestionApprovalStatusName(this QuestionApprovalType statusType) { string status = ""; switch (statusType) { case QuestionApprovalType.Draft: status = "ร่าง"; break; case QuestionApprovalType.Pending: status = "รอการกลั่นกรอง"; break; case QuestionApprovalType.Approved: status = "กลั่นกรองแล้ว"; break; case QuestionApprovalType.Reject: status = "ไม่ผ่านการกลั่นกรอง"; break; default: break; } return(status); }
public static QuestionApprovalType toQuestionApprovalStatus(this string text) { QuestionApprovalType str = QuestionApprovalType.Draft; switch (text) { case "ร่าง": str = QuestionApprovalType.Draft; break; case "รอการกลั่นกรอง": str = QuestionApprovalType.Pending; break; case "กลั่นกรองแล้ว": str = QuestionApprovalType.Approved; break; case "ไม่ผ่านการกลั่นกรอง": str = QuestionApprovalType.Reject; break; case "0": str = QuestionApprovalType.Draft; break; case "1": str = QuestionApprovalType.Pending; break; case "2": str = QuestionApprovalType.Approved; break; case "3": str = QuestionApprovalType.Reject; break; default: break; } return(str); }