Exemplo n.º 1
0
        public dynamic GetMachineSetupDetails(int?companyID, int?loggedUser, int?pageNumber, int?pageSize, int?IsPaging, int?MasterID, int?DetailsID)
        {
            dynamic result = null;

            try
            {
                string spQuery = string.Empty;
                using (_ctxObj = new ERP_Entities())
                {
                    var itemID               = MasterID;
                    var machineID            = DetailsID;
                    PrdDyingMachineSetup ent = (from machineSetup in _ctxObj.PrdDyingMachineSetups
                                                where machineSetup.ItemID == itemID &&
                                                machineSetup.MechineID == ((machineID == 0) ? machineSetup.MechineID : (long)machineID)
                                                select machineSetup).FirstOrDefault();

                    Hashtable ht = new Hashtable();
                    ht.Add("CompanyID", companyID);
                    ht.Add("LoggedUser", loggedUser);
                    ht.Add("MASTERID", MasterID);
                    ht.Add("DETAILSID", ent.SetupID.ToString());
                    spQuery = "[GET_DYINGMACHINESETUP]";
                    using (objectMachineSetupDetails = new dynamic_EF())
                    {
                        result = objectMachineSetupDetails.ExecuteQueryObjectType(spQuery, ht);
                    }
                    return(result);
                }
            }
            catch (Exception ex)
            {
                result = ex.Message.ToString();
                ex.ToString();
            }
            return(0);
        }