private IList <FieldClassModel> fnFieldClass_List(FieldClassModel apiObject, ref string strResult)
        {
            string strReturnCode = "000";
            string strReturnMsg  = "UnDefined";
            string crCnString    = UtilityLib.GetConnectionString();
            IList <FieldClassModel> objFieldClassModelList = new List <FieldClassModel>();

            DataSet usersInfoDS = DAL_FieldClass.FieldClass_List(crCnString, apiObject.RequestType, apiObject.SearchBy, apiObject.SearchString,
                                                                 apiObject.IntID, apiObject.CompanyId, apiObject.ItemsPerPage, apiObject.RequestPageNo, apiObject.CurrentPageNo);

            DataTable usersInfoDT = usersInfoDS.Tables[0];

            if (usersInfoDT != null && usersInfoDT.Rows.Count > 0)
            {
                strReturnCode = "001";
                strReturnMsg  = "Success";
                foreach (DataRow dr in usersInfoDT.Rows)
                {
                    apiObject = new FieldClassModel();
                    apiObject.FieldClassId   = UtilityLib.FormatNumber(dr["FieldClassId"].ToString());
                    apiObject.FieldClassName = (string)dr["FieldClassName"];
                    apiObject.FieldClassCode = (string)dr["FieldClassCode"];
                    apiObject.CompanyId      = (Guid)(dr["CompanyId"]);
                    objFieldClassModelList.Add(apiObject);
                }
            }
            else
            {
                strReturnCode = "002";
                strReturnMsg  = "Fail-Record Not Found";
            }
            strResult = strReturnCode + "|" + strReturnMsg;
            return(objFieldClassModelList);
        }
        public IList <FieldClassModel> FieldClass_List(ArrayList paramList)
        {
            FieldClassModel         apiObject     = new FieldClassModel();
            string                  strResult     = "";
            IList <FieldClassModel> apiObjectList = null;

            apiObject = Newtonsoft.Json.JsonConvert.DeserializeObject <FieldClassModel>(paramList[0].ToString());
            /// =============
            apiObjectList = fnFieldClass_List(apiObject, ref strResult);
            return(apiObjectList);
        }
        public FieldClassModel FieldClass_InsertUpdate(ArrayList paramList)
        {
            string          strResult     = "";
            string          strReturnCode = "000";
            string          strReturnMsg  = "UnDefined";
            FieldClassModel apiObject     = new FieldClassModel();

            apiObject = Newtonsoft.Json.JsonConvert.DeserializeObject <FieldClassModel>(paramList[0].ToString());
            string crCnString = UtilityLib.GetConnectionString();

            int FieldInfo = DAL_FieldClass.FieldClass_InsertUpdate(crCnString, apiObject.FieldClassId, apiObject.FieldClassName, apiObject.FieldClassCode, apiObject.CompanyId);

            if (FieldInfo == 0)
            {
                apiObject.ReturnCode    = FieldInfo;
                apiObject.ReturnMessage = "Success";
            }
            else if (FieldInfo == 1)
            {
                apiObject.ReturnCode    = FieldInfo;
                apiObject.ReturnMessage = "Field Class already exists";
            }
            else if (FieldInfo == 101)
            {
                apiObject.ReturnCode    = FieldInfo;
                apiObject.ReturnMessage = "Field Class updated successfully";
            }
            else if (FieldInfo == 2)
            {
                apiObject.ReturnCode    = FieldInfo;
                apiObject.ReturnMessage = "record is already updated by someone else";
            }
            else
            {
                apiObject.ReturnCode    = FieldInfo;
                apiObject.ReturnMessage = "Fail-Record Not Inserted";
            }
            strResult = strReturnCode + "|" + strReturnMsg;
            return(apiObject);
        }