//        protected void MarkSaveColaboration(object sender, EventArgs e)
        //        {
        //            //var te = hiddenvalue.Value;
        //            var SumRowData = GridviewToolVerification.VisibleRowCount;
        //            for (int i = 0; i < SumRowData; i++)
        //            {
        //                var ValueId = GridviewToolVerification.GetCurrentPageRowValues("Id")[i];
        //                var ValueToolSetupId = GridviewToolVerification.GetCurrentPageRowValues("ToolSetupId")[i];
        //                var ValueInventory = GridviewToolVerification.GetCurrentPageRowValues("InventoryNumber")[i];
        //                var iList = ToolCalibrationRepository.RetrieveDataToolCalibration(ValueId.ToString(), ValueInventory.ToString());
        //                var varGetData = GridviewToolVerification.FindDetailRowTemplateControl(i, "LayoutDetails") as ASPxFormLayout;
        //                if (varGetData != null)
        //                {
        //                    var GetVerDate = varGetData.FindControl("lblVerificationDate") as ASPxLabel;
        //                    var GetToolSetupId = varGetData.FindControl("lblInventoryNumber") as ASPxLabel;
        //                    var GetText_NM = varGetData.FindControl("Text_NM") as ASPxTextBox;
        //                    var GetText_Min = iList[0].Min;
        //                    var GetText_Max = iList[0].Max;
        //                    var GetCollaboration1 = varGetData.FindControl("Text_VerValue1") as ASPxTextBox;
        //                    var GetCollaboration2 = varGetData.FindControl("Text_VerValue2") as ASPxTextBox;
        //                    var GetCollaboration3 = varGetData.FindControl("Text_VerValue3") as ASPxTextBox;
        //                    var GetCollaboration4 = varGetData.FindControl("Text_VerValue4") as ASPxTextBox;
        //                    var GetCollaboration5 = varGetData.FindControl("Text_VerValue5") as ASPxTextBox;
        //                    var GetRemarks = varGetData.FindControl("RemarksDetail") as ASPxMemo;
        //                    var GetCallDate = DateTime.Now;
        //                    var GetDateNext = varGetData.FindControl("DateDetails") as ASPxDateEdit;
        //                    var ValText_VerDate = iList[0].LastVerificationDate.ToString();
        //                    var ValCalNumber = "1";
        //                    var ValTollSetupId = ValueToolSetupId.ToString();
        //                    var ValTollInv = ValueInventory.ToString();
        //                    var ValText_NM = GetText_NM.Text;
        //                    var ValText_Min = GetText_Min.ToString();
        //                    var ValText_Max = GetText_Max.ToString();
        //                    var ValText_Calibration1 = GetCollaboration1.Text;
        //                    var ValText_Calibration2 = GetCollaboration2.Text;
        //                    var ValText_Calibration3 = GetCollaboration3.Text;
        //                    var ValText_Calibration4 = GetCollaboration4.Text;
        //                    var ValText_Calibration5 = GetCollaboration5.Text;
        //                    var ValMemo_Remarks = GetRemarks.Text;
        //                    var NextVerDate = GetDateNext.Text;
        //                    ToolCalibrationRepository.SaveDataToolVerificationMark(ValText_VerDate, ValCalNumber, ValTollSetupId, ValTollInv, ValText_NM, ValText_Min, ValText_Max, ValText_Calibration1, ValText_Calibration2, ValText_Calibration3, ValText_Calibration4, ValText_Calibration5, NextVerDate, ValMemo_Remarks);
        //                }

        //            }



        //            //ASPxGridView grid = new ASPxGridView();
        //            //var rowIndex = grid.DetailRows.VisibleCount;

        //            Response.Redirect(Request.RawUrl);
        //        }


        #endregion
        protected void DateDetails(object sender, CalendarDayCellPreparedEventArgs e)
        {
            if (e.Date.DayOfWeek == DayOfWeek.Sunday || e.Date.DayOfWeek == DayOfWeek.Saturday)
            {
                e.Cell.Attributes["style"] = "pointer-events: none; background-color: gray";
            }
        }
Exemple #2
0
        protected void calendarUnit_DayCellPrepared(object sender, CalendarDayCellPreparedEventArgs e)
        {
            //TODO: Predpostavljam da je program spor jer ovdje 300 x  pozivas podatke iz baze podataka
            // jos vece je pitanje zasto pravis update ti nisi nista promjenio u modelu (???)
            //model.UnitStopBooking = null;
            //if (!firstload)
            //{
            //    model = controller.GetTouristUnit(id);
            //    controller.UpdateTouristUnit(model);
            //}
            DateTime            OpenDate        = model.OpenDate;
            DateTime            CloseDate       = model.CloseDate;
            List <DateInterval> unitstopbooking = model.UnitStopBooking;

            if (unitstopbooking != null)
            {
                if (e.Date < OpenDate || e.Date > CloseDate)
                {
                    e.Cell.BackColor = System.Drawing.Color.Gray;
                }
                else if (unitstopbooking.Find(m => m.FromDate <= e.Date && m.ToDate >= e.Date) != null)
                {
                    e.Cell.BackColor = System.Drawing.Color.Red;
                }
            }
        }