Ejemplo n.º 1
0
        protected void ctlTANoLookup_ObjectLookupReturn(object sender, ObjectLookUpReturnArgs e)
        {
            TADocumentObj ta = (TADocumentObj)e.ObjectReturn;

            ctlTANoDetail.Text            = ta.DocumentNo;
            ctlTANoDetail.CommandArgument = ta.TADocumentID.ToString();
        }
Ejemplo n.º 2
0
        protected void ctlAccountLookup_OnObjectLookUpReturn(object sender, ObjectLookUpReturnArgs e)
        {
            programLangList = (IList <ProgramLang>)e.ObjectReturn;

            foreach (ProgramLang proLang in programLangList)
            {
                SuProgramRole programRole = new SuProgramRole();
                programRole              = new SuProgramRole();
                programRole.Active       = true;
                programRole.AddState     = false;
                programRole.Comment      = "";
                programRole.CreBy        = UserAccount.UserID;
                programRole.UpdPgm       = ProgramCode;
                programRole.DeleteState  = false;
                programRole.DisplayState = false;
                programRole.EditState    = false;
                programRole.Program      = new SuProgram();
                if (proLang.ProgramId.HasValue)
                {
                    programRole.Program.Programid = proLang.ProgramId.Value;
                }
                programRole.Role        = new SuRole();
                programRole.Role.RoleID = RoleID;
                programRole.UpdBy       = UserAccount.UserID;
                try
                {
                    SuProgramRoleService.AddProgramRole(programRole);
                }
                catch (ServiceValidationException ex)
                {
                    ValidationErrors.MergeErrors(ex.ValidationErrors);
                }
            }
            RefreshGridView();
        }
Ejemplo n.º 3
0
        protected void Vendor1_OnObjectLookUpReturn(object sender, ObjectLookUpReturnArgs e)
        {
            IList <DbVendor> vendor   = (IList <DbVendor>)e.ObjectReturn;
            DbVendor         dbVendor = vendor.First <DbVendor>();

            //ctlTaxNo.TaxNo = dbVendor.TaxNo1;
            ctlVendorCode.Text = dbVendor.VendorCode;
            if (dbVendor.TaxNo1 != null && dbVendor.TaxNo2 == null)
            {
                ctlTaxNo.TaxNo     = dbVendor.TaxNo1;
                ctlVendorName.Text = dbVendor.VendorName1;
            }
            else if (dbVendor.TaxNo2 != null && dbVendor.TaxNo1 == null)
            {
                ctlTaxNo.TaxNo     = dbVendor.TaxNo2;
                ctlVendorName.Text = dbVendor.VendorName2;
            }
            else
            {
                ctlTaxNo.TaxNo     = dbVendor.TaxNo2;
                ctlVendorName.Text = dbVendor.VendorName2;
            }
            ctlStreet.Text     = dbVendor.Street;
            ctlCity.Text       = dbVendor.City;
            ctlCountry.Text    = dbVendor.Country;
            ctlPostalCode.Text = dbVendor.PostalCode;
            CallOnObjectLookUpReturn(dbVendor);
            ctlUpdatePanelVendor.Update();
        }
Ejemplo n.º 4
0
        protected void ctlLocationLookup_OnObjectLookUpReturn(object sender, ObjectLookUpReturnArgs e)
        {
            IList <DbLocation>            locationList            = (IList <DbLocation>)e.ObjectReturn;
            IList <DbServiceTeamLocation> serviceTeamLocationList = new List <DbServiceTeamLocation>();

            foreach (DbLocation location in locationList)
            {
                Location locate = new Location();
                locate.LocationID = location.LocationID;
                DbServiceTeam         serviceTeam         = ScgDbQueryProvider.DbServiceTeamQuery.FindByIdentity(Convert.ToInt64(ctlServiceTeamIDHidden.Value));
                DbServiceTeamLocation serviceTeamLocation = GetServiceTeamLocation(serviceTeam, locate);
                serviceTeamLocationList.Add(serviceTeamLocation);
            }

            if (serviceTeamLocationList.Count > 0)
            {
                try
                {
                    DbServiceTeamLocationService.AddServiceTeamLocationList(serviceTeamLocationList);
                    ctlLocationGrid.DataCountAndBind();
                }
                catch (ServiceValidationException ex)
                {
                    ValidationErrors.MergeErrors(ex.ValidationErrors);
                }
            }
            ctlUpdatePanelLocationGrid.Update();
        }
        protected void ctlExpenseLookup_OnObjectLookUpReturn(object sender, ObjectLookUpReturnArgs e)
        {
            AccountLang accountInfo = (AccountLang)e.ObjectReturn;

            AccountID           = accountInfo.AccountID;
            ctlExpenseCode.Text = String.Format("{0}-{1}", accountInfo.AccountCode, accountInfo.AccountName);
            ctlUpdatePanelAccountSimple.Update();
        }
        protected void ctlIOLookup_OnObjectLookUpReturn(object sender, ObjectLookUpReturnArgs e)
        {
            DbInternalOrder ioInfo = (DbInternalOrder)e.ObjectReturn;

            IOID       = ioInfo.IOID;
            ctlIO.Text = String.Format("{0}", ioInfo.IONumber);
            ctlUpdatePanelIOSimple.Update();
        }
        protected void ctlCostCenterLookUp_OnObjectLookUpReturn(object sender, ObjectLookUpReturnArgs e)
        {
            IList <DbCostCenter> CostCenter   = (IList <DbCostCenter>)e.ObjectReturn;
            DbCostCenter         dbCostCenter = CostCenter.First <DbCostCenter>();

            CostCenterID       = dbCostCenter.CostCenterID;
            ctlCostCenter.Text = dbCostCenter.CostCenterCode;
            ctlUpdatePanelCostCenterSimple.Update();
        }
 protected void ctlCompanyField_OnObjectReturn(object sender, ObjectLookUpReturnArgs e)
 {
     if (e.ObjectReturn != null)
     {
         DbCompany company = (DbCompany)e.ObjectReturn;
         ctlCompanyField.CompanyID      = company.CompanyID.ToString();
         ctlFromLocationField.CompanyId = company.CompanyID;
         ctlToLocationField.CompanyId   = company.CompanyID;
     }
     else
     {
         ctlToLocationField.ResetValue();
         ctlFromLocationField.ResetValue();
     }
 }
Ejemplo n.º 9
0
        protected void ctlUserAutoCompleteLookup_OnObjectLookUpReturn(object sender, ObjectLookUpReturnArgs e)
        {
            if (e.ObjectReturn != null)
            {
                SuUser userInfo = (SuUser)e.ObjectReturn;

                this.SetControl(userInfo.Userid);

                CallOnObjectLookUpReturn(userInfo);
            }
            else
            {
                ResetControl();
            }
            ctlUpdatePanelActorData.Update();
        }
Ejemplo n.º 10
0
        protected void ExpensesMPA_OnObjectLookUpReturn(object sender, ObjectLookUpReturnArgs e)
        {
            if (e.ObjectReturn != null)
            {
                IList <SCG.eAccounting.DTO.ValueObject.ExpensesMPA> list = (IList <SCG.eAccounting.DTO.ValueObject.ExpensesMPA>)e.ObjectReturn;
                FnExpenseDocumentService.AddExpenseMPAToTransaction(this.TransactionId, this.ExpDocumentID, list);
                this.BindExpenseMPAGridView();

                if (!ExpenseDocumentEditor.NotifyUpdateExpense())
                {
                    return;
                }

                ExpenseDocumentEditor.NotifyPaymentDetailChange();
            }
            ctlUpdatePanelExpenseGeneral.Update();
        }
        protected void ctlInitiatorLookup_OnObjectLookUpReturn(object sender, ObjectLookUpReturnArgs e)
        {
            ShowAdd.Text    = null;
            ShowAdd.Visible = false;
            IList <SuUser> userList     = (List <SuUser>)e.ObjectReturn;
            ArrayList      groupArrList = new ArrayList();

            //Add Approver to SuUserFavorite
            //.....
            foreach (GridViewRow row in ctlInitiatorGrid.Rows)
            {
                Label ctlInitiator = (Label)ctlInitiatorGrid.Rows[row.RowIndex].FindControl("ctlUserID");

                groupArrList.Add(ctlInitiator.Text);
            }

            SuUser user = GetUser();

            foreach (SuUser u in userList)
            {
                if (!groupArrList.Contains(u.UserName))
                {
                    SuUserFavoriteActor initiator = new SuUserFavoriteActor();
                    initiator.Active    = true;
                    initiator.User      = user;
                    initiator.ActorType = "2"; //2 = initiator
                    initiator.CreBy     = UserAccount.UserID;
                    initiator.CreDate   = DateTime.Now;
                    //approver.RowVersion = u.RowVersion;
                    initiator.UpdBy       = UserAccount.UserID;
                    initiator.UpdDate     = DateTime.Now;
                    initiator.UpdPgm      = UserAccount.CurrentProgramCode;
                    initiator.ActorUserID = u;
                    SuUserFavoriteActorService.AddFavoriteInitiator(initiator);
                }
                else
                {
                    ShowAdd.Text   += "INITIATOR   '" + u.UserName + "'  HAS BEEN ADDED <br>";
                    ShowAdd.Visible = true;
                }
            }

            ctlInitiatorGrid.DataCountAndBind();
            ctlUpdatePanelInitiator.Update();
        }
        protected void EditorLookup_OnObjectLookUpReturn(object sender, ObjectLookUpReturnArgs e)
        {
            ShowAdd.Text    = null;
            ShowAdd.Visible = false;
            IList <DbCompany> account = (List <DbCompany>)e.ObjectReturn;

            IList <DbAccountCompany> list = new List <DbAccountCompany>();
            ArrayList groupComList        = new ArrayList();

            foreach (GridViewRow row in ctlCompanyInfoGrid.Rows)
            {
                Label ctlCom = (Label)ctlCompanyInfoGrid.Rows[row.RowIndex].FindControl("ctlCompanyCode");

                groupComList.Add(ctlCom.Text);
            }
            foreach (DbCompany ac in account)
            {
                if (!groupComList.Contains(ac.CompanyCode))
                {
                    DbAccountCompany accountCompany = new DbAccountCompany();
                    accountCompany.AccountID = ScgDbQueryProvider.DbAccountQuery.FindByIdentity(AccountID);
                    accountCompany.UseParent = true;
                    accountCompany.Active    = true;
                    accountCompany.CompanyID = ac;
                    accountCompany.CreBy     = UserAccount.UserID;
                    accountCompany.CreDate   = DateTime.Now;
                    accountCompany.UpdBy     = UserAccount.UserID;
                    accountCompany.UpdDate   = DateTime.Now;
                    accountCompany.UpdPgm    = UserAccount.CurrentProgramCode;

                    list.Add(accountCompany);
                }

                else
                {
                    ShowAdd.Text   += "COMPANY CODE " + ac.CompanyCode + " ALREADY ADDED <br>";
                    ShowAdd.Visible = true;
                }
            }

            DbAccountCompanyService.AddAccountCompanyList(list);
            ctlCompanyInfoGrid.DataCountAndBind();
            ctlCompanyInfoUpdatePanel.Update();
        }
Ejemplo n.º 13
0
        protected void ctlUserProfileLookup_OnObjectLookUpReturn(object sender, ObjectLookUpReturnArgs e)
        {
            IList <SuUser> userInfo = (IList <SuUser>)e.ObjectReturn;
            string         CCEmail  = "";

            if (userInfo != null)
            {
                foreach (SuUser user in userInfo)
                {
                    CCEmail += user.Email.ToString() + ";";
                }
            }
            if (!string.IsNullOrEmpty(ctlCC.Text) && !ctlCC.Text.EndsWith(";"))
            {
                ctlCC.Text += ";";
            }
            ctlCC.Text += CCEmail;
            ctlUpdatePanelEmailLog.Update();
        }
        protected void Advance_OnObjectLookUpReturn(object sender, ObjectLookUpReturnArgs e)
        {
            ctlTANoLookup.Enabled = false;
            ctlDeleteTA.Enabled   = false;
            if (e.ObjectReturn != null)
            {
                IList <SCG.eAccounting.DTO.ValueObject.Advance> advanceList = (IList <SCG.eAccounting.DTO.ValueObject.Advance>)e.ObjectReturn;
                this.PrepareAdvance(advanceList);
                this.BindAdvanceGridView();
                this.BindRemittanceGridview();

                if (!ExpenseDocumentEditor.NotifyUpdateExpense())
                {
                    return;
                }

                ExpenseDocumentEditor.NotifyPaymentDetailChange();
            }
            ctlUpdatePanelExpenseGeneral.Update();
        }
        protected void ctlCompanyField_OnObjectLookUpReturn(object sender, ObjectLookUpReturnArgs e)
        {
            if (e.ObjectReturn != null)
            {
                DbCompany company = (DbCompany)e.ObjectReturn;
                ctlCompanyField.CompanyID = company.CompanyID.ToString();
                ctlCostCenterField.ResetValue();
                ctlLocationField.ResetValue();
                ctlCostCenterField.CompanyId = company.CompanyID;
                ctlLocationField.CompanyId   = company.CompanyID;
                CompanyID = company.CompanyID;

                ctlCostCenterField.ReadOnly = false;
                ctlLocationField.ReadOnly   = false;
                ctlCostCenterField.CheckForReadOnly();
                ctlLocationField.CheckForReadOnly();
                ctlLocationField.DisableCompany = true;
                ctlUpdatePanelUserProfileForm.Update();
            }
            //string aaa = ctlUserPassword.Text;
        }
        protected void TA_OnObjectLookUpReturn(object sender, ObjectLookUpReturnArgs e)
        {
            ctlAddAdvance.Enabled = false;
            TADocumentObj TA = (TADocumentObj)e.ObjectReturn;

            ctlAdvanceGridView.Columns[5].Visible = false;

            // For query only advance that
            // 1. Status = OutStanding
            // 2. Do not used in Expense that has flag <> 'Cancel'
            SCG.eAccounting.DTO.ValueObject.Advance avCriteria = new SCG.eAccounting.DTO.ValueObject.Advance();
            avCriteria.CompanyID    = CompanyID;
            avCriteria.RequesterID  = RequesterID;
            avCriteria.AdvanceType  = FnExpenseDocumentService.GetExpenseType(this.ExpDocumentID, this.TransactionId);
            avCriteria.TADocumentID = TA.TADocumentID;

            FnExpenseDocumentService.SetTA(this.TransactionId, this.ExpDocumentID, avCriteria);

            if (TA.TADocumentID.HasValue)
            {
                ctlTANoLabel.Visible          = false;
                ctlTALinkButton.Text          = TA.DocumentNo;
                ctlTALinkButton.OnClientClick = "window.open('../Programs/DocumentView.aspx?wfid=" + TA.WorkflowID.ToString() + "')";
                ctlBusinessChk.Checked        = TA.IsBusinessPurpose == null ? false : bool.Parse(TA.IsBusinessPurpose.ToString());
                ctlTrainingChk.Checked        = TA.IsTrainningPurpose == null ? false : bool.Parse(TA.IsTrainningPurpose.ToString());
                ctlOtherChk.Checked           = TA.IsOtherPurpose == null ? false : bool.Parse(TA.IsOtherPurpose.ToString());
                ctlOther.Text            = TA.OtherPurposeDescription.ToString();
                ctlFromDateCal.DateValue = UIHelper.ToDateString(TA.FromDate);
                ctlToDateCal.DateValue   = UIHelper.ToDateString(TA.ToDate);
                ctlCountry.Text          = TA.Country;
            }
            else
            {
                ResetTADataZone();
            }
            this.BindAdvanceGridView();
            this.BindRemittanceGridview();
            ExpenseDocumentEditor.NotifyPaymentDetailChange();
            ctlUpdatePanelExpenseGeneral.Update();
        }
        protected void ctlApproverEditorLookup_OnObjectLookUpReturn(object sender, ObjectLookUpReturnArgs e)
        {
            IList <SuUser> userList    = (List <SuUser>)e.ObjectReturn;
            ArrayList      userArrList = new ArrayList();

            foreach (GridViewRow row in ctlApproverEditorGrid.Rows)
            {
                Label ctlUserID = (Label)ctlApproverEditorGrid.Rows[row.RowIndex].FindControl("ctlUserID");

                userArrList.Add(ctlUserID.Text);
            }

            SuUser user = GetUser();

            foreach (SuUser u in userList)
            {
                if (!userArrList.Contains(u.UserName))
                {
                    SuUserFavoriteActor ApproverEditor = new SuUserFavoriteActor();
                    ApproverEditor.Active    = true;
                    ApproverEditor.User      = user;
                    ApproverEditor.ActorType = "1"; //1 = ApproverEditor
                    ApproverEditor.CreBy     = UserAccount.UserID;
                    ApproverEditor.CreDate   = DateTime.Now;
                    //ApproverEditor.RowVersion = u.RowVersion;
                    ApproverEditor.UpdBy       = UserAccount.UserID;
                    ApproverEditor.UpdDate     = DateTime.Now;
                    ApproverEditor.UpdPgm      = UserAccount.CurrentProgramCode;
                    ApproverEditor.ActorUserID = u;

                    SuUserFavoriteActorService.AddFavoriteApprover(ApproverEditor);
                }
            }

            ctlApproverEditorGrid.DataCountAndBind();
            ctlApprroverUpdatePanel.Update();
        }
Ejemplo n.º 18
0
        protected void CtlInitiatorLookup_OnObjectLookUpReturn(object sender, ObjectLookUpReturnArgs e)
        {
            //Insert New Initiator on ViewSate

            IList <SuUser> list = (IList <SuUser>)e.ObjectReturn;

            List <DocumentInitiatorLang> documentInitiatorList = GetInitiators();

            int countSeq = documentInitiatorList.Count;

            foreach (SuUser item in list)
            {
                int count = (from i in documentInitiatorList
                             where i.UserID == item.Userid
                             select i).Count();;
                if (count > 0)
                {
                    continue;
                }

                ++countSeq;
                DocumentInitiatorLang documentInitiatorItem = new DocumentInitiatorLang();
                documentInitiatorItem.DocumentID   = DocumentID;
                documentInitiatorItem.Email        = item.Email;
                documentInitiatorItem.EmployeeName = item.EmployeeName;
                // documentInitiatorItem.LastName = item.LastName;
                documentInitiatorItem.Seq           = UIHelper.ParseShort(countSeq.ToString());
                documentInitiatorItem.UserID        = item.Userid;
                documentInitiatorItem.InitiatorType = "1";
                documentInitiatorList.Add(documentInitiatorItem);
            }

            InitiatorReorderList.DataSource = ReorderInitiators(documentInitiatorList);
            InitiatorReorderList.DataBind();
            InitiatorUpdatePanel.Update();
        }
Ejemplo n.º 19
0
        //protected void ctlGroupLookup_OnObjectLookUpReturn(object sender, ObjectLookUpReturnArgs e)
        //{
        //    IList<SuRole> groupList = (List<SuRole>)e.ObjectReturn;

        //    ////Add Approver to SuUserFavorite
        //    ////.....

        //    SuUser user = GetUser();
        //    foreach (SuRole ur in groupList)
        //    {
        //        SuUserRole UserRole = new SuUserRole();
        //        UserRole.Active = true;
        //        UserRole.CreBy = UserAccount.UserID;
        //        UserRole.CreDate = DateTime.Now;
        //        UserRole.Role = ur;
        //        UserRole.UpdBy = UserAccount.UserID;
        //        UserRole.UpdDate = DateTime.Now;
        //        UserRole.UpdPgm = UserAccount.CurrentProgramCode;
        //        UserRole.User = user;

        //        SuUserRoleService.AddFavoriteGroup(UserRole);

        //    }
        //    ctlGroupGrid.DataCountAndBind();
        //    ctlUpdatePanelGroup.Update();

        //}
        protected void ctlGroupLookup_OnObjectLookUpReturn(object sender, ObjectLookUpReturnArgs e)
        {
            IList <SuRole> groupList    = (List <SuRole>)e.ObjectReturn;
            ArrayList      groupArrList = new ArrayList();

            ////Add Approver to SuUserFavorite
            ////.....

            foreach (GridViewRow row in ctlGroupGrid.Rows)
            {
                Label ctlGroup = (Label)ctlGroupGrid.Rows[row.RowIndex].FindControl("ctlGroup");

                groupArrList.Add(ctlGroup.Text);
            }
            SuUser user = GetUser();

            foreach (SuRole ur in groupList)
            {
                if (!groupArrList.Contains(ur.RoleName))
                {
                    SuUserRole UserRole = new SuUserRole();
                    UserRole.Active  = true;
                    UserRole.CreBy   = UserAccount.UserID;
                    UserRole.CreDate = DateTime.Now;
                    UserRole.Role    = ur;
                    UserRole.UpdBy   = UserAccount.UserID;
                    UserRole.UpdDate = DateTime.Now;
                    UserRole.UpdPgm  = UserAccount.CurrentProgramCode;
                    UserRole.User    = user;

                    SuUserRoleService.AddFavoriteGroup(UserRole);
                }
            }
            ctlGroupGrid.DataCountAndBind();
            ctlUpdatePanelGroup.Update();
        }
Ejemplo n.º 20
0
        protected void ctlAccountLookup_OnObjectLookUpReturn(object sender, ObjectLookUpReturnArgs e)
        {
            programLangList = (IList <SuProgramLang>)e.ObjectReturn;

            foreach (SuProgramLang proLang in programLangList)
            {
                SuProgramRole programRole = new SuProgramRole();
                programRole                   = new SuProgramRole();
                programRole.Active            = true;
                programRole.AddState          = false;
                programRole.Comment           = "";
                programRole.CreBy             = UserAccount.UserID;
                programRole.CreDate           = DateTime.Now.Date;
                programRole.DeleteState       = false;
                programRole.DisplayState      = false;
                programRole.EditState         = false;
                programRole.Program           = new SuProgram();
                programRole.Program.Programid = proLang.ProgramId;
                programRole.Role              = new SuRole();
                programRole.Role.RoleID       = RoleID;
                programRole.UpdPgm            = ProgramCode;
                programRole.UpdDate           = DateTime.Now.Date;
                programRole.UpdBy             = UserAccount.UserID;
                try
                {
                    SuProgramRoleService.AddProgramRole(programRole);
                }
                catch (ServiceValidationException ex)
                {
                    ValidationErrors.MergeErrors(ex.ValidationErrors);
                }
            }
            ctlProgramGridView.DataCountAndBind();
            RegisterScriptForGridView();
            ctlUpdPanelGridView.Update();
        }
Ejemplo n.º 21
0
        protected void ProgramSearch1_OnObjectLookUpReturn(object sender, ObjectLookUpReturnArgs e)
        {
            IList <SuProgramRole> list            = new List <SuProgramRole>();
            IList <SuProgramLang> programLangList = e.ObjectReturn as IList <SuProgramLang>;
            short roleId = UIHelper.ParseShort(ctlRoleGrid.SelectedValue.ToString());

            try
            {
                foreach (SuProgramLang SuProgramLang in programLangList)
                {
                    SuProgramRole suProgramRole = new SuProgramRole();
                    suProgramRole.Role         = SuRoleService.FindProxyByIdentity(roleId);
                    suProgramRole.Program      = SuProgramLang.Program;
                    suProgramRole.AddState     = false;
                    suProgramRole.EditState    = false;
                    suProgramRole.DeleteState  = false;
                    suProgramRole.DisplayState = false;
                    suProgramRole.Comment      = "";
                    suProgramRole.Active       = true;
                    suProgramRole.CreBy        = UserAccount.UserID;
                    suProgramRole.CreDate      = DateTime.Now.Date;
                    suProgramRole.UpdBy        = UserAccount.UserID;
                    suProgramRole.UpdDate      = DateTime.Now.Date;
                    suProgramRole.UpdPgm       = ProgramCode;
                    list.Add(suProgramRole);
                }
                SuProgramRoleService.UpdateProgramRole(list);

                ctlProgramRoleGrid.DataCountAndBind();
                ctlUpdatePanelProgramRoleGridView.Update();
            }
            catch (ServiceValidationException ex)
            {
                ValidationErrors.MergeErrors(ex.ValidationErrors);
            }
        }
Ejemplo n.º 22
0
 protected void ctlMileageRateRevisionLookUp_OnObjectLookUpReturn(object sender, ObjectLookUpReturnArgs e)
 {
 }