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

            DataSet usersInfoDS = DAL_GeneralMasterClass.GeneralMasterClass_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 GeneralMasterClass();
                    apiObject.GeneralMasterClassId   = UtilityLib.FormatNumber(dr["GeneralMasterClassId"].ToString());
                    apiObject.GeneralMasterClassName = (string)dr["GeneralMasterClassName"];
                    apiObject.CompanyId = (Guid)(dr["CompanyId"]);
                    objGeneralClassModelList.Add(apiObject);
                }
            }
            else
            {
                strReturnCode           = "002";
                apiObject.ReturnMessage = "Fail-Record Not Found";
            }
            strResult = strReturnCode + "|" + strReturnMsg;
            return(objGeneralClassModelList);
        }
        private UOMConversionModel fnUOMConversion_Get(UOMConversionModel apiObject, ref string strResult)
        {
            string             strReturnCode    = "000";
            string             strReturnMsg     = "UnDefined";
            string             crCnString       = UtilityLib.GetConnectionString();
            UOMConversionModel objUOMConversion = new UOMConversionModel();

            DataSet usersInfoDS = DAL_UOMMaster.UOMConversion_Get(crCnString, apiObject.SourceUOMId, apiObject.DestinationUOMId,
                                                                  apiObject.CompanyId);

            DataTable usersInfoDT = usersInfoDS.Tables[0];

            if (usersInfoDT != null && usersInfoDT.Rows.Count > 0)
            {
                strReturnCode = "001";
                strReturnMsg  = "Success";
                DataRow dr = usersInfoDT.Rows[0];
                objUOMConversion.SourceUOMId                 = UtilityLib.FormatNumber(dr["SourceUOMId"].ToString());
                objUOMConversion.SourceConversionRation      = UtilityLib.FormatDecimal(dr["SourceConversionRation"].ToString());
                objUOMConversion.DestinationUOMId            = UtilityLib.FormatNumber(dr["DestinationUOMId"].ToString());
                objUOMConversion.DestinationConversionRation = UtilityLib.FormatDecimal(dr["DestinationConversionRation"].ToString());
            }
            else
            {
                strReturnCode           = "002";
                apiObject.ReturnMessage = "Fail-Record Not Found";
            }
            strResult = strReturnCode + "|" + strReturnMsg;
            return(objUOMConversion);
        }
        public InventoryModel GetREciptNo()
        {
            string         strResult     = "";
            string         strReturnCode = "000";
            string         strReturnMsg  = "UnDefined";
            InventoryModel apiObject     = new InventoryModel();
            string         crCnString    = UtilityLib.GetConnectionString();

            DataSet   dt          = DAL_Inventory.GetRecipt(crCnString);
            DataTable usersInfoDT = dt.Tables[0];

            if (usersInfoDT != null && usersInfoDT.Rows.Count > 0)
            {
                strReturnCode = "001";
                strReturnMsg  = "Success";
                foreach (DataRow dr in usersInfoDT.Rows)
                {
                    apiObject             = new InventoryModel();
                    apiObject.NewReciptNo = UtilityLib.FormatNumber(dr["UpRwcipt"].ToString());
                }
            }
            else
            {
                strReturnCode = "002";
                strReturnMsg  = "Fail-Record Not Found";
            }
            strResult = strReturnCode + "|" + strReturnMsg;
            return(apiObject);


            ;
        }
        private IList <RoleRightsModel> fnRightsBasedMenu_List(RoleRightsModel apiObject, ref string strResult)
        {
            string strReturnCode = "000";
            string strReturnMsg  = "UnDefined";
            string crCnString    = UtilityLib.GetConnectionString();
            IList <RoleRightsModel> objRightsModelList = new List <RoleRightsModel>();

            DataSet usersInfoDS = DAL_RoleRightsBasedMenu.ShowModules_RightsBased(crCnString, apiObject.RequestType, apiObject.RoleId, apiObject.CompanyId);

            DataTable usersInfoDT = usersInfoDS.Tables[0];

            if (usersInfoDT != null && usersInfoDT.Rows.Count > 0)
            {
                strReturnCode = "001";
                strReturnMsg  = "Success";
                foreach (DataRow dr in usersInfoDT.Rows)
                {
                    apiObject = new RoleRightsModel();
                    apiObject.RoleRightsId = UtilityLib.FormatNumber(dr["RoleRightsId"].ToString());
                    apiObject.RoleId       = UtilityLib.FormatNumber(dr["RoleId"].ToString());
                    apiObject.RoleName     = (string)dr["RoleName"];
                    apiObject.ModuleName   = (string)dr["ModuleName"];
                    //apiObject.ModuleOrder = (string)dr["ModuleOrder"];
                    apiObject.ModuleURL         = (string)dr["ModuleURL"];
                    apiObject.ModuleCode        = (string)dr["ModuleCode"];
                    apiObject.ModuleImagePath   = (string)dr["ModuleImagePath"];
                    apiObject.ModuleId          = UtilityLib.FormatNumber(dr["ModuleId"].ToString());
                    apiObject.PrecedingModuleId = UtilityLib.FormatNumber(dr["PrecedingModuleId"].ToString());
                    apiObject.View      = UtilityLib.FormatBoolean(dr["View"].ToString());
                    apiObject.Edit      = UtilityLib.FormatBoolean(dr["Edit"].ToString());
                    apiObject.Create    = UtilityLib.FormatBoolean(dr["Create"].ToString());
                    apiObject.Delete    = UtilityLib.FormatBoolean(dr["Delete"].ToString());
                    apiObject.CompanyId = (Guid)(dr["CompanyId"]);
                    objRightsModelList.Add(apiObject);
                }
            }
            else
            {
                strReturnCode = "002";
                strReturnMsg  = "Fail-Record Not Found";
            }
            strResult = strReturnCode + "|" + strReturnMsg;
            return(objRightsModelList);
        }
        private IList <ProductMasterModel> fnProductMaster_List(ProductMasterModel apiObject, ref string strResult)
        {
            string strReturnCode = "000";
            string strReturnMsg  = "UnDefined";
            string crCnString    = UtilityLib.GetConnectionString();
            IList <ProductMasterModel> objFieldClassModelList = new List <ProductMasterModel>();
            DataSet usersInfoDS = DL_ProductMaster.Product_List(crCnString, apiObject.RequestType, apiObject.SearchBy, apiObject.SearchString,
                                                                apiObject.Productid, 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 ProductMasterModel();
                    apiObject.Productid   = UtilityLib.FormatNumber(dr["Processid"].ToString());
                    apiObject.ProductName = (string)dr["ProductName"];
                    apiObject.UOM         = UtilityLib.FormatNumber(dr["UOM"].ToString());
                    //apiObject.State = UtilityLib.FormatString(dr["State"]);
                    //apiObject.Texture = UtilityLib.FormatNumber(dr["Texture "].ToString());
                    //apiObject.Catagory = UtilityLib.FormatNumber(dr["Catagory "].ToString());
                    apiObject.CreatedBy         = (Guid)(dr["CreatedBy"]);
                    apiObject.CreatedDate       = UtilityLib.FormatDate(dr["CreatedDate"]);
                    apiObject.IsDelete          = UtilityLib.FormatBoolean(dr["IsDelete"].ToString());
                    apiObject.SafeLifeInGodown  = UtilityLib.FormatDate(dr["SafeLifeInGodown"]);
                    apiObject.ProcessId         = (string)(dr["ProcessId"]);
                    apiObject.BuyProductId      = UtilityLib.FormatNumber(dr["BuyProductId"].ToString());
                    apiObject.BuyProductPacking = UtilityLib.FormatNumber(dr["BuyProductPacking"].ToString());
                    apiObject.CompanyId         = (Guid)(dr["CompanyId"]);
                    objFieldClassModelList.Add(apiObject);
                }
            }
            else
            {
                strReturnCode = "002";
                strReturnMsg  = "Fail-Record Not Found";
            }
            strResult = strReturnCode + "|" + strReturnMsg;
            return(objFieldClassModelList);
        }
        public GeneralMasterModel GeneralMaster_InsertUpdate(ArrayList paramList)
        {
            string             strResult     = "";
            string             strReturnCode = "000";
            string             strReturnMsg  = "UnDefined";
            GeneralMasterModel apiObject     = new GeneralMasterModel();

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

            int FieldCodeInfo = DAL_GeneralMaster.GeneralMaster_InsertUpdate(crCnString, apiObject.GeneralMasterId,
                                                                             apiObject.GeneralMasterClassId, apiObject.GeneralMasterName,
                                                                             apiObject.GeneralMasterCode, apiObject.GeneralMasterSquence, apiObject.CreatedBy, apiObject.ModifiedBy, apiObject.CompanyId);

            if (FieldCodeInfo == 0)
            {
                apiObject.ReturnCode    = FieldCodeInfo;
                apiObject.ReturnMessage = "Success";
            }
            else if (FieldCodeInfo == 1)
            {
                apiObject.ReturnCode    = FieldCodeInfo;
                apiObject.ReturnMessage = "General Master already exists";
            }
            else if (FieldCodeInfo == 101)
            {
                apiObject.ReturnCode    = FieldCodeInfo;
                apiObject.ReturnMessage = "General Master updated successfully";
            }
            else if (FieldCodeInfo == 2)
            {
                apiObject.ReturnCode    = FieldCodeInfo;
                apiObject.ReturnMessage = "record is already updated by someone else";
            }
            else
            {
                apiObject.ReturnCode    = FieldCodeInfo;
                apiObject.ReturnMessage = "Fail-Record Not Inserted";
            }
            strResult = strReturnCode + "|" + strReturnMsg;
            return(apiObject);
        }
        public InventoryModel Inventory_InsertUpdate(ArrayList paramList)
        {
            string         strResult     = "";
            string         strReturnCode = "000";
            string         strReturnMsg  = "UnDefined";
            InventoryModel apiObject     = new InventoryModel();

            apiObject = Newtonsoft.Json.JsonConvert.DeserializeObject <InventoryModel>(paramList[0].ToString());
            string crCnString    = UtilityLib.GetConnectionString();
            int    Inventoryinfo = DAL_Inventory.InventoryInsert(crCnString, apiObject.FarmerId,
                                                                 apiObject.ReciptNo, apiObject.LoginId, apiObject.PersonName,
                                                                 apiObject.Quantity, apiObject.Unit, apiObject.ComapnyId,
                                                                 apiObject.RawMaterial, apiObject.Storage, apiObject.CreatedDate);

            if (Inventoryinfo == 0)
            {
                apiObject.ReturnCode    = Inventoryinfo;
                apiObject.ReturnMessage = "Inventory Added Successfully";
            }
            else if (Inventoryinfo == 1)
            {
                apiObject.ReturnCode    = Inventoryinfo;
                apiObject.ReturnMessage = "Inventory already exists";
            }
            else if (Inventoryinfo == 101)
            {
                apiObject.ReturnCode    = Inventoryinfo;
                apiObject.ReturnMessage = "Inventory updated successfully";
            }
            else if (Inventoryinfo == 2)
            {
                apiObject.ReturnCode    = Inventoryinfo;
                apiObject.ReturnMessage = "record is already updated by someone else";
            }
            else
            {
                apiObject.ReturnCode    = Inventoryinfo;
                apiObject.ReturnMessage = "Fail-Record Not Inserted";
            }
            strResult = strReturnCode + "|" + strReturnMsg;
            return(apiObject);
        }
        public RolesModel Roles_InsertUpdate(ArrayList paramList)
        {
            string     strResult     = "";
            string     strReturnCode = "000";
            string     strReturnMsg  = "UnDefined";
            RolesModel apiObject     = new RolesModel();

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

            int RoleInfo = DAL_Roles.Roles_InsertUpdate(crCnString, apiObject.RoleId, apiObject.RoleName, apiObject.RoleCode, apiObject.UnderPrecedingRoleId,
                                                        apiObject.AuthorizationRequired, apiObject.CompanyId);

            if (RoleInfo == 0)
            {
                apiObject.ReturnCode    = RoleInfo;
                apiObject.ReturnMessage = "Role Added Successfully";
            }
            else if (RoleInfo == 1)
            {
                apiObject.ReturnCode    = RoleInfo;
                apiObject.ReturnMessage = "Role already exists";
            }
            else if (RoleInfo == 101)
            {
                apiObject.ReturnCode    = RoleInfo;
                apiObject.ReturnMessage = "Role updated successfully";
            }
            else if (RoleInfo == 2)
            {
                apiObject.ReturnCode    = RoleInfo;
                apiObject.ReturnMessage = "record is already updated by someone else";
            }
            else
            {
                apiObject.ReturnCode    = RoleInfo;
                apiObject.ReturnMessage = "Fail-Record Not Inserted";
            }
            strResult = strReturnCode + "|" + strReturnMsg;
            return(apiObject);
        }
        public RoleRightsModel Rights_InsertUpdate(ArrayList paramList)
        {
            string          strResult     = "";
            string          strReturnCode = "000";
            string          strReturnMsg  = "UnDefined";
            RoleRightsModel apiObject     = new RoleRightsModel();

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

            int RightsInfo = DAL_RoleRights.Rights_InsertUpdate(crCnString, apiObject.RoleRightsId, apiObject.RoleId, apiObject.ModuleId, apiObject.View,
                                                                apiObject.Edit, apiObject.Create, apiObject.Delete, apiObject.CompanyId);

            if (RightsInfo == 0)
            {
                apiObject.ReturnCode    = RightsInfo;
                apiObject.ReturnMessage = "Rights Added Successfully";
            }
            else if (RightsInfo == 1)
            {
                apiObject.ReturnCode    = RightsInfo;
                apiObject.ReturnMessage = "Rights already exists";
            }
            else if (RightsInfo == 101)
            {
                apiObject.ReturnCode    = RightsInfo;
                apiObject.ReturnMessage = "Rights updated successfully";
            }
            else if (RightsInfo == 2)
            {
                apiObject.ReturnCode    = RightsInfo;
                apiObject.ReturnMessage = "record is already updated by someone else";
            }
            else
            {
                apiObject.ReturnCode    = RightsInfo;
                apiObject.ReturnMessage = "Fail-Record Not Inserted";
            }
            strResult = strReturnCode + "|" + strReturnMsg;
            return(apiObject);
        }
        public ProductMasterModel ProductMaster_InsertUpdate(ArrayList paramList)
        {
            string             strResult     = "";
            string             strReturnCode = "000";
            string             strReturnMsg  = "UnDefined";
            ProductMasterModel apiObject     = new ProductMasterModel();

            apiObject = Newtonsoft.Json.JsonConvert.DeserializeObject <ProductMasterModel>(paramList[0].ToString());
            string crCnString  = UtilityLib.GetConnectionString();
            int    Processinfo = DL_ProductMaster.ProductInsert(crCnString, apiObject.Productid,
                                                                apiObject.ProductName, apiObject.UOM, apiObject.Color, apiObject.Texture, apiObject.CreatedBy, apiObject.ProcessId, apiObject.BuyProductId, apiObject.BuyProductPacking, apiObject.Catagory, apiObject.CompanyId);

            if (Processinfo == 0)
            {
                apiObject.ReturnCode    = Processinfo;
                apiObject.ReturnMessage = "Product Added Successfully";
            }
            else if (Processinfo == 1)
            {
                apiObject.ReturnCode    = Processinfo;
                apiObject.ReturnMessage = "Product already exists";
            }
            else if (Processinfo == 101)
            {
                apiObject.ReturnCode    = Processinfo;
                apiObject.ReturnMessage = "Product updated successfully";
            }
            else if (Processinfo == 2)
            {
                apiObject.ReturnCode    = Processinfo;
                apiObject.ReturnMessage = "record is already updated by someone else";
            }
            else
            {
                apiObject.ReturnCode    = Processinfo;
                apiObject.ReturnMessage = "Fail-Record Not Inserted";
            }
            strResult = strReturnCode + "|" + strReturnMsg;

            return(apiObject);
        }
        public FieldCodeModel FieldCode_InsertUpdate(ArrayList paramList)
        {
            string         strResult     = "";
            string         strReturnCode = "000";
            string         strReturnMsg  = "UnDefined";
            FieldCodeModel apiObject     = new FieldCodeModel();

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

            int FieldCodeInfo = DAL_FieldCode.FieldCode_InsertUpdate(crCnString, apiObject.FieldCodeId, apiObject.FieldClassId, apiObject.FieldCodeName,
                                                                     apiObject.FieldCodeAlias, apiObject.FieldCodeOrder, apiObject.CompanyId);

            if (FieldCodeInfo == 0)
            {
                apiObject.ReturnCode    = FieldCodeInfo;
                apiObject.ReturnMessage = "Success";
            }
            else if (FieldCodeInfo == 1)
            {
                apiObject.ReturnCode    = FieldCodeInfo;
                apiObject.ReturnMessage = "Field Code already exists";
            }
            else if (FieldCodeInfo == 101)
            {
                apiObject.ReturnCode    = FieldCodeInfo;
                apiObject.ReturnMessage = "Field Code updated successfully";
            }
            else if (FieldCodeInfo == 2)
            {
                apiObject.ReturnCode    = FieldCodeInfo;
                apiObject.ReturnMessage = "record is already updated by someone else";
            }
            else
            {
                apiObject.ReturnCode    = FieldCodeInfo;
                apiObject.ReturnMessage = "Fail-Record Not Inserted";
            }
            strResult = strReturnCode + "|" + strReturnMsg;
            return(apiObject);
        }
        private IList <InventoryModel> fnInventory_List(InventoryModel apiObject, ref string strResult)
        {
            string strReturnCode = "000";
            string strReturnMsg  = "UnDefined";
            string crCnString    = UtilityLib.GetConnectionString();
            IList <InventoryModel> objFieldClassModelList = new List <InventoryModel>();
            DataSet usersInfoDS = DAL_Inventory.Inventory_List(crCnString, apiObject.RequestType, apiObject.SearchBy, apiObject.SearchString,
                                                               apiObject.ReciptNo, apiObject.ComapnyId, 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 InventoryModel();
                    apiObject.ReciptNo = UtilityLib.FormatNumber(dr["ReciptNo"].ToString());
                    apiObject.FarmerId = UtilityLib.FormatNumber(dr["FarmerId"].ToString());
                    apiObject.LoginId  = UtilityLib.FormatNumber(dr["LoginId"].ToString());

                    apiObject.PersonName = (string)dr["PersonName"];
                    apiObject.Quantity   = UtilityLib.FormatNumber(dr["Qunatity"].ToString());
                    apiObject.Unit       = (string)dr["Unit"];

                    apiObject.RawMaterial = (string)dr["RawMaterial"];
                    apiObject.Storage     = UtilityLib.FormatNumber(dr["Storage"].ToString());
                    apiObject.CreatedDate = UtilityLib.FormatDate(dr["CreatedDate"]);
                    //apiObject.CompanyId = (Guid)(dr["CompanyId"]);
                    objFieldClassModelList.Add(apiObject);
                }
            }
            else
            {
                strReturnCode = "002";
                strReturnMsg  = "Fail-Record Not Found";
            }
            strResult = strReturnCode + "|" + strReturnMsg;

            return(objFieldClassModelList);
        }
        private IList <RoleRightsModel> fnRights_List(RoleRightsModel apiObject, ref string strResult)
        {
            string strReturnCode = "000";
            string strReturnMsg  = "UnDefined";
            string crCnString    = UtilityLib.GetConnectionString();
            IList <RoleRightsModel> objRightsModelList = new List <RoleRightsModel>();

            DataSet usersInfoDS = DAL_RoleRights.Rights_List(crCnString, apiObject.RequestType, apiObject.SearchBy, apiObject.SearchString, apiObject.IntID,
                                                             apiObject.RoleId, apiObject.ModuleId, 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 RoleRightsModel();
                    apiObject.RoleRightsId = UtilityLib.FormatNumber(dr["RoleRightsId"].ToString());
                    apiObject.RoleId       = UtilityLib.FormatNumber(dr["RoleId"].ToString());
                    apiObject.RoleName     = (string)dr["RoleName"];
                    apiObject.ModuleId     = UtilityLib.FormatNumber(dr["ModuleId"].ToString());
                    apiObject.ModuleName   = (string)dr["ModuleName"];
                    apiObject.View         = UtilityLib.FormatBoolean(dr["View"].ToString());
                    apiObject.Edit         = UtilityLib.FormatBoolean(dr["Edit"].ToString());
                    apiObject.Create       = UtilityLib.FormatBoolean(dr["Create"].ToString());
                    apiObject.Delete       = UtilityLib.FormatBoolean(dr["Delete"].ToString());
                    apiObject.CompanyId    = (Guid)(dr["CompanyId"]);
                    objRightsModelList.Add(apiObject);
                }
            }
            else
            {
                strReturnCode = "002";
                strReturnMsg  = "Fail-Record Not Found";
            }
            strResult = strReturnCode + "|" + strReturnMsg;
            return(objRightsModelList);
        }
        private IList <UOMMasterModel> fnUOMMaster_List(UOMMasterModel apiObject, ref string strResult)
        {
            string strReturnCode = "000";
            string strReturnMsg  = "UnDefined";
            string crCnString    = UtilityLib.GetConnectionString();
            IList <UOMMasterModel> objUOMMasterModelList = new List <UOMMasterModel>();

            DataSet usersInfoDS = DAL_UOMMaster.UOMMaster_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 UOMMasterModel();
                    apiObject.UOMId            = UtilityLib.FormatNumber(dr["UOMId"].ToString());
                    apiObject.UOMTypeId        = UtilityLib.FormatNumber(dr["UOMTypeId"].ToString());
                    apiObject.DecimalPoints    = UtilityLib.FormatNumber(dr["DecimalPoints"].ToString());
                    apiObject.BaseUnit         = (bool)dr["BaseUnit"];
                    apiObject.ConversionRation = UtilityLib.FormatDecimal(dr["ConversionRation"].ToString());
                    apiObject.UOMName          = (string)dr["UOMName"];
                    apiObject.UOMCode          = (string)dr["UOMCode"];
                    apiObject.CompanyId        = (Guid)(dr["CompanyId"]);
                    objUOMMasterModelList.Add(apiObject);
                }
            }
            else
            {
                strReturnCode           = "002";
                apiObject.ReturnMessage = "Fail-Record Not Found";
            }
            strResult = strReturnCode + "|" + strReturnMsg;
            return(objUOMMasterModelList);
        }
        private IList <ProcessMasterModel> fnProcessMaster_List(ProcessMasterModel apiObject, ref string strResult)
        {
            string strReturnCode = "000";
            string strReturnMsg  = "UnDefined";
            string crCnString    = UtilityLib.GetConnectionString();
            IList <ProcessMasterModel> objFieldClassModelList = new List <ProcessMasterModel>();
            DataSet usersInfoDS = DL_ProcessMaster.Process_List(crCnString, apiObject.RequestType, apiObject.SearchBy, apiObject.SearchString,
                                                                apiObject.ProcessId, 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 ProcessMasterModel();
                    apiObject.ProcessId       = UtilityLib.FormatNumber(dr["ProcessId"].ToString());
                    apiObject.ProcessName     = (string)dr["ProcessName"];
                    apiObject.QuantityFlag    = UtilityLib.FormatBoolean(dr["QuantityFlag"].ToString());
                    apiObject.ByProduct       = UtilityLib.FormatBoolean(dr["ByProduct"].ToString());
                    apiObject.WastageFlag     = UtilityLib.FormatBoolean(dr["WastageFlag"].ToString());
                    apiObject.QuantityFlag    = UtilityLib.FormatBoolean(dr["QuantityFlag"].ToString());
                    apiObject.IsDelete        = UtilityLib.FormatBoolean(dr["IsDelete"].ToString());
                    apiObject.ProcessDuration = UtilityLib.FormatDate(dr["ProcessDuration"]).ToString();
                    apiObject.ProcessVolume   = UtilityLib.FormatFloat(dr["ProcessVolume"]);
                    //apiObject.CompanyId = (Guid)(dr["CompanyId"]);
                    objFieldClassModelList.Add(apiObject);
                }
            }
            else
            {
                strReturnCode = "002";
                strReturnMsg  = "Fail-Record Not Found";
            }
            strResult = strReturnCode + "|" + strReturnMsg;
            return(objFieldClassModelList);
        }
        public ProcessMasterModel DeleteProcess(ArrayList paramList)
        {
            string             strResult     = "";
            string             strReturnCode = "000";
            string             strReturnMsg  = "UnDefined";
            ProcessMasterModel apiObject     = new ProcessMasterModel();

            apiObject = Newtonsoft.Json.JsonConvert.DeserializeObject <ProcessMasterModel>(paramList[0].ToString());
            string crCnString  = UtilityLib.GetConnectionString();
            int    Processinfo = DL_ProcessMaster.Delete_Process(crCnString, apiObject.ProcessId);

            if (Processinfo == 101)
            {
                apiObject.ReturnCode    = Processinfo;
                apiObject.ReturnMessage = "Process delete successfully";
            }
            else
            {
                apiObject.ReturnCode    = Processinfo;
                apiObject.ReturnMessage = "Fail-Record Not Delete";
            }
            strResult = strReturnCode + "|" + strReturnMsg;
            return(apiObject);
        }