Пример #1
0
        public List <DC_SupplierEntity> GetActivitySysStatusData(MDMSVC.DC_SupplierEntity RQParams)
        {
            object result = null;

            ServiceConnection.MDMSvcProxy.GetData(string.Format(ConfigurationManager.AppSettings["DistribuitionActivityData"]), typeof(List <MDMSVC.DC_SupplierEntity>), out result);
            //return Convert.ToDateTime(result);
            return(result as List <DC_SupplierEntity>);
        }
        private void GetActivityTransferStatus()
        {
            try
            {
                dvMsg.Style.Add("display", "none");
                MDMSVC.DC_SupplierEntity RQ = new MDMSVC.DC_SupplierEntity();
                var result = MasterSvc.GetActivitySysStatusData(RQ);

                if (result != null)
                {
                    grdvwActivityData.DataSource = result;
                    grdvwActivityData.DataBind();
                }
                else
                {
                    grdvwActivityData.DataSource = null;
                    grdvwActivityData.DataBind();
                }


                foreach (GridViewRow rowitem in grdvwActivityData.Rows)
                {
                    if (rowitem.Cells[2].Text == "Running" || rowitem.Cells[2].Text == "Scheduled")
                    {
                        foreach (GridViewRow row in grdSupplierEntity.Rows)
                        {
                            LinkButton refreshButton = (LinkButton)(row.FindControl("btnUpdate"));
                            refreshButton.Enabled   = false;
                            refreshButton.BackColor = System.Drawing.Color.Red;
                        }
                        break;
                    }
                    else
                    {
                        foreach (GridViewRow row in grdSupplierEntity.Rows)
                        {
                            LinkButton refreshButton = (LinkButton)(row.FindControl("btnUpdate"));
                            refreshButton.Enabled   = true;
                            refreshButton.BackColor = System.Drawing.Color.Green;
                        }
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
        protected void GetStaticHotelData()
        {
            dvMsg.Style.Add("display", "none");
            MDMSVC.DC_SupplierEntity RQ = new MDMSVC.DC_SupplierEntity();
            var result = MasterSvc.GetStaticHotel(RQ);

            if (result != null)
            {
                grdSupplierEntity.DataSource = result;
                grdSupplierEntity.DataBind();
            }
            else
            {
                grdSupplierEntity.DataSource = null;
                grdSupplierEntity.DataBind();
            }


            foreach (GridViewRow rowitem in grdSupplierEntity.Rows)
            {
                if (rowitem.Cells[4].Text == "Running" || rowitem.Cells[4].Text == "Scheduled")
                {
                    foreach (GridViewRow row in grdSupplierEntity.Rows)
                    {
                        LinkButton refreshButton = (LinkButton)(row.FindControl("btnUpdate"));
                        refreshButton.Enabled   = false;
                        refreshButton.BackColor = System.Drawing.Color.Red;
                    }
                    break;
                }
                else
                {
                    foreach (GridViewRow row in grdSupplierEntity.Rows)
                    {
                        LinkButton refreshButton = (LinkButton)(row.FindControl("btnUpdate"));
                        refreshButton.Enabled   = true;
                        refreshButton.BackColor = System.Drawing.Color.Green;
                    }
                }
            }
        }