Example #1
0
        //Created By: Leslie Baliguat, Created on: 9/28/2016
        public void PopulateTaxRate(Entity branchEntity, string taxIdField, string rateField)
        {
            var taxId = branchEntity.GetAttributeValue <EntityReference>(taxIdField) != null
                ? branchEntity.GetAttributeValue <EntityReference>(taxIdField).Id
                : Guid.Empty;

            EntityCollection taxCollection = CommonHandler.RetrieveRecordsByOneValue("gsc_cmn_taxmaintenance", "gsc_cmn_taxmaintenanceid", taxId, _organizationService, null, OrderType.Ascending,
                                                                                     new[] { "gsc_rate" });

            if (taxCollection != null && taxCollection.Entities.Count > 0)
            {
                var taxEntity = taxCollection.Entities[0];

                if (taxEntity.Contains("gsc_rate"))
                {
                    branchEntity[rateField] = taxEntity.GetAttributeValue <Decimal>("gsc_rate");
                }
            }
        }
Example #2
0
        public void Search()
        {
            grcShopScore.DataSource = null;
            string projectCode = CommonHandler.GetComboBoxSelectedValue(cboProject).ToString();
            string shopCode    = btnShopCode.Text;
            bool   lossCheck   = chkLoss.Checked;
            bool   recheck     = chkRecheck.Checked;
            bool   all         = chkAll.Checked;
            List <TwoLevelColumnInfo> columnInfoList = SearchHead(projectCode, shopCode);
            List <ShopScoreBodyDto>   dataList       = SearchBodyData(projectCode, shopCode, lossCheck, recheck, all);
            List <ShopScoreInfoDto>   leftList       = SearchLeft(projectCode);

            DynamicColumnDataSet <TwoLevelColumnInfo, ShopScoreBodyDto, ShopScoreInfoDto> list = new DynamicColumnDataSet <TwoLevelColumnInfo, ShopScoreBodyDto, ShopScoreInfoDto>(columnInfoList, dataList, leftList);

            if (list != null && list.ColumnInfoList != null)
            {
                list.DtoList = DynamicColumnUtil.CombineDynamicColumnDto <TwoLevelColumnInfo, ShopScoreBodyDto, ShopScoreInfoDto>(list.ColumnInfoList, list.DataList, list.DtoList);
            }

            //BindGrid

            CommonHandler.BuildDynamicColumn <TwoLevelColumnInfo, ShopScoreInfoDto>(grvShopScore, list.ColumnInfoList, list.DtoList);

            //foreach(DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn
            foreach (GridColumn col in grvShopScore.Columns)
            {
                for (int i = 0; i < grvShopScore.RowCount; i++)
                {
                    if (grvShopScore.GetRowCellValue(i, col) == null || grvShopScore.GetRowCellValue(i, col).ToString() == "")
                    {
                        grvShopScore.SetRowCellValue(i, col, "--");
                    }
                }
                //RepositoryItemTextEdit textBox = new RepositoryItemTextEdit();
                //((System.ComponentModel.ISupportInitialize)(textBox)).BeginInit();
                //this.grcShopScore.RepositoryItems.Add(textBox);
                //textBox.Properties.NullText = "--";
                //col.ColumnEdit = textBox;
                //((System.ComponentModel.ISupportInitialize)(textBox)).EndInit();
            }
            grvShopScore.LeftCoord = 0;
        }
Example #3
0
        public Subjects()
        {
            InitializeComponent();

            dataHandler        = new XtraGridDataHandler <ProjectDto>(grvProject);
            dataHandlerChapter = new XtraGridDataHandler <ChapterDto>(grvCharter);
            dataHandlerSubject = new XtraGridDataHandler <SubjectDto>(grvSubject);
            dataHandlerLink    = new XtraGridDataHandler <LinkDto>(grvLink);
            CommonHandler.SetRowNumberIndicator(grvProject);
            CommonHandler.SetRowNumberIndicator(grvCharter);
            CommonHandler.SetRowNumberIndicator(grvLink);
            CommonHandler.SetRowNumberIndicator(grvSubject);
            CommonHandler.SetButtonImage(btnInspectionStandard, ButtonImageType.POPUP);
            CommonHandler.SetButtonImage(btnFile, ButtonImageType.POPUP);
            CommonHandler.SetButtonImage(btnLoss, ButtonImageType.POPUP);
            CommonHandler.SetButtonImage(btnSroceSet, ButtonImageType.POPUP);
            CommonHandler.SetButtonImage(btnDetail, ButtonImageType.DETAIL);
            CommonHandler.SetButtonImage(btnLinkDetail, ButtonImageType.DETAIL);
            grcSubject.DataSource = new List <SubjectDto>();
            selection             = new GridCheckMarksSelection(grvSubject);
            selection.CheckMarkColumn.VisibleIndex = 0;

            grcCharter.DataSource = new List <ChapterDto>();
            selectionCharter      = new GridCheckMarksSelection(grvCharter);
            selectionCharter.CheckMarkColumn.VisibleIndex = 0;

            grcLink.DataSource = new List <LinkDto>();
            selectionLink      = new GridCheckMarksSelection(grvLink);
            selectionLink.CheckMarkColumn.VisibleIndex = 0;

            btnCharterSave.Enabled   = false;
            btnCharterAddRow.Enabled = false;;
            btnAddRow_Down.Enabled   = false;
            btnDelRow.Enabled        = false;
            btnSave_Down.Enabled     = false;

            btnLinkSave.Enabled        = false;
            btnLinkAddRow.Enabled      = false;
            this.textBox1.Visible      = false;
            this.btnAddNewData.Visible = false;
            InitData();
        }
        /// <summary>
        /// 查询按钮事件
        /// </summary>
        private void btnQuery_Click(object sender, EventArgs e)
        {
            try
            {
                if (dateWRDateBegin.EditValue == null || dateWRDateEnd.EditValue == null)
                {
                    MessageHandler.ShowMessageBox(tsmiCkrqbnwkcx.Text); // ("出库日期不能为空,请设置后重新进行查询。");
                    if (dateWRDateBegin.EditValue == null)
                    {
                        dateWRDateBegin.Focus();
                    }
                    else
                    {
                        dateWRDateEnd.Focus();
                    }
                    return;
                }
                string wrDateBeginStr = dateWRDateBegin.DateTime.ToString("yyyy-MM-dd");
                string wrDateEndStr   = dateWRDateEnd.DateTime.AddDays(1).ToString("yyyy-MM-dd");

                string reqDepStr        = lookUpReqDep.ItemIndex > 0 ? DataTypeConvert.GetString(lookUpReqDep.EditValue) : "";
                string repertoryNoStr   = lookUpRepertoryNo.ItemIndex > 0 ? DataTypeConvert.GetString(lookUpRepertoryNo.EditValue) : "";
                string wrTypeNoStr      = lookUpWarehouseReceiptTypeNo.ItemIndex > 0 ? DataTypeConvert.GetString(lookUpWarehouseReceiptTypeNo.EditValue) : "";
                string manufactureNoStr = lookUpManufactureNo.ItemIndex > 0 ? DataTypeConvert.GetString(lookUpManufactureNo.EditValue) : "";

                int    warehouseStateInt = CommonHandler.Get_WarehouseState_No(comboBoxWarehouseState.Text);
                string empNameStr        = lookUpPrepared.ItemIndex > 0 ? DataTypeConvert.GetString(lookUpPrepared.EditValue) : "";
                string commonStr         = textCommon.Text.Trim();

                dataSet_WR.Tables[0].Rows.Clear();
                string querySqlStr = wrDAO.QueryWarehouseReceiptHead_SQL(wrDateBeginStr, wrDateEndStr, reqDepStr, repertoryNoStr, wrTypeNoStr, manufactureNoStr, warehouseStateInt, empNameStr, -1, commonStr, false);
                lastQuerySqlStr = querySqlStr;
                string countSqlStr = commonDAO.QuerySqlTranTotalCountSql(querySqlStr);

                gridBottomOrderHead.QueryGridData(ref dataSet_WR, "WRHead", querySqlStr, countSqlStr, true);
            }
            catch (Exception ex)
            {
                //ExceptionHandler.HandleException(this.Text + "--查询按钮事件错误。", ex);
                ExceptionHandler.HandleException(this.Text + "--" + f.tsmiCxansjcw.Text, ex);
            }
        }
Example #5
0
        /// <summary>
        /// 窗体加载事件
        /// </summary>
        private void FrmQuotationInfo_History_Load(object sender, EventArgs e)
        {
            try
            {
                ControlHandler.DevExpressStyle_ChangeControlLocation(btnListAdd.LookAndFeel.ActiveSkinName, new List <Control> {
                    btnListAdd
                });

                DataTable bussBaseTable     = commonDAO.QueryBussinessBaseInfo(false);
                DataTable currencyCateTable = commonDAO.QueryCurrencyCate(false);

                searchBussinessBaseNo.Properties.DataSource = bussBaseTable;
                LookUpCreator.Properties.DataSource         = commonDAO.QueryUserInfo(false);
                LookUpModifierId.Properties.DataSource      = LookUpCreator.Properties.DataSource;

                repLookUpCurrencyCate.DataSource = currencyCateTable;

                repItemCORBussinessBaseNo.DataSource = bussBaseTable;
                repItemCORCurrencyCate.DataSource    = currencyCateTable;

                DateTime nowDate = BaseSQL.GetServerDateTime();
                dateRecordDateBegin.DateTime = nowDate.Date.AddDays(-SystemInfo.OrderQueryDate_DateIntervalDays);
                dateRecordDateEnd.DateTime   = nowDate.Date;

                searchLookUpBussinessBaseNo.Properties.DataSource = commonDAO.QueryBussinessBaseInfo(true);
                searchLookUpBussinessBaseNo.Text = "全部";

                repSearchLookUpBussinessBaseNo.DataSource = bussBaseTable;
                repLookUpQState.DataSource = CommonHandler.GetQuotationInfoStateTable(false);

                if (queryAutoQuotationNoStr == "")
                {
                    dataSet_Quotation.Tables[0].Clear();
                    quoDAO.QueryQuotationBaseInfo(dataSet_Quotation.Tables[0], "", "", "", 0, "", true);
                    Set_ButtonEditGrid_State(true);
                }
            }
            catch (Exception ex)
            {
                ExceptionHandler.HandleException(this.Text + "--窗体加载事件错误。", ex);
            }
        }
Example #6
0
        /// <summary>
        /// Executes the plug-in.
        /// </summary>
        /// <param name="localContext">The <see cref="LocalPluginContext"/> which contains the
        /// <see cref="IPluginExecutionContext"/>,
        /// <see cref="IOrganizationService"/>
        /// and <see cref="ITracingService"/>
        /// </param>
        /// <remarks>
        /// For improved performance, Microsoft Dynamics CRM caches plug-in instances.
        /// The plug-in's Execute method should be written to be stateless as the constructor
        /// is not called for every invocation of the plug-in. Also, multiple system threads
        /// could execute the plug-in at the same time. All per invocation state information
        /// is stored in the context. This means that you should not use global variables in plug-ins.
        /// </remarks>
        protected void ExecutePreValidateVehicleSalesReturnDelete(LocalPluginContext localContext)
        {
            if (localContext == null)
            {
                throw new ArgumentNullException("localContext");
            }

            IPluginExecutionContext context = localContext.PluginExecutionContext;
            IOrganizationService    service = localContext.OrganizationService;
            ITracingService         trace   = localContext.TracingService;
            var    vehicleSalesReturn       = (EntityReference)context.InputParameters["Target"];
            string message = context.MessageName;

            if (context.Depth > 1)
            {
                return;
            }

            try
            {
                EntityCollection vehicleSalesReturnCollection = CommonHandler.RetrieveRecordsByOneValue("gsc_sls_vehiclesalesreturn", "gsc_sls_vehiclesalesreturnid", vehicleSalesReturn.Id, service, null, OrderType.Ascending,
                                                                                                        new[] { "gsc_vehiclesalesreturnstatus" });

                VehicleSalesReturnHandler vehicleSalesReturnHandler = new VehicleSalesReturnHandler(service, trace);
                if (vehicleSalesReturnHandler.isPostedTransaction(vehicleSalesReturnCollection.Entities[0]) == true)
                {
                    throw new InvalidPluginExecutionException("Unable to delete posted sales return.");
                }
            }

            catch (Exception ex)
            {
                if (ex.Message.Contains("Unable to delete posted sales return."))
                {
                    throw new InvalidPluginExecutionException("Unable to delete posted sales return.");
                }
                else
                {
                    throw new InvalidPluginExecutionException(String.Concat("(Exception)\n", ex.Message, Environment.NewLine, ex.StackTrace));
                }
            }
        }
        public override void DeleteButtonClick()
        {
            List <SubjectDto> list_subject = new List <SubjectDto>();
            List <ShopDto>    list_shop    = new List <ShopDto>();

            for (int i = 0; i < grvSubject.RowCount; i++)
            {
                if (grvSubject.GetRowCellValue(i, "CheckMarkSelection") != null && grvSubject.GetRowCellValue(i, "CheckMarkSelection").ToString() == "True")
                {
                    list_subject.Add(grvSubject.GetRow(i) as SubjectDto);
                }
            }

            for (int i = 0; i < grvShop.RowCount; i++)
            {
                if (grvShop.GetRowCellValue(i, "CheckMarkSelection") != null && grvShop.GetRowCellValue(i, "CheckMarkSelection").ToString() == "True")
                {
                    list_shop.Add(grvShop.GetRow(i) as ShopDto);
                }
            }
            if (list_subject.Count == 0)
            {
                CommonHandler.ShowMessage(MessageType.Information, "没有选择任何执行文件");
                return;
            }
            if (list_shop.Count == 0)
            {
                CommonHandler.ShowMessage(MessageType.Information, "没有选择任何经销商");
                return;
            }
            if (CommonHandler.ShowMessage(MessageType.Confirm, "确定要删除吗?") == DialogResult.Yes)
            {
                foreach (ShopDto shop in list_shop)
                {
                    foreach (SubjectDto subject in list_subject)
                    {
                        service.DeleteAnserForError(CommonHandler.GetComboBoxSelectedValue(cboProject).ToString(), shop.ShopCode, subject.SubjectCode);
                    }
                }
                CommonHandler.ShowMessage(MessageType.Information, "删除成功");
            }
        }
Example #8
0
        //Created By : Raphael Herrera, Created On : 6/7/2016

        /*Purpose: Create Survey Transaction Records based on Survey Setup
         * Registration Details:
         * Event/Message:
         *      Pre/Create:
         *      Post/Update:
         *      Post/Create:
         * Primary Entity: Survey Transaction
         */
        public void CreateSurveyTransaction(Entity vehiclePostDeliveryMonitoring)
        {
            _tracingService.Trace("Started CreateSurveyTransaction Method...");
            var branchId = vehiclePostDeliveryMonitoring.Contains("gsc_branchsiteid") ? vehiclePostDeliveryMonitoring.GetAttributeValue <EntityReference>("gsc_branchsiteid").Id
                : Guid.Empty;

            EntityCollection surveySetupCollection = CommonHandler.RetrieveRecordsByOneValue("gsc_cmn_surveysetup", "gsc_branchsiteid", branchId, _organizationService, null, OrderType.Ascending,
                                                                                             new[] { "gsc_cmn_surveysetupid" });

            _tracingService.Trace("Retrieved SurveySetup...");

            if (surveySetupCollection.Entities.Count < 1)
            {
                _tracingService.Trace("No survey setup found for branch of sales invoice...");
            }

            else
            {
                _tracingService.Trace("Survey Setup found...");

                var surveySetupId = surveySetupCollection.Entities[0].Id;
                EntityCollection surveyQuestionSetupCollection = CommonHandler.RetrieveRecordsByOneValue("gsc_cmn_surveyquestionssetup", "gsc_surveysetupid", surveySetupId, _organizationService, null, OrderType.Ascending,
                                                                                                         new[] { "gsc_question", "gsc_answertype", "gsc_cmn_surveyquestionssetupid", "gsc_surveyquestionssetuppn" });

                Entity surveyTransaction = new Entity("gsc_cmn_surveytransactions");
                _tracingService.Trace("Retrieved Survey Questions Setup...");

                foreach (Entity surveyQuestionSetup in surveyQuestionSetupCollection.Entities)
                {
                    _tracingService.Trace("Assigning Survey Transaction Fields...");

                    surveyTransaction["gsc_postdeliverymonitoringid"] = vehiclePostDeliveryMonitoring.Id;
                    surveyTransaction["gsc_question"]            = surveyQuestionSetup.GetAttributeValue <string>("gsc_question");
                    surveyTransaction["gsc_answertype"]          = surveyQuestionSetup.GetAttributeValue <OptionSetValue>("gsc_answertype").Value;
                    surveyTransaction["gsc_surveytransactionpn"] = surveyQuestionSetup.GetAttributeValue <string>("gsc_surveyquestionssetuppn");

                    _tracingService.Trace("Creating Survey Transaction Method...");
                    _organizationService.Create(surveyTransaction);
                }
            }
            _tracingService.Trace("Ended CreateSurveyTransaction Method...");
        }
Example #9
0
 private void btnLinkSave_Click(object sender, EventArgs e)
 {
     if (base.UserInfoDto.RoleType != "S")
     {
         CommonHandler.ShowMessage(MessageType.Information, "没有权限");
     }
     foreach (LinkDto link in grcLink.DataSource as List <LinkDto> )
     {
         if (string.IsNullOrEmpty(link.LinkCode))
         {
             CommonHandler.ShowMessage(MessageType.Information, "环节号码不能为空");
             grvLink.FocusedColumn    = gcLinkCode;
             grvLink.FocusedRowHandle = (grcLink.DataSource as List <LinkDto>).IndexOf(link);
             return;
         }
         foreach (LinkDto dlink in dataHandlerLink.DataList)
         {
             if (link != dlink)
             {
                 if (link.LinkCode == dlink.LinkCode && dlink.StatusType != 'D')
                 {
                     CommonHandler.ShowMessage(MessageType.Information, "环节号码重复");
                     grvLink.FocusedColumn    = gcLinkCode;
                     grvLink.FocusedRowHandle = (grcLink.DataSource as List <LinkDto>).IndexOf(link);
                     return;
                 }
             }
         }
     }
     if (CommonHandler.ShowMessage(MessageType.Confirm, "确定要保存吗?") == DialogResult.Yes)
     {
         List <LinkDto> linkList = dataHandlerLink.DataList;
         foreach (LinkDto link in linkList)
         {
             webService.SaveLink(CommonHandler.GetComboBoxSelectedValue(cboProject).ToString(),
                                 link.CharterCode, link.LinkCode, link.LinkName, link.LinkContent, link.InUserID, link.StatusType);
         }
     }
     SearchLink();
     CommonHandler.ShowMessage(MessageType.Information, "保存完毕");
     BindComBox.BindProject(cboProjectForSubject);
 }
Example #10
0
        /// <summary>
        /// Executes the plug-in.
        /// </summary>
        /// <param name="localContext">The <see cref="LocalPluginContext"/> which contains the
        /// <see cref="IPluginExecutionContext"/>,
        /// <see cref="IOrganizationService"/>
        /// and <see cref="ITracingService"/>
        /// </param>
        /// <remarks>
        /// For improved performance, Microsoft Dynamics CRM caches plug-in instances.
        /// The plug-in's Execute method should be written to be stateless as the constructor
        /// is not called for every invocation of the plug-in. Also, multiple system threads
        /// could execute the plug-in at the same time. All per invocation state information
        /// is stored in the context. This means that you should not use global variables in plug-ins.
        /// </remarks>
        protected void ExecutePostQuoteCreate(LocalPluginContext localContext)
        {
            if (localContext == null)
            {
                throw new ArgumentNullException("localContext");
            }

            IPluginExecutionContext context = localContext.PluginExecutionContext;
            IOrganizationService    service = localContext.OrganizationService;
            ITracingService         trace   = localContext.TracingService;
            Entity quote = (Entity)context.InputParameters["Target"];

            string message = context.MessageName;
            string error   = "";

            if (context.Depth > 1)
            {
                return;
            }

            try
            {
                QuoteHandler handler = new QuoteHandler(service, trace);

                #region Calling RetrieveAndCreateVehicleFreebies method
                EntityCollection quoteRecords = CommonHandler.RetrieveRecordsByOneValue("quote", "quoteid", quote.Id, service, null, OrderType.Ascending,
                                                                                        new[] { "gsc_productid", "gsc_financingschemeid", "gsc_vehicleunitprice", "gsc_vehiclecolorid1", "gsc_amountfinanced", "gsc_bankid", "gsc_branchid" });

                if (quoteRecords != null && quoteRecords.Entities.Count > 0)
                {
                    Entity quoteToUpdate = quoteRecords.Entities[0];
                    handler.RetrieveAndCreateVehicleFreebies(quoteToUpdate, message);
                    handler.CheckMonthlyAmortizationRecord(quoteToUpdate);
                }
                #endregion
            }
            catch (Exception ex)
            {
                //throw new InvalidPluginExecutionException(String.Concat("(Exception)\n", ex.Message, Environment.NewLine, ex.StackTrace, Environment.NewLine, error));
                throw new InvalidPluginExecutionException(ex.Message);
            }
        }
Example #11
0
        /// <summary>
        /// 进入页面初始化数据
        /// </summary>
        private void OnLoadView()
        {
            grcShop.DataSource = new List <ShopSubjectExamTypeDto>();
            dataHandler        = new XtraGridDataHandler <ShopSubjectExamTypeDto>(grvShop);

            //bind 项目
            XHX.Common.BindComBox.BindProject(cboProject);

            // bind A/B 卷
            List <ExamTypeDto> list      = new List <ExamTypeDto>();
            ExamTypeDto        examType1 = new ExamTypeDto();
            ExamTypeDto        examType3 = new ExamTypeDto();

            examType3.ExamTypeCode = "C";
            examType3.ExamTypeName = "普通";
            list.Add(examType3);
            examType1.ExamTypeCode = "A";
            examType1.ExamTypeName = "A卷";
            list.Add(examType1);
            ExamTypeDto examType2 = new ExamTypeDto();

            examType2.ExamTypeCode = "B";
            examType2.ExamTypeName = "B卷";
            list.Add(examType2);

            ExamTypeDto examType4 = new ExamTypeDto();
            ExamTypeDto examType5 = new ExamTypeDto();
            ExamTypeDto examType6 = new ExamTypeDto();

            examType4.ExamTypeCode = "E";
            examType4.ExamTypeName = "E卷";
            list.Add(examType4);
            examType5.ExamTypeCode = "D";
            examType5.ExamTypeName = "D卷";
            list.Add(examType5);

            examType6.ExamTypeCode = "F";
            examType6.ExamTypeName = "F卷";
            list.Add(examType6);

            CommonHandler.BindComboBoxItems <ExamTypeDto>(cboSubjectTypeExam, list, "ExamTypeName", "ExamTypeCode");
        }
Example #12
0
        private void SearchSubject()
        {
            DataSet           ds   = service.SearchSubject(CommonHandler.GetComboBoxSelectedValue(cboProject).ToString(), "", "", "");
            List <SubjectDto> list = new List <SubjectDto>();

            if (ds.Tables.Count > 0)
            {
                for (int j = 0; j < ds.Tables[0].Rows.Count; j++)
                {
                    SubjectDto subject = new SubjectDto();
                    //subject.LinkCode = Convert.ToString(ds.Tables[0].Rows[j]["LinkCode"]);
                    //subject.LinkName = Convert.ToString(ds.Tables[0].Rows[j]["LinkName"]);
                    subject.SubjectCode = Convert.ToString(ds.Tables[0].Rows[j]["SubjectCode"]);
                    //subject.CheckPoint = Convert.ToString(ds.Tables[0].Rows[j]["CheckPoint"]);
                    //subject.ChapterName = Convert.ToString(ds.Tables[0].Rows[j]["CharterName"]);
                    list.Add(subject);
                }
            }
            grcSubject.DataSource = list;
        }
 private void cboProjectForSubject_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         if (CommonHandler.GetComboBoxSelectedValue(cboProjectForSubject) != null &&
             !string.IsNullOrEmpty(CommonHandler.GetComboBoxSelectedValue(cboProjectForSubject).ToString()))
         {
             BindComBox.BindChapter(CommonHandler.GetComboBoxSelectedValue(cboProjectForSubject).ToString(), cboChapterForSubject);
             BindComBox.BindChapter(CommonHandler.GetComboBoxSelectedValue(cboProject).ToString(), cboChapter);
         }
         else
         {
             BindComBox.BindChapter(CommonHandler.GetComboBoxSelectedValue(cboProjectForSubject).ToString(), cboChapterForSubject);
             CommonHandler.SetComboBoxSelectedValue(cboChapterForSubject, "");
         }
     }
     catch (Exception)
     {
     }
 }
Example #14
0
 public override void SaveButtonClick()
 {
     if (base.UserInfoDto.RoleType != "S")
     {
         CommonHandler.ShowMessage(MessageType.Information, "没有权限");
         return;
     }
     grvPosition.CloseEditor();
     grvPosition.UpdateCurrentRow();
     if (CommonHandler.ShowMessage(MessageType.Confirm, "确定要保存吗?") == DialogResult.Yes)
     {
         List <PositionDto> areaList = dataHandler.DataList;
         foreach (PositionDto area in areaList)
         {
             local.PositionSave(Convert.ToInt32(area.PositionCode), area.PositionName, area.Remark, this.UserInfoDto.UserID);
         }
     }
     SearchArea();
     CommonHandler.ShowMessage(MessageType.Information, "保存完毕");
 }
Example #15
0
        private Entity RetrieveInventory(Entity vehicleSalesReturnEntity)
        {
            _tracingService.Trace("Retrieve Inventory.");

            Guid inventoryId = vehicleSalesReturnEntity.Contains("gsc_inventoryid")
                ? vehicleSalesReturnEntity.GetAttributeValue <EntityReference>("gsc_inventoryid").Id
                : Guid.Empty;

            EntityCollection inventoryRecords = CommonHandler.RetrieveRecordsByOneValue("gsc_iv_inventory", "gsc_iv_inventoryid", inventoryId, _organizationService,
                                                                                        null, OrderType.Ascending, new[] { "gsc_status", "gsc_productquantityid", "gsc_modelcode", "gsc_optioncode" });

            _tracingService.Trace(inventoryRecords.Entities.Count + " Inventory Records Retrieved...");

            if (inventoryRecords != null && inventoryRecords.Entities.Count > 0)
            {
                return(inventoryRecords.Entities[0]);
            }

            return(null);
        }
Example #16
0
    void Update()
    {
        CheckOtherActions();

        /*if (!gameState.Equals(GameStateEnum.Play))
         *  return;*/

        if (!CommonHandler.IsObjectInCamera(cameraObject, gameCamera.transform, player.transform.position))
        {
            // GameOver();
        }

        //uiManager.CheckForBackLine(player.transform.position);


        MoveCamera();
        MovePlayer();

        CheckScore();
    }
        private void btnClear_Click(object sender, EventArgs e)
        {
            try
            {
                if (base.UserInfoDto.RoleType == "C")
                {
                    return;
                }
                if (CommonHandler.ShowMessage(MessageType.Confirm, "确定要清空吗?") == DialogResult.Yes)
                {
                    service.DeleteData(CommonHandler.GetComboBoxSelectedValue(cboProjects).ToString());

                    CommonHandler.ShowMessage(MessageType.Information, "删除完毕,");
                }
            }
            catch (Exception ex)
            {
                CommonHandler.ShowMessage(ex);
            }
        }
Example #18
0
 public override void SaveButtonClick()
 {
     grvProject.CloseEditor();
     grvProject.UpdateCurrentRow();
     grvProject.RefreshData();
     if (base.UserInfoDto.RoleType != "S")
     {
         CommonHandler.ShowMessage(MessageType.Information, "没有权限");
     }
     if (CommonHandler.ShowMessage(MessageType.Confirm, "确定要保存吗?") == DialogResult.Yes)
     {
         List <ProjectDto> projectList = dataHandler.DataList;
         foreach (ProjectDto project in projectList)
         {
             local.ProjectSave(project.StatusType, project.ProjectCode, project.Year, project.Quarter);
         }
     }
     SearchProject();
     CommonHandler.ShowMessage(MessageType.Information, "保存完毕");
 }
Example #19
0
        public Entity UpdateProductQuantity(Entity inventoryEntity, int onhand, int available, int allocated, int onOrder, int sold, int inTransit, int damaged, int backOrder)
        {
            var quantityId = inventoryEntity.GetAttributeValue <EntityReference>("gsc_productquantityid") != null
                ? inventoryEntity.GetAttributeValue <EntityReference>("gsc_productquantityid").Id
                : Guid.Empty;

            EntityCollection quantityRecords = CommonHandler.RetrieveRecordsByOneValue("gsc_iv_productquantity", "gsc_iv_productquantityid", quantityId, _organizationService, null, OrderType.Ascending,
                                                                                       new[] { "gsc_onhand", "gsc_available", "gsc_allocated", "gsc_onorder", "gsc_sold", "gsc_intransit", "gsc_damaged", "gsc_backorder", "gsc_vehiclecolorid", "gsc_vehiclemodelid" });

            if (quantityRecords != null && quantityRecords.Entities.Count > 0)
            {
                _tracingService.Trace("Retrieved Product Quantity Details");

                Entity quantityEntity = quantityRecords.Entities[0];

                return(UpdateProductQuantityDirectly(quantityEntity, onhand, available, allocated, onOrder, sold, inTransit, damaged, backOrder));
            }

            return(null);
        }
Example #20
0
        private void SearchChapter()
        {
            List <ChapterDto> sourcechapterList = new List <ChapterDto>();
            string            projectCode       = CommonHandler.GetComboBoxSelectedValue(cboProject).ToString();
            DataSet           ds = service.SearchChapter(projectCode, "");

            if (ds.Tables.Count > 0)
            {
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    ChapterDto chapter = new ChapterDto();
                    chapter.CharterName    = Convert.ToString(ds.Tables[0].Rows[i]["CharterName"]);
                    chapter.CharterCode    = Convert.ToString(ds.Tables[0].Rows[i]["CharterCode"]);
                    chapter.CharterContent = Convert.ToString(ds.Tables[0].Rows[i]["CharterContent"]);
                    //inspection.InspectionStandardName = Convert.ToString(ds.Tables[0].Rows[i]["InspectionStandardName"]);
                    sourcechapterList.Add(chapter);
                }
                grcChapter.DataSource = sourcechapterList;
            }
        }
        public void Search()
        {
            grcShopScore.DataSource = null;
            string projectCode = CommonHandler.GetComboBoxSelectedValue(cboProject).ToString();
            string type        = chkArea.Checked?"BigArea":"";
            List <TwoLevelColumnInfo> columnInfoList        = SearchHead(type);
            List <InspectionStandardReportBodyDto> dataList = SearchBodyData(projectCode, type);
            List <InspectionStandardReportDto>     leftList = SearchLeft(projectCode);

            DynamicColumnDataSet <TwoLevelColumnInfo, InspectionStandardReportBodyDto, InspectionStandardReportDto> list = new DynamicColumnDataSet <TwoLevelColumnInfo, InspectionStandardReportBodyDto, InspectionStandardReportDto>(columnInfoList, dataList, leftList);

            if (list != null && list.ColumnInfoList != null)
            {
                list.DtoList = DynamicColumnUtil.CombineDynamicColumnDto <TwoLevelColumnInfo, InspectionStandardReportBodyDto, InspectionStandardReportDto>(list.ColumnInfoList, list.DataList, list.DtoList);
            }

            CommonHandler.BuildDynamicColumn <TwoLevelColumnInfo, InspectionStandardReportDto>(grvShopScore, list.ColumnInfoList, list.DtoList);

            grvShopScore.LeftCoord = 0;
        }
Example #22
0
        public override void DeleteButtonClick()
        {
            DialogResult reslut = CommonHandler.ShowMessage(MessageType.Confirm, "确定要删除选中的行吗?");

            if (reslut != DialogResult.Yes)
            {
                return;
            }
            dataHandler.DelCheckedRow(selection.CheckMarkColumn);
            selection.ClearSelection();

            foreach (NoticeDto item in dataHandler.DataList)
            {
                if (item.StatusType == 'D')
                {
                    webService.DeleteNotice(item.NoticeID);
                }
            }
            this.SearchButtonClick();
        }
Example #23
0
 public override void SaveButtonClick()
 {
     try
     {
         grvShop.CloseEditor();
         if (dataHandler.DataList.Count > 0)
         {
             foreach (ShopRecordDto shop in dataHandler.DataList)
             {
                 webService.SaveShopRecordUrl(CommonHandler.GetComboBoxSelectedValue(cboProject).ToString(), shop.ShopCode, shop.RecordUrl, shop.Password, UserInfoDto.UserID);
             }
         }
         CommonHandler.ShowMessage(MessageType.Information, "保存完毕");
     }
     catch (Exception e)
     {
         CommonHandler.ShowMessage(e);
     }
     SearchResult();
 }
Example #24
0
 public override void SaveButtonClick()
 {
     try
     {
         grvShop.CloseEditor();
         if (dataHandler.DataList.Count > 0)
         {
             foreach (ShopSubjectExamTypeDto shop in dataHandler.DataList)
             {
                 webService.SaveShopExamType(CommonHandler.GetComboBoxSelectedValue(cboProject).ToString(), shop.ShopCode, shop.ExamTypeCode, shop.CheckUserId, shop.CheckDate);
             }
         }
         CommonHandler.ShowMessage(MessageType.Information, "保存完毕");
     }
     catch (Exception e)
     {
         CommonHandler.ShowMessage(e);
     }
     SearchResult();
 }
Example #25
0
        //Created By : Jerome Anthony Gerero, Created On : 6/29/2016

        /*Purpose: Set newly created Receiving Transaction Detail fields
         * Registration Details:
         * Event/Message:
         *      Pre/Create: Invoice = gsc_invoiceid
         *      Post/Update:
         *      Post/Create:
         * Primary Entity: Receiving Transaction Detail_
         */
        public Entity SetReceivingTransactionDetailFields(Entity receivingTransactionDetailEntity)
        {
            _tracingService.Trace("Started SetReceivingTransactionDetailName Method...");

            var inventoryId = receivingTransactionDetailEntity.GetAttributeValue <EntityReference>("gsc_inventoryid") != null
                ? receivingTransactionDetailEntity.GetAttributeValue <EntityReference>("gsc_inventoryid").Id
                : Guid.Empty;

            EntityCollection inventoryRecords = CommonHandler.RetrieveRecordsByOneValue("gsc_iv_inventory", "gsc_iv_inventoryid", inventoryId, _organizationService, null, OrderType.Ascending,
                                                                                        new[] { "gsc_inventorypn" });

            if (inventoryRecords != null && inventoryRecords.Entities.Count > 0)
            {
                Entity inventory = inventoryRecords.Entities[0];
                receivingTransactionDetailEntity["gsc_receivingtransactiondetailpn"] = inventory.GetAttributeValue <String>("gsc_inventorypn");
            }

            _tracingService.Trace("Ended SetReceivingTransactionDetailName Method...");
            return(receivingTransactionDetailEntity);
        }
        public void UpdateVPOSubmitted(Entity cfoQuantityEntity)
        {
            var detailConditionList = new List <ConditionExpression>
            {
                new ConditionExpression("gsc_committedfirmorderquantityid", ConditionOperator.Equal, cfoQuantityEntity.Id),
                new ConditionExpression("gsc_vpoquantityforsubmission", ConditionOperator.NotNull)
            };

            EntityCollection detailRecords = CommonHandler.RetrieveRecordsByConditions("gsc_sls_committedfirmorderquantitydetail", detailConditionList, _organizationService, "createdon", OrderType.Descending,
                                                                                       new[] { "gsc_vpoquantityforsubmission", "gsc_submittedvpo", "gsc_allocatedquantity", "gsc_vpobalance", "gsc_vpobalfromprevmonth", "gsc_productid", "gsc_siteid", "gsc_committedfirmorderquantityid" });

            if (detailRecords != null && detailRecords.Entities.Count > 0)
            {
                foreach (Entity detail in detailRecords.Entities)
                {
                    CommittedFirmOrderQuantityDetailHandler cfoQuantityDetailHandler = new CommittedFirmOrderQuantityDetailHandler(_organizationService, _tracingService);
                    cfoQuantityDetailHandler.SubmitVPO(detail, "Update");
                }
            }
        }
        private void BindSubject(string projectCode)
        {
            List <SubjectDto> subjectList = new List <SubjectDto>();
            DataSet           ds          = webService.SearchSubject(projectCode, "", "", "");

            if (ds.Tables[0].Rows.Count > 0)
            {
                SubjectDto allSubject = new SubjectDto();
                allSubject.SubjectCode = "";
                subjectList.Add(allSubject);

                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    SubjectDto subject = new SubjectDto();
                    subject.SubjectCode = Convert.ToString(ds.Tables[0].Rows[i]["SubjectCode"]);
                    subjectList.Add(subject);
                }
                CommonHandler.SetComboBoxEditItems(cboSubject, subjectList, "SubjectCode", "SubjectCode");
            }
        }
        public Shop_Popup(string projectCode, string shopCode, string shopName, bool check)
        {
            InitializeComponent();
            this.LookAndFeel.SetSkinStyle(CommonHandler.Skin_Name);

            BindComBox.BindProject(cboProjects);
            CommonHandler.SetComboBoxSelectedValue(cboProjects, projectCode);
            BindArea();
            txtShopCode.Text = shopCode;
            txtShop.Text     = shopName;
            Search();
            if (check)
            {
                selection = new GridCheckMarksSelection(gridView1);
                selection.CheckMarkColumn.VisibleIndex = 0;
            }
            else
            {
            }
        }
Example #29
0
        public Boolean IsUsedInTransaction(Entity contactEntity)
        {
            _tracingService.Trace("IsUsedInTransaction Method Started");

            EntityCollection opportunityEC = CommonHandler.RetrieveRecordsByOneValue("opportunity", "customerid", contactEntity.Id, _organizationService, null, OrderType.Ascending,
                                                                                     new[] { "customerid" });

            EntityCollection quoteEC = CommonHandler.RetrieveRecordsByOneValue("quote", "customerid", contactEntity.Id, _organizationService, null, OrderType.Ascending,
                                                                               new[] { "customerid" });

            EntityCollection salesOrderEC = CommonHandler.RetrieveRecordsByOneValue("salesorder", "customerid", contactEntity.Id, _organizationService, null, OrderType.Ascending,
                                                                                    new[] { "customerid" });

            if (opportunityEC.Entities.Count > 0 || quoteEC.Entities.Count > 0 || salesOrderEC.Entities.Count > 0)
            {
                return(true);
            }
            _tracingService.Trace("IsUsedInTransaction Method Ended");
            return(false);
        }
Example #30
0
        // Created By: Joseph F. Cadiao, Created On: 8/1/2017

        /*Purpose: Check if record's In-Transit Transfer already exist
         * Registration Details:
         * Event/Message:
         *      Post/Create: gsc_intransittransfer
         * Primary Entity: Vehicle In-Transit Transfer Receiving
         */
        public bool DetectDuplicate(Entity vehicleReceivingTransfer)
        {
            QueryExpression query = new QueryExpression("gsc_iv_vehicleintransittransferreceiving");

            query.ColumnSet.AddColumn("gsc_intransittransferid");

            Guid transferId = CommonHandler.GetEntityReferenceValueSafe(vehicleReceivingTransfer, "gsc_intransittransferid");

            query.Criteria.AddCondition(new ConditionExpression("gsc_intransittransferid", ConditionOperator.Equal, transferId));
            query.Criteria.AddCondition(new ConditionExpression("gsc_intransitstatus", ConditionOperator.Equal, 100000000));

            int count = _organizationService.RetrieveMultiple(query).Entities.Count;

            if (count > 0)
            {
                return(true);
            }

            return(false);
        }