Beispiel #1
0
        protected override void ShowData(int customTimeLogId)
        {
            base.ShowData(customTimeLogId);

            oDetailButtonPanel.SetId = SetId;

            Clear();

            var dataQuery = new CustomTimeLogDataModel();

            dataQuery.CustomTimeLogId = customTimeLogId;

            var entityList = CustomTimeLogDataManager.GetEntityDetails(dataQuery, SessionVariables.RequestProfile);

            if (entityList.Count == 1)
            {
                foreach (var entityItem in entityList)
                {
                    lblCustomTimeLogId.Text    = entityItem.CustomTimeLogId.ToString();
                    lblCustomTimeLogKey.Text   = entityItem.CustomTimeLogKey;
                    lblPersonId.Text           = entityItem.Person.ToString();
                    lblNoofFilesPromoted.Text  = entityItem.Value.ToString();
                    lblCustomTimeCategory.Text = entityItem.CustomTimeCategory;

                    oUpdateInfo.LoadText(entityItem.UpdatedDate, entityItem.UpdatedBy, entityItem.LastAction);

                    oHistoryList.Setup(PrimaryEntity, customTimeLogId, "CustomTimeLog");
                }
            }
        }
Beispiel #2
0
        public void Delete(string value)
        {
            var dataQuery = new CustomTimeLogDataModel();

            dataQuery.CustomTimeLogId = int.Parse(value);
            CustomTimeLogDataManager.Delete(dataQuery, SessionVariables.RequestProfile);
        }
Beispiel #3
0
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            try
            {
                var      notDeletableIds = new List <int>();
                string[] deleteIndexList = DeleteIds.Split(',');
                foreach (string index in deleteIndexList)
                {
                    var data = new CustomTimeLogDataModel();
                    data.CustomTimeLogId = int.Parse(index);

                    foreach (string index1 in deleteIndexList)
                    {
                        var data1 = new CustomTimeLogDataModel();
                        data1.CustomTimeLogId = int.Parse(index1);
                        CustomTimeLogDataManager.Delete(data1, SessionVariables.RequestProfile);
                    }
                    DeleteAndRedirect();
                }
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
        }
Beispiel #4
0
        protected override void Update(Dictionary <string, string> values)
        {
            var data = new CustomTimeLogDataModel();

            if (values.ContainsKey(CustomTimeLogDataModel.DataColumns.CustomTimeLogId))
            {
                data.CustomTimeLogId = int.Parse(values[CustomTimeLogDataModel.DataColumns.CustomTimeLogId].ToString());
            }

            if (values.ContainsKey(CustomTimeLogDataModel.DataColumns.PersonId))
            {
                data.PersonId = int.Parse(values[CustomTimeLogDataModel.DataColumns.PersonId].ToString());
            }

            if (values.ContainsKey(CustomTimeLogDataModel.DataColumns.PromotedDate))
            {
                data.PromotedDate = DateTime.Parse(values[CustomTimeLogDataModel.DataColumns.PromotedDate].ToString());
            }


            if (values.ContainsKey(CustomTimeLogDataModel.DataColumns.Value))
            {
                data.Value = decimal.Parse(values[CustomTimeLogDataModel.DataColumns.Value].ToString());
            }


            CustomTimeLogDataManager.Update(data, SessionVariables.RequestProfile);
            InlineEditingList.Data = GetData();
        }
Beispiel #5
0
        public void Update([FromBody] dynamic data)
        {
            var jsonString = JsonConvert.SerializeObject(data);
            var dataQuery  = JsonConvert.DeserializeObject <CustomTimeLogDataModel>(jsonString);

            CustomTimeLogDataManager.Update(dataQuery, SessionVariables.RequestProfile);
        }
Beispiel #6
0
        public override int?Save(string action)
        {
            var data = new CustomTimeLogDataModel();

            data.CustomTimeLogId      = CustomTimeLogId;
            data.CustomTimeLogKey     = CustomTimeLogKey;
            data.PersonId             = PersonId;
            data.ApplicationId        = ApplicationId;
            data.CustomTimeCategoryId = CustomTimeCategoryId;
            data.PromotedDate         = WorkDate;
            data.Value = NoofFilesPromoted;


            if (action == "Insert")
            {
                var dtCustomTimeLog = CustomTimeLogDataManager.DoesExist(data, SessionVariables.RequestProfile);

                if (dtCustomTimeLog.Rows.Count == 0)
                {
                    var customTimeLogId = CustomTimeLogDataManager.Create(data, SessionVariables.RequestProfile);
                }
                else
                {
                    throw new Exception("Record with given ID already exists.");
                }
            }
            else
            {
                CustomTimeLogDataManager.Update(data, SessionVariables.RequestProfile);
            }

            return(data.CustomTimeLogId);
        }
Beispiel #7
0
        public List <ResultSet> GetWorkCategoryDetails(int appUserId)
        {
            var appUser = new ScheduleDataModel();

            appUser.PersonId = appUserId;
            var category = string.Empty;

            var result       = new ArrayList();
            var fromDateTime = new DateTime();
            var toDateTime   = new DateTime();


            fromDateTime = Convert.ToDateTime(DateTimeHelper.FromUserDateFormatToApplicationDateFormat(oDateRange.FromDateTime));
            toDateTime   = Convert.ToDateTime(DateTimeHelper.FromUserDateFormatToApplicationDateFormat(oDateRange.ToDateTime));

            var format          = SessionVariables.UserDateFormat;
            var fromDate        = fromDateTime.ToString(format);
            var toDate          = toDateTime.ToString(format);
            var scheduleDetails = new ScheduleDetailDataModel();

            appUser.FromSearchDate = Convert.ToDateTime(fromDate);
            appUser.ToSearchDate   = Convert.ToDateTime(toDate);

            var resultList = new List <ResultSet>();
            var data       = new CustomTimeLogDataModel();

            data.PersonId       = appUserId;
            data.FromSearchDate = Convert.ToDateTime(fromDate);
            data.ToSearchDate   = Convert.ToDateTime(toDate);
            var list = CustomTimeLogDataManager.GetWorkCategoryList(data, SessionVariables.RequestProfile);

            var categoryDetails = list[0].Category;
            var week            = list[0].Week;
            var value           = list[0].Value;
            var weekCount       = 0;

            for (var i = 0; i < list.Count; i++)
            {
                var resultSet = new ResultSet("", "", 0);
                if (week.Equals(list[i].Week))
                {
                    resultSet.Category = list[i].Category;
                    resultSet.Value    = list[i].Value;
                    resultSet.Week     = list[i].Week.ToString();
                    weekCount++;
                }
                else
                {
                    weekCount = 0;
                    week      = list[i].Week;
                }
                //result.Add(resultSet);
                resultList.Add(resultSet);
                //result = new ArrayList();
            }

            return(resultList);
        }
Beispiel #8
0
        public CustomTimeLogDataModel GetById(string value)
        {
            var dataQuery = new CustomTimeLogDataModel();

            dataQuery.CustomTimeLogId = int.Parse(value);
            var result = CustomTimeLogDataManager.GetEntityDetails(dataQuery, SessionVariables.RequestProfile, 1);

            return(result[0]);
        }
Beispiel #9
0
        protected override DataTable GetEntityData(int?entityKey)
        {
            var CustomTimeLogdata = new CustomTimeLogDataModel();

            CustomTimeLogdata.CustomTimeLogId = entityKey;
            var results = CustomTimeLogDataManager.Search(CustomTimeLogdata, SessionVariables.RequestProfile);

            return(results);
        }
Beispiel #10
0
        public void Create([FromBody] dynamic data)
        {
            var jsonString = JsonConvert.SerializeObject(data);
            var dataQuery  = JsonConvert.DeserializeObject <CustomTimeLogDataModel>(jsonString);

            dataQuery.PromotedDate  = DateTime.Now;
            dataQuery.ApplicationId = SessionVariables.RequestProfile.ApplicationId;

            CustomTimeLogDataManager.Create(dataQuery, SessionVariables.RequestProfile);
        }
Beispiel #11
0
        public List <BranchRecord> GetBranchSummaryReportData(string value1, string value2, string value3)
        {
            var applicationUserId = value1;
            var fromSearchDate    = value2;
            var toSearchDate      = value3;

            var dateFormat = "dd.MM.yyyy";

            var customTimeLogData = new CustomTimeLogDataModel();

            customTimeLogData.PersonId       = int.Parse(applicationUserId);
            customTimeLogData.FromSearchDate = DateTime.ParseExact(fromSearchDate, dateFormat, System.Globalization.DateTimeFormatInfo.InvariantInfo);
            customTimeLogData.ToSearchDate   = DateTime.ParseExact(toSearchDate, dateFormat, System.Globalization.DateTimeFormatInfo.InvariantInfo);

            var lstResult = CustomTimeLogDataManager.GetBranchSummaryReportData(customTimeLogData, SessionVariables.RequestProfile);

            return(lstResult);
        }
Beispiel #12
0
        public void LoadData(int customTimeLogId, bool showId)
        {
            // clear UI

            Clear();

            var dataQuery = new CustomTimeLogDataModel();

            dataQuery.CustomTimeLogId = customTimeLogId;

            var items = CustomTimeLogDataManager.GetEntityDetails(dataQuery, SessionVariables.RequestProfile);

            if (items.Count != 1)
            {
                return;
            }

            var item = items[0];

            CustomTimeLogId    = item.CustomTimeLogId;
            CustomTimeLogKey   = item.CustomTimeLogKey;
            PersonId           = item.PersonId;
            ApplicationId      = item.ApplicationId;
            CustomTimeCategory = item.CustomTimeCategory;
            WorkDate           = item.PromotedDate;
            NoofFilesPromoted  = item.Value;


            if (!showId)
            {
                txtCustomTimeLogId.Text = item.CustomTimeLogId.ToString();

                // only show Audit History in case of Update page, not for Clone.
                oHistoryList.Setup((int)SystemEntity.CustomTimeLog, customTimeLogId, "CustomTimeLog");
            }
            else
            {
                txtCustomTimeLogId.Text = String.Empty;
            }

            oUpdateInfo.LoadText(item.UpdatedDate, item.UpdatedBy, item.LastAction);
        }
Beispiel #13
0
        // GET api/summary/GetList
        public IEnumerable <CustomTimeLogDataModel> GetList(string value, string value1)
        {
            var settingCategory = value1;
            var searchString    = value;

            var dictionaryObject = JsonConvert.DeserializeObject <Dictionary <string, string> >(searchString);

            // save search filter parameters in user preference
            if (dictionaryObject != null)
            {
                foreach (var searchFilterColumnName in dictionaryObject.Keys)
                {
                    var searchFilterValue = dictionaryObject[searchFilterColumnName];
                    PerferenceUtility.UpdateUserPreference(settingCategory, searchFilterColumnName, dictionaryObject[searchFilterColumnName]);
                }
            }

            var dataQuery = JsonConvert.DeserializeObject <CustomTimeLogDataModel>(searchString);

            return(CustomTimeLogDataManager.GetEntityDetails(dataQuery, SessionVariables.RequestProfile));
        }
Beispiel #14
0
        protected override DataTable UpdateData()
        {
            var UpdatedData = new DataTable();
            var data        = new CustomTimeLogDataModel();

            UpdatedData = CustomTimeLogDataManager.Search(data, SessionVariables.RequestProfile).Clone();
            for (var i = 0; i < SelectedData.Rows.Count; i++)
            {
                data.CustomTimeLogId =
                    Convert.ToInt32(SelectedData.Rows[i][CustomTimeLogDataModel.DataColumns.CustomTimeLogId].ToString());

                data.PersonId = !string.IsNullOrEmpty(CheckAndGetRepeaterTextBoxValue(CustomTimeLogDataModel.DataColumns.PersonId))
                                        ? int.Parse(CheckAndGetRepeaterTextBoxValue(CustomTimeLogDataModel.DataColumns.PersonId).ToString())
                                        : int.Parse(SelectedData.Rows[i][CustomTimeLogDataModel.DataColumns.PersonId].ToString());

                data.PromotedDate =
                    !string.IsNullOrEmpty(CheckAndGetRepeaterTextBoxValue(CustomTimeLogDataModel.DataColumns.PromotedDate))
                                        ? DateTime.Parse(CheckAndGetRepeaterTextBoxValue(CustomTimeLogDataModel.DataColumns.PromotedDate).ToString())
                                        : DateTime.Parse(SelectedData.Rows[i][CustomTimeLogDataModel.DataColumns.PromotedDate].ToString());



                data.Value =
                    !string.IsNullOrEmpty(CheckAndGetRepeaterTextBoxValue(CustomTimeLogDataModel.DataColumns.Value))
                                        ? decimal.Parse(CheckAndGetRepeaterTextBoxValue(CustomTimeLogDataModel.DataColumns.Value).ToString())
                                        : decimal.Parse(SelectedData.Rows[i][CustomTimeLogDataModel.DataColumns.Value].ToString());


                CustomTimeLogDataManager.Update(data, SessionVariables.RequestProfile);
                data = new CustomTimeLogDataModel();
                data.CustomTimeLogId = Convert.ToInt32(SelectedData.Rows[i][CustomTimeLogDataModel.DataColumns.CustomTimeLogId].ToString());
                var dt = CustomTimeLogDataManager.Search(data, SessionVariables.RequestProfile);

                if (dt.Rows.Count == 1)
                {
                    UpdatedData.ImportRow(dt.Rows[0]);
                }
            }
            return(UpdatedData);
        }
Beispiel #15
0
        protected override DataTable GetData()
        {
            try
            {
                SuperKey = ApplicationCommon.GetSuperKey();
                SetId    = ApplicationCommon.GetSetId();

                var selectedrows      = new DataTable();
                var CustomTimeLogdata = new CustomTimeLogDataModel();

                selectedrows = CustomTimeLogDataManager.GetDetails(CustomTimeLogdata, SessionVariables.RequestProfile).Clone();
                if (!string.IsNullOrEmpty(SuperKey))
                {
                    var systemEntityTypeId = (int)PrimaryEntity;
                    var lstEntityKeys      = ApplicationCommon.GetSuperKeyDetails(systemEntityTypeId, SuperKey);

                    foreach (var entityKey in lstEntityKeys)
                    {
                        CustomTimeLogdata.CustomTimeLogId = entityKey;
                        var result = CustomTimeLogDataManager.GetDetails(CustomTimeLogdata, SessionVariables.RequestProfile);
                        selectedrows.ImportRow(result.Rows[0]);
                    }
                }
                else
                {
                    CustomTimeLogdata.CustomTimeLogId = SetId;
                    var result = CustomTimeLogDataManager.GetDetails(CustomTimeLogdata, SessionVariables.RequestProfile);
                    selectedrows.ImportRow(result.Rows[0]);
                }
                return(selectedrows);
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
            return(null);
        }
Beispiel #16
0
        protected override DataTable GetData()
        {
            var dt = CustomTimeLogDataManager.Search(oSearchFilter.SearchParameters, SessionVariables.RequestProfile);

            return(dt);
        }