示例#1
0
        protected void Button26_Click(object sender, EventArgs e)
        {
            IRegisteredRequests bus = new BKartabl();

            GTS.Clock.Model.RequestFlow.Request req = new GTS.Clock.Model.RequestFlow.Request();
            req.Precard = new Precard()
            {
                ID = 8832
            };
            req.RegisterDate = DateTime.Now;
            req.TheFromDate  = "1391/09/01";
            req.TheToDate    = "1391/09/01";
            req.TheFromTime  = "09:00";
            req.TheToTime    = "10:00";
            bus.InsertRequest(req, 1391, 8, 32688);
        }
示例#2
0
        protected void Button38_Click(object sender, EventArgs e)
        {
            IRegisteredRequests req = new BKartabl();

            GTS.Clock.Model.RequestFlow.Request request = new GTS.Clock.Model.RequestFlow.Request();
            request.AddClientSide   = true;
            request.TheFromDate     = "1391/10/01";
            request.TheToDate       = "1391/10/30";
            request.TheFromTime     = "00:00";
            request.TheToTime       = "00:00";
            request.TheTimeDuration = "10:00";
            request.Precard         = new Precard()
            {
                ID = 62985
            };
            req.InsertRequest(request, 1391, 10, 32688);
        }
示例#3
0
        protected void Button28_Click(object sender, EventArgs e)
        {
            IRegisteredRequests req = new BKartabl();

            GTS.Clock.Model.RequestFlow.Request request = new GTS.Clock.Model.RequestFlow.Request();
            request.AddClientSide   = true;
            request.TheFromDate     = "1392/02/30";
            request.TheToDate       = "1392/02/30";
            request.TheFromTime     = "";
            request.TheToTime       = "10:00";
            request.TheTimeDuration = "00:00";
            request.Precard         = new Precard()
            {
                ID = 8832
            };
            request.ContinueOnTomorrow = true;
            req.InsertRequest(request, 1392, 2);
        }
示例#4
0
        protected void Button17_Click(object sender, EventArgs e)
        {
            IRegisteredRequests reg = new BKartabl();

            GTS.Clock.Model.RequestFlow.Request req = new GTS.Clock.Model.RequestFlow.Request();
            req.TheFromDate = req.TheToDate = "1391/07/18";
            req.TheFromTime = "13:00";
            req.TheToTime   = "17:00";
            req.Precard     = new Precard()
            {
                ID = 51
            };
            req.IsDateSetByUser = true;
            reg.InsertCollectiveRequest(req, new PersonAdvanceSearchProxy()
            {
                DepartmentId = 221
            }, new List <decimal>()
            {
                32660, 234101
            }, 1391, 7);
        }
示例#5
0
    private void Fill_GridRequestRefrence_RequestRefrence(decimal RequestID, string RefrenceType)
    {
        string[] retMessage = new string[4];
        try
        {
            IList <KartablProxy> requestList            = new List <KartablProxy>();
            GTS.Clock.Model.RequestFlow.Request request = null;
            switch (RefrenceType.ToLower())
            {
            case "ischild":
                request = this.RequestBusiness.GetByID(RequestID).RequestChildList.FirstOrDefault();
                break;

            case "isparent":
                request = this.RequestBusiness.GetByID(RequestID);
                break;
            }
            KartablProxy proxy = this.KartableBusiness.ConvertRegisterRequestToProxy(request);
            requestList.Add(proxy);

            this.GridRequestRefrence_RequestRefrence.DataSource = requestList;
            this.GridRequestRefrence_RequestRefrence.DataBind();
        }
        catch (UIValidationExceptions ex)
        {
            retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIValidationExceptions, ex, retMessage);
            this.ErrorHiddenField_Refrence_RequestRefrence.Value = this.exceptionHandler.CreateErrorMessage(retMessage);
        }
        catch (UIBaseException ex)
        {
            retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIBaseException, ex, retMessage);
            this.ErrorHiddenField_Refrence_RequestRefrence.Value = this.exceptionHandler.CreateErrorMessage(retMessage);
        }
        catch (Exception ex)
        {
            retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.Exception, ex, retMessage);
            this.ErrorHiddenField_Refrence_RequestRefrence.Value = this.exceptionHandler.CreateErrorMessage(retMessage);
        }
    }
示例#6
0
    public string[] UpdateRequest_RequestHistoryPage(string RequestID, string FromDate, string ToDate, string FromTime, string ToTime, string IsToTimeInNextDay, string IsFromAndToTimeInNextDay, string RequestDate, string Duration, string RequestTargetType, string Caller, string AttachmentFile, string OldAttachmentFile)
    {
        string[] retMessage = new string[5];
        this.InitializeCulture();

        try
        {
            AttackDefender.CSRFDefender(this.Page);


            decimal requestID = decimal.Parse(this.StringBuilder.CreateString(RequestID), CultureInfo.InvariantCulture);
            RequestDate = this.StringBuilder.CreateString(RequestDate);
            FromDate    = this.StringBuilder.CreateString(FromDate);
            ToDate      = this.StringBuilder.CreateString(ToDate);
            FromTime    = this.StringBuilder.CreateString(FromTime);
            ToTime      = this.StringBuilder.CreateString(ToTime);
            bool isToTimeInNextDay        = bool.Parse(this.StringBuilder.CreateString(IsToTimeInNextDay));
            bool isFromAndToTimeInNextDay = bool.Parse(this.StringBuilder.CreateString(IsFromAndToTimeInNextDay));
            Duration          = this.StringBuilder.CreateString(Duration);
            AttachmentFile    = this.StringBuilder.CreateString(AttachmentFile);
            OldAttachmentFile = this.StringBuilder.CreateString(OldAttachmentFile);
            RequestType   requestType = (RequestType)Enum.Parse(typeof(RequestType), this.StringBuilder.CreateString(RequestTargetType));
            RequestCaller RC          = (RequestCaller)Enum.Parse(typeof(RequestCaller), this.StringBuilder.CreateString(Caller));
            GTS.Clock.Model.RequestFlow.RequestHistory requestHistoryObj = new GTS.Clock.Model.RequestFlow.RequestHistory();
            GTS.Clock.Model.RequestFlow.Request        requestObj        = new GTS.Clock.Model.RequestFlow.Request();
            switch (requestType)
            {
            case RequestType.None:
                break;

            case RequestType.Hourly:
                requestHistoryObj.TheFromDate        = RequestDate;
                requestHistoryObj.TheFromTime        = FromTime;
                requestHistoryObj.TheToDate          = RequestDate;
                requestHistoryObj.TheToTime          = ToTime;
                requestHistoryObj.ContinueOnTomorrow = isToTimeInNextDay;
                if (!isToTimeInNextDay)
                {
                    requestHistoryObj.AllOnTomorrow = isFromAndToTimeInNextDay;
                }
                break;

            case RequestType.Daily:
                requestHistoryObj.TheFromDate = FromDate;
                requestHistoryObj.TheToDate   = ToDate;
                break;

            case RequestType.Monthly:
                break;

            case RequestType.OverWork:
                requestHistoryObj.TheFromDate        = FromDate;
                requestHistoryObj.TheToDate          = ToDate;
                requestHistoryObj.TheFromTime        = FromTime;
                requestHistoryObj.TheToTime          = ToTime;
                requestHistoryObj.TheDuration        = Duration;
                requestHistoryObj.ContinueOnTomorrow = isToTimeInNextDay;
                if (!isToTimeInNextDay)
                {
                    requestHistoryObj.AllOnTomorrow = isFromAndToTimeInNextDay;
                }
                break;

            case RequestType.Imperative:
                break;

            default:
                break;
            }
            requestObj.ID                       = requestID;
            requestHistoryObj.Request           = requestObj;
            requestHistoryObj.RequestType       = requestType;
            requestHistoryObj.AttachmentFile    = OldAttachmentFile;
            requestHistoryObj.NewAttachmentFile = AttachmentFile;
            switch (RC)
            {
            case RequestCaller.Kartable:
                KartableBusiness.UpdateRequestByManager_onKartable(requestHistoryObj);
                break;

            case RequestCaller.SpecialKartable:
                KartableBusiness.UpdateRequestByManager_onSpecialKartable(requestHistoryObj);
                break;

            default:
                break;
            }
            retMessage[0] = GetLocalResourceObject("RetSuccessType").ToString();
            retMessage[1] = GetLocalResourceObject("EditComplete").ToString();
            retMessage[2] = "success";
            return(retMessage);
        }
        catch (UIValidationExceptions ex)
        {
            retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIValidationExceptions, ex, retMessage);
            return(retMessage);
        }
        catch (UIBaseException ex)
        {
            retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIBaseException, ex, retMessage);
            return(retMessage);
        }
        catch (Exception ex)
        {
            retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.Exception, ex, retMessage);
            return(retMessage);
        }
    }