コード例 #1
0
        /// <summary>
        /// تعداد افرادی که در محاسبات به خطا خورده اند را بر می گرداند
        /// </summary>
        /// <returns>تعداد</returns>
        public int GetErrorCountInCalculating()
        {
            try
            {
                int errorCount = 0;
                errorCount = gtsEngineWS.GTS_GETTotalErrorExecuting(BUser.CurrentUser.UserName);
                if (SessionHelper.GetSessionValue(SessionHelper.PersonIsFailedForCalculate) != null)
                {
                    errorCount += Convert.ToInt32(SessionHelper.GetSessionValue(SessionHelper.PersonIsFailedForCalculate));
                }
                return(errorCount);
            }
            catch (Exception ex)
            {
                BaseBusiness <Entity> .LogException(ex, "BEngineCalculator", "GetErrorCountInCalculating");

                throw ex;
            }
        }
コード例 #2
0
        public List <string> SaveEventMessageTrans(EventMessageTransSave data)
        {
            try {
                DataTable dtEventMessageTrans = CollectionHelper.ConvertTo(data.EventTransData, "");

                //Remove column which is not required in Table Type
                dtEventMessageTrans.Columns.Remove("SNo");
                dtEventMessageTrans.Columns.Remove("SubProcessName");
                dtEventMessageTrans.Columns.Remove("MessageType");
                dtEventMessageTrans.Columns.Remove("Origin");
                dtEventMessageTrans.Columns.Remove("Destination");

                List <string>  ErrorMessage = new List <string>();
                BaseBusiness   baseBusiness = new BaseBusiness();
                SqlParameter[] param        = { new SqlParameter("@AirlineSNo", data.AirlineSNo),
                                                new SqlParameter("@UpdatedBy",         data.UserSNo),   new SqlParameter("@tt", dtEventMessageTrans) };
                int            ret = (int)SqlHelper.ExecuteScalar(DMLConnectionString.WebConfigConnectionString, "spEventMessageTrans_Create", param);
                if (ret > 0)
                {
                    if (ret > 1000)
                    {
                        string serverErrorMessage = baseBusiness.ReadServerErrorMessages(ret, "EventMessageTrans");
                        if (!string.IsNullOrEmpty(serverErrorMessage))
                        {
                            ErrorMessage.Add(serverErrorMessage);
                        }
                    }
                    else
                    {
                        string dataBaseExceptionMessage = baseBusiness.ReadServerErrorMessages(ret, baseBusiness.DatabaseExceptionFileName);
                        if (!string.IsNullOrEmpty(dataBaseExceptionMessage))
                        {
                            ErrorMessage.Add(dataBaseExceptionMessage);
                        }
                    }
                }
                return(ErrorMessage);
            }
            catch (Exception ex)//(Exception ex)
            {
                throw ex;
            }
        }
コード例 #3
0
        private void Frm_Report_Checkout_Load(object sender, EventArgs e)
        {
            bo = this.swapdata["BusinessObject"] as BaseBusiness;

            dateEdit2.EditValue = DateTime.Today;
            dateEdit1.EditValue = DateTime.Today.AddMonths(-1);

            ac007Adapter.Fill(dt_ac007_source);
            DataRow newrow = dt_ac007_source.NewRow();

            newrow["ST001"] = "%";
            newrow["ST003"] = "全部";
            dt_ac007_source.Rows.Add(newrow);

            lookUp_ac007.Properties.DataSource    = dt_ac007_source;
            lookUp_ac007.Properties.DisplayMember = "ST003";
            lookUp_ac007.Properties.ValueMember   = "ST001";
            lookUp_ac007.EditValue = "%";
        }
コード例 #4
0
        public List <string> UpdateCheckListType(List <CheckListType> CheckListType)
        {
            try
            {
                DataTable     dtCreateCheckListType = CollectionHelper.ConvertTo(CheckListType, "ISIATA,ISSAS,SPHCGroupName,AirportName,CopyFrom,Text_CopyFrom,AirlineName,Text_AirportName,Text_AirlineName,Text_SPHCGroupName,Text_SPHCCode,Text_For,Text_SHC,Text_Type,Text_SPHCSubGroupSNo");
                List <string> ErrorMessage          = new List <string>();
                BaseBusiness  baseBusiness          = new BaseBusiness();
                SqlParameter  param = new SqlParameter();
                param.ParameterName = "@CheckListTypeTable";
                param.SqlDbType     = System.Data.SqlDbType.Structured;
                param.Value         = dtCreateCheckListType;
                SqlParameter[] Parameters = { param };

                int ret = (int)SqlHelper.ExecuteScalar(DMLConnectionString.WebConfigConnectionString, "CheckListTypeUpdate", Parameters);
                if (ret > 0)
                {
                    if (ret > 1000)
                    {
                        //For Customised Validation Messages like 'Record Already Exists' etc
                        string serverErrorMessage = baseBusiness.ReadServerErrorMessages(ret, "CheckListType");
                        if (!string.IsNullOrEmpty(serverErrorMessage))
                        {
                            ErrorMessage.Add(serverErrorMessage);
                        }
                    }
                    else
                    {
                        //For DataBase Exceptions like 'Foreign Key refrence Errors' etc
                        string dataBaseExceptionMessage = baseBusiness.ReadServerErrorMessages(ret, baseBusiness.DatabaseExceptionFileName);
                        if (!string.IsNullOrEmpty(dataBaseExceptionMessage))
                        {
                            ErrorMessage.Add(dataBaseExceptionMessage);
                        }
                    }
                }

                return(ErrorMessage);
            }
            catch (Exception ex)//
            {
                throw ex;
            }
        }
コード例 #5
0
        public List <string> SaveSkillMaster(List <SkillMaster> SkillMaster)
        {
            //validate Business Rule
            List <string> ErrorMessage        = new List <string>();
            DataTable     dtCreateSkillMaster = CollectionHelper.ConvertTo(SkillMaster, "Active");
            BaseBusiness  baseBusiness        = new BaseBusiness();

            if (!baseBusiness.ValidateBaseBusiness("SkillMaster", dtCreateSkillMaster, "SAVE"))
            {
                ErrorMessage = baseBusiness.ErrorMessage;
                return(ErrorMessage);
            }
            SqlParameter param = new SqlParameter();

            param.ParameterName = "@SkillMasterTable";
            param.SqlDbType     = System.Data.SqlDbType.Structured;
            param.Value         = dtCreateSkillMaster;
            SqlParameter[] Parameters = { param };
            int            ret        = (int)SqlHelper.ExecuteScalar(DMLConnectionString.WebConfigConnectionString, "CreateSkillMaster", Parameters);

            if (ret > 0)
            {
                if (ret > 1000)
                {
                    //For Customised Validation Messages like 'Record Already Exists' etc
                    string serverErrorMessage = baseBusiness.ReadServerErrorMessages(ret, "SkillMaster");
                    if (!string.IsNullOrEmpty(serverErrorMessage))
                    {
                        ErrorMessage.Add(serverErrorMessage);
                    }
                }
                else
                {
                    //For DataBase Exceptions like 'Foreign Key refrence Errors' etc
                    string dataBaseExceptionMessage = baseBusiness.ReadServerErrorMessages(ret, baseBusiness.DatabaseExceptionFileName);
                    if (!string.IsNullOrEmpty(dataBaseExceptionMessage))
                    {
                        ErrorMessage.Add(dataBaseExceptionMessage);
                    }
                }
            }
            return(ErrorMessage);
        }
コード例 #6
0
        public string GetIrregularityHistory(int CurrentComplaintSNo)
        {
            try {
                BaseBusiness   baseBusiness = new BaseBusiness();
                SqlParameter[] param        =
                {
                    new SqlParameter("@ComplaintSNo", CurrentComplaintSNo)
                };

                DataSet ds = new DataSet();
                ds = SqlHelper.ExecuteDataset(ReadConnectionString.WebConfigConnectionString, CommandType.StoredProcedure, "GetComplaintIrregulartityRecord", param);
                ds.Dispose();
                return(CargoFlash.Cargo.Business.Common.CompleteDStoJSON(ds));
            }
            catch (Exception ex)//(Exception ex)
            {
                throw ex;
            }
        }
コード例 #7
0
        public List <string> SaveAllotment(List <Allotment> Allotment)
        {
            List <string> ErrorMessage      = new List <string>();
            DataTable     dtCreateAllotment = CollectionHelper.ConvertTo(Allotment, "Text_AircraftSNo,Sector,TotalGross,TotalVolume,ReserveGross,ReserveVolume,TotalGrossUnit,TotalVolumeUnit,ReserveGrossUnit,ReserveVolumeUnit,Text_OriginSNo,Text_DestinationSNo,AllotmentCode,Text_AllotmentType,Text_OfficeSNo,Text_AccountSNo,Text_GrossWeightType,Text_VolumeWeightType,Text_CommodityType,UpdatedBy,Text_Days,Text_ProductSNo,Text_Commodity,Text_FlightNo,Text_ShipperAccountSNo,Text_ProductType,Active,Mandatory,Text_FlightNo,Text_SHC,Text_SHCType,FlightValidFrom,FlightValidTo,IsUsed,FlightDaysOfOps,Text_AirlineSNo,AllotmentReleaseTimeMin,AllotmentReleaseTimeHr");
            BaseBusiness  baseBusiness      = new BaseBusiness();

            if (!baseBusiness.ValidateBaseBusiness("Allotment", dtCreateAllotment, "SAVE"))
            {
                ErrorMessage = baseBusiness.ErrorMessage;
                return(ErrorMessage);
            }
            SqlParameter param = new SqlParameter();

            param.ParameterName = "@AllotmentTable";
            param.SqlDbType     = System.Data.SqlDbType.Structured;
            param.Value         = dtCreateAllotment;
            SqlParameter[] Parameters = { param };

            int ret = (int)SqlHelper.ExecuteScalar(DMLConnectionString.WebConfigConnectionString, "spAllotment_Create", Parameters);

            if (ret > 0)
            {
                if (ret > 1000)
                {
                    //For Customised Validation Messages like 'Record Already Exists' etc
                    string serverErrorMessage = baseBusiness.ReadServerErrorMessages(ret, "Allotment");
                    if (!string.IsNullOrEmpty(serverErrorMessage))
                    {
                        ErrorMessage.Add(serverErrorMessage);
                    }
                }
                else
                {
                    //For DataBase Exceptions like 'Foreign Key refrence Errors' etc
                    string dataBaseExceptionMessage = baseBusiness.ReadServerErrorMessages(ret, baseBusiness.DatabaseExceptionFileName);
                    if (!string.IsNullOrEmpty(dataBaseExceptionMessage))
                    {
                        ErrorMessage.Add(dataBaseExceptionMessage);
                    }
                }
            }
            return(ErrorMessage);
        }
コード例 #8
0
        public int GetSearchCount(PersonAdvanceSearchProxy proxy, int year, int month)
        {
            try
            {
                int            rangeOrder = month;
                ISearchPerson  searchTool = new BPerson();
                IList <Person> personList = searchTool.GetPersonInAdvanceSearch(proxy);
                var            ids        = from o in personList
                                            select o.ID;
                IList <decimal> personIds = archiveRep.GetExsitsArchivePersons(ids.ToList(), year, rangeOrder);
                return(personIds.Count);
            }
            catch (Exception ex)
            {
                BaseBusiness <Entity> .LogException(ex);

                throw ex;
            }
        }
コード例 #9
0
        /// <summary>
        /// نمای گرافیکی گزارش کارکرد ماهیانه کاربر جاری را برمی گرداند
        /// </summary>
        /// <param name="year">سال</param>
        /// <param name="month">ماه</param>
        /// <param name="fromDate">تاریخ ابتدا</param>
        /// <param name="toDate">تاریخ انتها</param>
        /// <returns>لیست سطرهای گزارش کارکرد</returns>
        public IList <PersonalMonthlyReportRow> GetPersonGanttChart(int year, int month, string fromDate, string toDate)
        {
            IList <PersonalMonthlyReportRow> DailyRows = new List <PersonalMonthlyReportRow>();

            try
            {
                if (Utility.IsEmpty(fromDate) || Utility.IsEmpty(toDate))
                {
                    throw new InvalidDatabaseStateException(UIFatalExceptionIdentifiers.PersonDateRangeIsNotDefiend, String.Format("برای شخص {0} رینج محاسبات تعریف نشده است", workingPersonId), ExceptionSrc);
                }
                if (IsValidPeson())
                {
                    DateTime from, to;
                    if (sysLanguageResource == LanguagesName.Parsi)
                    {
                        from = Utility.ToMildiDate(fromDate);
                        to   = Utility.ToMildiDate(toDate);
                    }
                    else
                    {
                        from = Utility.ToMildiDateTime(fromDate);
                        to   = Utility.ToMildiDateTime(toDate);
                    }
                    gtsEngineWS.GTS_ExecuteByPersonID(BUser.CurrentUser.UserName, this.workingPersonId);
                    PersonalMonthlyReport Result = new PersonalMonthlyReport(this.workingPersonId, from, to);
                    Result.LanguageName = sysLanguageResource;

                    DailyRows = Result.PersonalGanttChartRows;
                }
                else
                {
                    throw new IllegalServiceAccess(String.Format("این سرویس بعللت اعتبارسنجی قابل دسترسی نمیباشد. شناسه کاربری {0} میباشد", this.Username), ExceptionSrc);
                }
                return(DailyRows);
            }
            catch (Exception ex)
            {
                BaseBusiness <Entity> .LogException(ex, "BPersonMonthlyWorkedTime", "GetPersonMonthlyReport");

                throw ex;
            }
        }
コード例 #10
0
        /// <summary>
        /// نتایج محاسبات را بارگزاری میکند
        /// </summary>
        /// <param name="year">سال</param>
        /// <param name="month">ماه</param>
        /// <param name="personList">لیست پرسنل</param>
        /// <returns>لیست پروکسی مقادیر نتایج محاسبات محاسبات</returns>
        private IList <ArchiveCalcValuesProxy> GetArchiveValues(int year, int month, IList <Person> personList)
        {
            try
            {
                //personList = this.CheckMaxArrayParamCount(personList);
                IList <ArchiveCalcValuesProxy> resultList = new List <ArchiveCalcValuesProxy>();
                DateTime date       = new DateTime(year, month, Utility.GetEndOfMiladiMonth(year, month));
                int      rangeOrder = month;

                if (BLanguage.CurrentSystemLanguage == LanguagesName.Parsi)
                {
                    date = Utility.ToMildiDate(String.Format("{0}/{1}/{2}", year, month, Utility.GetEndOfPersianMonth(year, month)));
                }

                var ids = from o in personList
                          select o.ID;
                IList <ArchiveConceptValue> archiveValues = archiveRep.LoadArchiveValueList(ids.ToList(), year, rangeOrder);

                IList <ArchiveFieldMap> fildsMapList = mapRep.GetAll();

                foreach (Person prs in personList)
                {
                    if (archiveValues.Any(x => x.PersonId == prs.ID))
                    {
                        ArchiveCalcValuesProxy proxy = new ArchiveCalcValuesProxy()
                        {
                            PersonId = prs.ID, PersonCode = prs.PersonCode, PersonName = prs.Name
                        };
                        proxy = SetMapValue(proxy, prs.ID, archiveValues, fildsMapList);
                        resultList.Add(proxy);
                    }
                }

                return(resultList);
            }
            catch (Exception ex)
            {
                BaseBusiness <Entity> .LogException(ex);

                throw ex;
            }
        }
コード例 #11
0
        //protected static void GetLog(Exception ex,string className,string methodName,string exceptionSource)
        //{
        //    BaseBusiness<Report>.LogException(ex, className, methodName, exceptionSource);
        //}

        public static IDictionary <string, object> ParsParameter(string parameters)
        {
            try
            {
                if (Utility.IsEmpty(parameters))
                {
                    return(null);
                }
                DateTime toDate = new DateTime();
                if (!parameters.Contains("@") || !parameters.Contains("=") || !parameters.Contains(";") ||
                    Utility.CharOccuranceCount(parameters, "@") != Utility.CharOccuranceCount(parameters, "=") ||
                    Utility.CharOccuranceCount(parameters, "@") != Utility.CharOccuranceCount(parameters, ";"))
                {
                    throw new ReportParameterIsNotMatchException(UIFatalExceptionIdentifiers.ReportParameterParsingSplitSign, "فرمت پارامتر های ارسالی جهت ترجمه نادرست است", ExceptionSrc);
                }

                string[] parts = Utility.Spilit(parameters, ';');
                IDictionary <string, object> ParamValues = new Dictionary <string, object>();
                foreach (string part in parts.Where(x => x.Length > 0).ToArray())
                {
                    string[] parmValues = Utility.Spilit(part, '=');
                    if (parmValues.Length == 2 && parmValues[0].Contains('@'))
                    {
                        string paramName  = parmValues[0].Replace("@", "");
                        string paramvalue = parmValues[1];
                        ParamValues.Add(paramName, paramvalue);
                    }
                    else
                    {
                        throw new ReportParameterIsNotMatchException(UIFatalExceptionIdentifiers.ReportParameterParsingIsNotMatch, "پارامترهای ارسالی جهت بازگشایی کامل نیستند", ExceptionSrc);
                    }
                }
                return(ParamValues);
            }

            catch (Exception ex)
            {
                BaseBusiness <Report> .LogException(ex);

                throw ex;
            }
        }
コード例 #12
0
        public List <string> SaveCreditLimitUpdate(List <CreditLimitUpdate> CreditLimitUpdate)
        {
            List <string> ErrorMessage = new List <string>();

            try
            {
                DataTable    dtCreateCreditLimitUpdate = CollectionHelper.ConvertTo(CreditLimitUpdate, "");
                BaseBusiness baseBusiness = new BaseBusiness();
                SqlParameter param        = new SqlParameter();
                param.ParameterName = "@CreditLimitUpdateTable";
                param.SqlDbType     = System.Data.SqlDbType.Structured;
                param.Value         = dtCreateCreditLimitUpdate;
                SqlParameter[] Parameters = { param };
                int            ret        = (int)SqlHelper.ExecuteScalar(DMLConnectionString.WebConfigConnectionString, "UpdateCreditLimitAgent", Parameters);
                if (ret > 0)
                {
                    if (ret > 1000)
                    {
                        //For Customised Validation Messages like 'Record Already Exists' etc
                        string serverErrorMessage = baseBusiness.ReadServerErrorMessages(ret, "CreditLimitUpdate");
                        if (!string.IsNullOrEmpty(serverErrorMessage))
                        {
                            ErrorMessage.Add(serverErrorMessage);
                        }
                    }
                    else
                    {
                        //For DataBase Exceptions like 'Foreign Key refrence Errors' etc
                        string dataBaseExceptionMessage = baseBusiness.ReadServerErrorMessages(ret, baseBusiness.DatabaseExceptionFileName);
                        if (!string.IsNullOrEmpty(dataBaseExceptionMessage))
                        {
                            ErrorMessage.Add(dataBaseExceptionMessage);
                        }
                    }
                }
            }
            catch (Exception ex)//
            {
                throw ex;
            }
            return(ErrorMessage);
        }
コード例 #13
0
        public List <string> UpdateAlertEventType(AlertEventType alertEventType)
        {
            //validate Business Rule

            List <string> ErrorMessage = new List <string>();
            BaseBusiness  baseBusiness = new BaseBusiness();

            SqlParameter[] Parameters =
            {
                new SqlParameter("@AlertSNo",           alertEventType.SNo),
                new SqlParameter("@AlertEventTypeName", alertEventType.AlertEventTypeName),
                new SqlParameter("@UpdatedBy",          alertEventType.UpdatedBy),
                new SqlParameter("@IsActive",           alertEventType.IsActive),
            };

            //DataSet ds = SqlHelper.ExecuteDataset(DMLConnectionString.WebConfigConnectionString, CommandType.StoredProcedure, "UpdateAlertEventType", Parameters);
            int ret = (int)SqlHelper.ExecuteScalar(DMLConnectionString.WebConfigConnectionString, "UpdateAlertEventType", Parameters);

            if (ret > 0)
            {
                if (ret > 1000)
                {
                    //For Customised Validation Messages like 'Record Already Exists' etc
                    string serverErrorMessage = baseBusiness.ReadServerErrorMessages(ret, "AlertEventType");
                    if (!string.IsNullOrEmpty(serverErrorMessage))
                    {
                        ErrorMessage.Add(serverErrorMessage);
                    }
                }
                else
                {
                    //For DataBase Exceptions like 'Foreign Key refrence Errors' etc
                    string dataBaseExceptionMessage = baseBusiness.ReadServerErrorMessages(ret, baseBusiness.DatabaseExceptionFileName);
                    if (!string.IsNullOrEmpty(dataBaseExceptionMessage))
                    {
                        ErrorMessage.Add(dataBaseExceptionMessage);
                    }
                }
            }

            return(ErrorMessage);
        }
コード例 #14
0
        public int GetSearchCount(string searchKey, int year, int month)
        {
            try
            {
                int            rangeOrder = month;
                ISearchPerson  searchTool = new BPerson();
                int            totalCount = searchTool.GetPersonInQuickSearchCount(searchKey);
                IList <Person> personList = searchTool.QuickSearchByPage(0, totalCount, searchKey);
                var            ids        = from o in personList
                                            select o.ID;
                IList <decimal> personIds = archiveRep.GetExsitsArchivePersons(ids.ToList(), year, rangeOrder);
                return(personIds.Count);
            }
            catch (Exception ex)
            {
                BaseBusiness <Entity> .LogException(ex);

                throw ex;
            }
        }
コード例 #15
0
        protected void dgDoktorlar_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            int index = Convert.ToInt32(e.CommandArgument);

            if (e.CommandName == "duzenle")
            {
                txtDoktorAd.Text    = dgDoktorlar.Rows[index].Cells[3].Text;
                txtDoktorSoyad.Text = dgDoktorlar.Rows[index].Cells[4].Text;
                hfGizliAlan.Value   = dgDoktorlar.Rows[index].Cells[2].Text;
                hfGizliAlan2.Value  = dgDoktorlar.Rows[index].Cells[5].Text;
            }
            else if (e.CommandName == "sil")
            {
                Doktor d = new Doktor();
                d.ID = Convert.ToInt32(dgDoktorlar.Rows[index].Cells[2].Text);
                BaseBusiness <Doktor> dr = new BaseBusiness <Doktor>();
                dr.Sil(d);
                Temizle();
            }
        }
コード例 #16
0
        public void DeletePersonnelMonthlyExceptionShifts(decimal personnelID, IList <DateTime> MonthDatesList)
        {
            try
            {
                for (int i = 0; i < MonthDatesList.Count(); i++)
                {
                    ShiftException shiftException = this.objectRep.GetPersonnelExceptionShiftByDate(personnelID, MonthDatesList[i]);
                    if (shiftException != null)
                    {
                        base.Delete(shiftException);
                    }
                }
            }
            catch (Exception ex)
            {
                BaseBusiness <ShiftException> .LogException(ex, "BMonthlyExceptionShifts", "DeletePersonnelMonthlyExceptionShifts");

                throw ex;
            }
        }
コード例 #17
0
        public List <string> UpdateConsumableStock(int ConsumableStockTransSno, int ConsumableSno, decimal TareWeight, string IsActive, string EquipmentNbr)
        {
            BaseBusiness  baseBusiness = new BaseBusiness();
            List <string> ErrorMessage = new List <string>();
            int           ret          = 0;

            //DataTable dtItemList = CollectionHelper.ConvertTo(ItemList, "");
            // var dtItemList = JsonConvert.DeserializeObject<DataTable>(ItemList);
            SqlParameter[] Parameters = { new SqlParameter("@ConsumableStockTransSno", ConsumableStockTransSno),
                                          new SqlParameter("@ConsumableSno",           ConsumableSno),
                                          new SqlParameter("@TareWeight",              TareWeight),
                                          new SqlParameter("@IsActive",                IsActive),
                                          new SqlParameter("@EquipmentNbr",            EquipmentNbr),
                                          new SqlParameter("@UpdatedBy",               ((CargoFlash.Cargo.Model.UserLogin)(System.Web.HttpContext.Current.Session["UserDetail"])).UserSNo.ToString()) };

            ret = (int)SqlHelper.ExecuteScalar(DMLConnectionString.WebConfigConnectionString, "UpdateConsumableStock", Parameters);

            if (ret > 0)
            {
                if (ret > 1000)
                {
                    //For Customised Validation Messages like 'Record Already Exists' etc
                    string serverErrorMessage = baseBusiness.ReadServerErrorMessages(ret, "ConsumableStock");
                    if (!string.IsNullOrEmpty(serverErrorMessage))
                    {
                        ErrorMessage.Add(serverErrorMessage);
                    }
                }
                else
                {
                    //For DataBase Exceptions like 'Foreign Key refrence Errors' etc
                    string dataBaseExceptionMessage = baseBusiness.ReadServerErrorMessages(ret, baseBusiness.DatabaseExceptionFileName);
                    if (!string.IsNullOrEmpty(dataBaseExceptionMessage))
                    {
                        ErrorMessage.Add(dataBaseExceptionMessage);
                    }
                }
            }

            return(ErrorMessage);
        }
コード例 #18
0
ファイル: BWorkedTime.cs プロジェクト: ImanRezaeipour/GTS
        /// <summary>
        /// مانده مرخصی را انتهای ماه برمیگرداند
        /// </summary>
        /// <param name="personId"></param>
        /// <param name="year"></param>
        /// <param name="month"></param>
        /// <returns></returns>
        private string GetReaiLeaveToEndMonth(decimal personId, int year, int month)
        {
            string remain = "";

            try
            {
                ILeaveInfo leaveInfo = new BRemainLeave();
                int        day, minutes;
                leaveInfo.GetRemainLeaveToEndOfMonth(personId, year, month, out day, out minutes);
                int hour = (minutes / 60);
                int min = minutes % 60;
                if (BLanguage.CurrentLocalLanguage == LanguagesName.Parsi)
                {
                    remain = String.Format(" {0} روز و {1} ساعت و {2} دقیقه", day, hour, min);
                }
                else if (BLanguage.CurrentLocalLanguage == LanguagesName.English)
                {
                    remain = String.Format(" {0} days and {1} hours and {2} minutes", day, hour, min);
                }
            }
            catch (InvalidDatabaseStateException ex)
            {
                BaseBusiness <Entity> .LogException(ex, "BWorkdTime", "GetReaiLeaveToEndMonth");

                if (BLanguage.CurrentLocalLanguage == LanguagesName.Parsi)
                {
                    remain = " محاسبه نشده";
                }
                else if (BLanguage.CurrentLocalLanguage == LanguagesName.English)
                {
                    remain = "Not Calculated";
                }
            }
            catch (Exception ex)
            {
                BaseBusiness <Entity> .LogException(ex, "BWorkdTime", "GetReaiLeaveToEndMonth");

                throw ex;
            }
            return(remain);
        }
コード例 #19
0
        private void btnGuncelle_Click(object sender, EventArgs e)
        {
            DialogResult rs = MessageBox.Show("Onaylıyor Musunuz?", "Onay", MessageBoxButtons.YesNo);

            if (rs == DialogResult.Yes)
            {
                BaseBusiness <Doktor> bs = new BaseBusiness <Doktor>();
                Doktor dr = new Doktor();
                dr.Ad           = txtDoktorAdi.Text.YaziyiDuzelt();
                dr.Soyad        = txtDoktorSoyadi.Text.YaziyiDuzelt();
                dr.PoliklinikID = Convert.ToInt32(cbPoliklinik.SelectedValue);
                dr.ID           = Convert.ToInt32(dgvDoktorlar.CurrentRow.Cells["ID"].Value);
                bs.Guncelle(dr);
                btnGuncelle.Enabled  = false;
                btnKaydet.Enabled    = true;
                dgvDoktorlar.Enabled = true;
                txtDoktorAdi.Text    = "";
                txtDoktorSoyadi.Text = "";
                dgvDoktorlar.DatagridviewaDoktorGetir(cbPoliklinik.SelectedValue.ToString());
            }
        }
コード例 #20
0
 public List <string> NewCashRegister(string CashierID, string GroupSNo)
 {
     try
     {
         int            ret           = 0;
         List <string>  ErrorMessage  = new List <string>();
         BaseBusiness   baseBussiness = new BaseBusiness();
         SqlParameter[] Parameters    =
         {
             new SqlParameter("@CashierID", CashierID),
             new SqlParameter("@GroupSNo",  GroupSNo)
         };
         ret = (int)SqlHelper.ExecuteScalar(DMLConnectionString.WebConfigConnectionString, "NewCashRegister", Parameters);
         ErrorMessage.Add(Convert.ToString(ret));
         return(ErrorMessage);
     }
     catch (Exception ex)//(Exception ex)
     {
         throw ex;
     }
 }
コード例 #21
0
        public string CreateIssueConsumables(List <IssueConsumablesList> lstConsumabIssue)
        {
            BaseBusiness  baseBusiness = new BaseBusiness();
            List <string> ErrorMessage = new List <string>();
            int           ret          = 0;

            try
            {
                DataTable dtlstConsumabIssue = CollectionHelper.ConvertTo(lstConsumabIssue, "");
                //  var dtlstConsumabIssue = JsonConvert.DeserializeObject<DataTable>(lstConsumabIssue);


                SqlParameter[] Parameters = { new SqlParameter("@IssueConsumablesTable", dtlstConsumabIssue), new SqlParameter("@UpdatedBy", ((CargoFlash.Cargo.Model.UserLogin)(System.Web.HttpContext.Current.Session["UserDetail"])).UserSNo.ToString()) };
                ret = (int)SqlHelper.ExecuteScalar(DMLConnectionString.WebConfigConnectionString, "CreateIssueConsumables", Parameters);
            }
            catch (Exception ex)//
            {
                throw ex;
            }
            return(ret.ToString());
        }
コード例 #22
0
        public string AWBSwap(string AWBList, string SwapAWBList)
        {
            BaseBusiness  baseBusiness = new BaseBusiness();
            List <string> ErrorMessage = new List <string>();
            int           ret          = 0;

            try
            {
                var dtAWBList     = JsonConvert.DeserializeObject <DataTable>(AWBList);
                var dtSwapAWBList = JsonConvert.DeserializeObject <DataTable>(SwapAWBList);


                SqlParameter[] Parameters = { new SqlParameter("@AWBList", dtAWBList), new SqlParameter("@SwapAWBList", dtSwapAWBList) };
                ret = (int)SqlHelper.ExecuteScalar(DMLConnectionString.WebConfigConnectionString, "SwapAWB", Parameters);
            }
            catch (Exception ex)//
            {
                throw ex;
            }
            return(ret.ToString());
        }
コード例 #23
0
        private void btnGuncelle_Click(object sender, EventArgs e)
        {
            DialogResult rs = MessageBox.Show("Güncellemek istediğinizden emin misiniz?", "Emin Misininiz?", MessageBoxButtons.YesNo);

            if (rs == DialogResult.Yes)
            {
                BaseBusiness <object> bs   = new BaseBusiness <object>();
                Poliklinik            temp = new Poliklinik();
                temp.Adi       = txtPoliklinikAdi.Text.YaziyiDuzelt();;
                temp.ID        = Convert.ToInt32(lbPoliklinikler.SelectedValue);
                temp.HastaneID = Convert.ToInt32(cbHastane.SelectedValue);
                bs.Guncelle(temp);
                lbPoliklinikler.ListboxaPoliklinikGetir(cbHastane.SelectedValue.ToString());
                MessageBox.Show("Poliklinik Güncellendi", "Başarılı");
            }
            txtPoliklinikAdi.Text         = "";
            lbPoliklinikler.SelectedIndex = -1;
            btnGuncelle.Enabled           = false;
            btnKaydet.Enabled             = true;
            lbPoliklinikler.Enabled       = true;
        }
コード例 #24
0
ファイル: BWorkedTime.cs プロジェクト: ImanRezaeipour/GTS
        /// <summary>
        /// با دریافت یک گره از درخت تحت مدیریت مدیر تعداد اشخاص تحت مدیریت را برمیگرداند
        /// </summary>
        /// <param name="departmentID"></param>
        /// <returns></returns>
        public int GetUnderManagmentByDepartmentCount(int month, decimal departmentID)
        {
            try
            {
                if (BLanguage.CurrentSystemLanguage == LanguagesName.Parsi)
                {
                    if (month <= 0)
                    {
                        month = Utility.ToPersianDateTime(DateTime.Now).Month;
                    }
                }
                else
                {
                    if (month <= 0)
                    {
                        month = DateTime.Now.Month;
                    }
                }
                if (InitManager())
                {
                    int Result = managerRepository.GetUnderManagmentByDepartmentCount(GridSearchFields.NONE, BUser.CurrentUser.Person.ID, departmentID, "", "");
                    return(Result);
                }
                else if (InitOperator())
                {
                    int Result = managerRepository.GetUnderManagmentOperatorByDepartmentCount(GridSearchFields.NONE, BUser.CurrentUser.Person.ID, departmentID, "", "");
                    return(Result);
                }
                else
                {
                    throw new IllegalServiceAccess(String.Format("این سرویس تنها توسط مدیران قابل استفاده میباشد. شناسه کاربری {0} میباشد", this.Username), ExceptionSrc);
                }
            }
            catch (Exception ex)
            {
                BaseBusiness <Entity> .LogException(ex, "BWorkedTime", "GetUnderManagmentByDepartmentCount");

                throw ex;
            }
        }
コード例 #25
0
        public bool Calculate(decimal personId, string fromDate, string toDate, bool forceCalculate)
        {
            try
            {
                DateTime from, to;
                if (BLanguage.CurrentSystemLanguage == LanguagesName.Parsi)
                {
                    from = Utility.ToMildiDate(fromDate);
                    to   = Utility.ToMildiDate(toDate);
                }
                else
                {
                    from = Utility.ToMildiDateTime(fromDate);
                    to   = Utility.ToMildiDateTime(toDate);
                }
                decimal[] ids = new decimal[1];
                ids[0] = personId;
                if (forceCalculate)
                {
                    BusinessEntity entity = new BusinessEntity();
                    entity.UpdateCFP(new List <Person>()
                    {
                        new Person()
                        {
                            ID = personId
                        }
                    }, from, true);
                }
                gtsEngineWS.GTS_ExecutePersonsByToDate(BUser.CurrentUser.UserName, ids, to);
                BaseBusiness <Entity> .LogUserAction(String.Format("CalculateAll -> personId: {0} -->Calculate(personId,toDate)", personId));

                return(true);
            }
            catch (Exception ex)
            {
                BaseBusiness <Entity> .LogException(ex, "BEngineCalculator", "Calculate(personId,toDate)");

                throw ex;
            }
        }
コード例 #26
0
ファイル: BTraffic.cs プロジェクト: ImanRezaeipour/GTS
        public IList <ProceedTrafficProxy> GetAllTrafic(decimal prsId, DateTime fromDate, DateTime toDate)
        {
            IList <ProceedTrafficProxy> list3;

            try
            {
                EntityRepository <ProceedTraffic> repository = new EntityRepository <ProceedTraffic>();
                List <ProceedTrafficProxy>        list       = new List <ProceedTrafficProxy>();
                CriteriaStruct[] structArray = new CriteriaStruct[3];
                Person           person      = new Person();
                person.ID = prsId;

                IList <ProceedTraffic> byCriteria = repository.GetByCriteria(new CriteriaStruct(Utility.GetPropertyName(() => new ProceedTraffic().Person), new Person()
                {
                    ID = prsId
                }),
                                                                             new CriteriaStruct(Utility.GetPropertyName(() => new ProceedTraffic().FromDate), fromDate, CriteriaOperation.GreaterEqThan),
                                                                             new CriteriaStruct(Utility.GetPropertyName(() => new ProceedTraffic().FromDate), toDate, CriteriaOperation.LessEqThan));
                foreach (ProceedTraffic traffic in byCriteria)
                {
                    for (int i = 0; i < traffic.Pairs.Count; i++)
                    {
                        ProceedTrafficProxy item = new ProceedTrafficProxy();
                        item.From     = Utility.IntTimeToRealTime(traffic.Pairs[i].From);
                        item.To       = Utility.IntTimeToRealTime(traffic.Pairs[i].To);
                        item.Pishcard = traffic.Pairs[i].Precard.Name;
                        item.Date     = Utility.ToString(traffic.FromDate);
                        list.Add(item);
                    }
                }
                list3 = list;
            }
            catch (Exception exception)
            {
                BaseBusiness <BasicTraffic> .LogException(exception);

                throw exception;
            }
            return(list3);
        }
コード例 #27
0
 public List <string> UpdateMessageTypeMaster(List <MessageTypeMasterTrans> MessageTypeMasterInfoUpdate, string MessageDescription)
 {
     try
     {
         //validate Business Rule
         DataTable      dtUpdateMessageTypeMaster = CollectionHelper.ConvertTo(MessageTypeMasterInfoUpdate, "");
         List <string>  ErrorMessage = new List <string>();
         BaseBusiness   baseBusiness = new BaseBusiness();
         SqlParameter[] param        = { new SqlParameter("@MessageTypeMasterTable", dtUpdateMessageTypeMaster),
                                         new SqlParameter("@MessageDescription",            MessageDescription),
                                         new SqlParameter("@UpdatedBy",                     ((CargoFlash.Cargo.Model.UserLogin)(System.Web.HttpContext.Current.Session["UserDetail"])).UserSNo.ToString()) };
         int            ret = (int)SqlHelper.ExecuteScalar(DMLConnectionString.WebConfigConnectionString, "UpdateMessageTypeMaster", param);
         if (ret > 0)
         {
             if (ret > 1000)
             {
                 //For Customised Validation Messages like 'Record Already Exists' etc
                 string serverErrorMessage = baseBusiness.ReadServerErrorMessages(ret, "ULDInCompatibility");
                 if (!string.IsNullOrEmpty(serverErrorMessage))
                 {
                     ErrorMessage.Add(serverErrorMessage);
                 }
             }
             else
             {
                 //For DataBase Exceptions like 'Foreign Key refrence Errors' etc
                 string dataBaseExceptionMessage = baseBusiness.ReadServerErrorMessages(ret, baseBusiness.DatabaseExceptionFileName);
                 if (!string.IsNullOrEmpty(dataBaseExceptionMessage))
                 {
                     ErrorMessage.Add(dataBaseExceptionMessage);
                 }
             }
         }
         return(ErrorMessage);
     }
     catch (Exception ex)//(Exception ex)
     {
         throw ex;
     }
 }
コード例 #28
0
        public IList <ArchiveFieldMap> GetArchiveGridSettings()
        {
            try
            {
                IList <ArchiveFieldMap> mapList = mapRep.GetAll();
                foreach (ArchiveFieldMap map in mapList)
                {
                    if (Utility.IsEmpty(map.PId))
                    {
                        map.Visible = false;
                    }
                    else if (!map.PId.ToLower().StartsWith("p"))
                    {
                        map.Visible = false;
                    }

                    if (map.Visible)
                    {
                        if (BLanguage.CurrentLocalLanguage == LanguagesName.Parsi)
                        {
                            map.Title      = map.FnTitle;
                            map.ColumnSize = map.FnColumnSize;
                        }
                        else
                        {
                            map.Title      = map.EnTitle;
                            map.ColumnSize = map.EnColumnSize;
                        }
                    }
                }

                return(mapList);
            }
            catch (Exception ex)
            {
                BaseBusiness <Entity> .LogException(ex);

                throw ex;
            }
        }
コード例 #29
0
        // for update record
        public List <string> UpdateIndustryType(List <IndustryType> IndustryType)
        {
            int           ret           = 0;
            List <string> ErrorMessage  = new List <string>();
            BaseBusiness  baseBussiness = new BaseBusiness();

            SqlParameter[] Parameters =
            {
                new SqlParameter("@SNo",              IndustryType[0].SNo),
                new SqlParameter("@IndustryTypeName", IndustryType[0].IndustryTypeName),
                new SqlParameter("@IndustryTypeDesc", IndustryType[0].IndustryTypeDesc),
                new SqlParameter("@IsActive",         IndustryType[0].IsActive),
                new SqlParameter("@CreatedBy",        IndustryType[0].CreatedBy),
                new SqlParameter("@UpdatedBy",        IndustryType[0].UpdatedBy)
            };

            ret = (int)SqlHelper.ExecuteScalar(DMLConnectionString.WebConfigConnectionString, "UpdateIndustryType", Parameters);
            if (ret > 0)
            {
                if (ret > 1000)
                {
                    string serverErrorMessage = baseBussiness.ReadServerErrorMessages(ret, "IndustryType");
                    if (!string.IsNullOrEmpty(serverErrorMessage))
                    {
                        ErrorMessage.Add(serverErrorMessage);
                    }
                }
                else
                {
                    //For DataBase Exceptions like 'Foreign Key refrence Errors' etc
                    string dataBaseExceptionMessage = baseBussiness.ReadServerErrorMessages(ret, baseBussiness.DatabaseExceptionFileName);
                    if (!string.IsNullOrEmpty(dataBaseExceptionMessage))
                    {
                        ErrorMessage.Add(dataBaseExceptionMessage);
                    }
                }
            }
            return(ErrorMessage);
        }
コード例 #30
0
        /// <summary>
        /// delete the perticular AccountTarget touple
        /// </summary>
        /// <param name="RecordID">Id of that AccountTarget touple</param>
        public List <string> deleteAccountTarget(string recordID)
        {
            List <string> ErrorMessage = new List <string>();

            try
            {
                int ret = 0;

                BaseBusiness   baseBussiness = new BaseBusiness();
                int            userSNo       = ((CargoFlash.Cargo.Model.UserLogin)(System.Web.HttpContext.Current.Session["UserDetail"])).UserSNo;
                SqlParameter[] Parameters    = { new SqlParameter("@SNo", recordID), new SqlParameter("@UserID", userSNo) };
                ret = (int)SqlHelper.ExecuteScalar(DMLConnectionString.WebConfigConnectionString, "DeleteAccountTarget", Parameters);
                if (ret > 0)
                {
                    if (ret > 1000)
                    {
                        string serverErrorMessage = baseBussiness.ReadServerErrorMessages(ret, "AccountTarget");
                        if (!string.IsNullOrEmpty(serverErrorMessage))
                        {
                            ErrorMessage.Add(serverErrorMessage);
                        }
                    }
                    else
                    {
                        //For DataBase Exceptions like 'Foreign Key refrence Errors' etc
                        string dataBaseExceptionMessage = baseBussiness.ReadServerErrorMessages(ret, baseBussiness.DatabaseExceptionFileName);
                        if (!string.IsNullOrEmpty(dataBaseExceptionMessage))
                        {
                            ErrorMessage.Add(dataBaseExceptionMessage);
                        }
                    }
                }
            }
            catch (Exception ex)//
            {
                throw ex;
            }
            return(ErrorMessage);
        }