public Hr_EmpOverTime_Settings GetOverTimeSettingDataByBranchandCompany(string strCompany_Id, string strBranch_Id)
        {
            StackFrame stackFrame = new StackFrame();
            MethodBase methodBase = stackFrame.GetMethod();


            try
            {
                OpenEntityConnection();

                Hr_EmpOverTime_Settings ObjEmpOverTime_Settings = (from objLinq in objPharmaEntities.Hr_EmpOverTime_Settings
                                                                   where objLinq.Company_Id == strCompany_Id && objLinq.Branch_Id == strBranch_Id
                                                                   select objLinq).FirstOrDefault();

                if (ObjEmpOverTime_Settings != null)
                {
                    Hr_EmpOverTime_Settings objEmpOverTime_SettingsDL = new Hr_EmpOverTime_Settings();

                    {
                        objEmpOverTime_SettingsDL.Branch_Id            = ObjEmpOverTime_Settings.Branch_Id;
                        objEmpOverTime_SettingsDL.Company_Id           = ObjEmpOverTime_Settings.Company_Id;
                        objEmpOverTime_SettingsDL.CalcHourInVactionDay = ObjEmpOverTime_Settings.CalcHourInVactionDay;
                        objEmpOverTime_SettingsDL.CalcHourInWorkingDay = ObjEmpOverTime_Settings.CalcHourInWorkingDay;
                    }
                    return(objEmpOverTime_SettingsDL);
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception ex)
            {
                catchEntityvalidation((System.Data.Entity.Validation.DbEntityValidationException)ex, System.Runtime.InteropServices.Marshal.GetExceptionCode().ToString(),
                                      this.UserNameProperty.ToString(), this.GetType().Name.ToString(), methodBase.Name.ToString());
                ex.InnerException.Message.ToString();
                return(null);
            }
            finally
            {
                CloseEntityConnection();
            }
        }
        public bool SaveOverTimeSettingData(Hr_EmpOverTime_Settings objList)
        {
            StackFrame stackFrame = new StackFrame();
            MethodBase methodBase = stackFrame.GetMethod();


            try
            {
                OpenEntityConnection();


                int Result = 0;
                //   string emSerialNo = (objList.EmpSerialForDocNotify == null ? 0 : objList.EmpSerialForDocNotify).ToString();



                Hr_EmpOverTime_Settings ObjForUpdate = (from objLinq in objPharmaEntities.Hr_EmpOverTime_Settings
                                                        where objLinq.Company_Id == objList.Company_Id && objLinq.Branch_Id == objList.Branch_Id
                                                        select objLinq).FirstOrDefault();
                if (ObjForUpdate != null)
                {
                    ObjForUpdate.CalcHourInVactionDay = objList.CalcHourInVactionDay;
                    ObjForUpdate.CalcHourInWorkingDay = objList.CalcHourInWorkingDay;
                    Result = objPharmaEntities.SaveChanges();

                    return(Result > 0);
                }
                else
                {
                    if (objList != null)
                    {
                        Hr_EmpOverTime_Settings loclDtls = new Hr_EmpOverTime_Settings
                        {
                            Branch_Id            = objList.Branch_Id,
                            Company_Id           = objList.Company_Id,
                            CalcHourInVactionDay = objList.CalcHourInVactionDay,
                            CalcHourInWorkingDay = objList.CalcHourInWorkingDay,
                        };

                        objPharmaEntities.Hr_EmpOverTime_Settings.Add(loclDtls);
                        //saves all above operations within one transaction
                        Result = objPharmaEntities.SaveChanges();
                        return(Result > 0);
                    }
                    else
                    {
                        return(false);
                    }
                }
            }
            catch (Exception ex)
            {
                catchEntityvalidation((System.Data.Entity.Validation.DbEntityValidationException)ex, System.Runtime.InteropServices.Marshal.GetExceptionCode().ToString(),
                                      this.UserNameProperty.ToString(), this.GetType().Name.ToString(), methodBase.Name.ToString());
                ex.InnerException.Message.ToString();
                return(false);
            }
            finally
            {
                CloseEntityConnection();
            }
        }