Exemple #1
0
 public MessageBase(eControl ctrl)
 {
     this.TypeSource = eDevice.PC;
     this.TypeDest   = eDevice.Switch;
     this.Address    = 0;
     this.Control    = ctrl;
 }
Exemple #2
0
        /// <summary>
        /// 控件导出EXCEL 
        /// </summary>
        /// <param name="dataControl">控件名称</param>
        /// <param name="dt">要导出的Datatable数据</param>
        /// <param name="title">名称</param>
        /// <param name="Control">控件类型 GridView or Repeater</param>
        public static void ExportExcelDataControl(object dataControl, ref DataTable dt, string title, eControl Control)
        {
            HttpResponse Response = System.Web.HttpContext.Current.Response;
            StringWriter objStringWriter = new StringWriter();
            HtmlTextWriter objHtmlTextWriter = new HtmlTextWriter(objStringWriter);

            if (Control == eControl.GridView)
            {
                GridView gvList = (GridView)dataControl;
                gvList.DataSource = dt;
                gvList.DataBind();
                gvList.RenderControl(objHtmlTextWriter);
            }
            if (Control == eControl.Repeater)
            {
                Repeater rpList = (Repeater)dataControl;
                rpList.DataSource = dt;
                rpList.DataBind();
                rpList.RenderControl(objHtmlTextWriter);
            }
            string style = @"<html><head><meta http-equiv=""Content-Type"" content=""text/html; charset=utf-8"" /><style> .text { mso-number-format:\@; } </style></head><body>";
            string filename = title + DateTime.Now.ToString("yyyyMMddHHmmss");
            Response.Clear();
            Response.Buffer = true;
            Response.AppendHeader("Content-Disposition", "attachment;filename=" + filename + ".xls");
            Response.ContentType = "application/ms-excel";
            Response.Write(style);
            Response.Write(objStringWriter.ToString());
            Response.Write("</body></html>");
            Response.End();
        }
Exemple #3
0
        protected void SendMessage(eControl ctrl)
        {
            var msg = new TSL_Message()
            {
                Control = ctrl
            };

            this.Modem.SendMessage(msg);
        }
    private void SetControl(eControl Control)
    {
        pnlItemAdjustment.Visible       = (Control == eControl.ItemAdjustment);
        pnlItemAdjustmentDetail.Visible = (Control == eControl.ItemAdjustmentDetail);

        if (Control == eControl.ItemAdjustment)
        {
            LoadItemAdjustmentGrid(ePageIndex.Custom);
            CheckVisibleButton();
        }
        else if (Control == eControl.ItemAdjustmentDetail)
        {
            LoadItemAdjustmentDetail();
        }
    }
Exemple #5
0
    private void SetControl(eControl Control)
    {
        pnlOnlineCourier.Visible      = (Control == eControl.OnlineCourier);
        pnlOnlineCourierValue.Visible = (Control == eControl.OnlineCourierValue);

        if (Control == eControl.OnlineCourier)
        {
            LoadOnlineCourierGrid(ePageIndex.Custom);
            CheckVisibleButton();
        }
        else if (Control == eControl.OnlineCourierValue)
        {
            LoadOnlineCourierValueGrid();
        }
    }
    private void SetControl(eControl Control)
    {
        pnlVariant.Visible      = (Control == eControl.Variant);
        pnlVariantValue.Visible = (Control == eControl.VariantValue);

        if (Control == eControl.Variant)
        {
            LoadVariantGrid(ePageIndex.Custom);
            CheckVisibleButton();
        }
        else if (Control == eControl.VariantValue)
        {
            LoadVariantValueGrid();
            CheckVisibleButtonValue();
        }
    }
    private void SetControl(eControl Control)
    {
        divUser.Visible      = false;
        pnlAuthority.Visible = false;

        PageIndex = 0;
        switch (Control)
        {
        case eControl.User:
            LoadUserGrid(ePageIndex.Custom);
            CheckVisibleButton();
            divUser.Visible = true;
            break;

        case eControl.Authority:
            ManageAuthority.LoadAuthorityDetail(0, txtUsersId.zToInt().Value, "User");
            pnlAuthority.Visible = true;
            break;
        }
    }
Exemple #8
0
    private void SetControl(eControl Control)
    {
        switch (Control)
        {
        case eControl.UserDetail:
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "ManageTabUser", "ManageTabUser('liTabUserDetail', 'pnlUserDetail');", true);
            break;

        case eControl.ContactDetail:
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "ManageTabUser", "ManageTabUser('liTabContactDetail', 'pnlContactDetail');", true);
            break;

        case eControl.Authentication:
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "ManageTabUser", "ManageTabUser('liTabAuthentication', 'pnlAuthentication');", true);
            break;

        default:
            break;
        }
    }
    private void SetControl(eControl Control)
    {
        pnlDesignation.Visible          = false;
        pnlDesignationAuthority.Visible = false;

        switch (Control)
        {
        case eControl.Designation:
            pnlDesignation.Visible = true;
            LoadDesignationGrid(ePageIndex.Custom);
            CheckVisibleButton();
            break;

        case eControl.DesignationAuthority:
            pnlDesignationAuthority.Visible = true;
            ManageAuthority.LoadAuthorityDetail(lblDesignationId.zToInt().Value, 0, "Designation");
            break;

        default:
            break;
        }
    }
Exemple #10
0
        /// <summary>
        /// 控件导出EXCEL
        /// </summary>
        /// <param name="dataControl">控件名称</param>
        /// <param name="dt">要导出的Datatable数据</param>
        /// <param name="title">名称</param>
        /// <param name="Control">控件类型 GridView or Repeater</param>
        public static void ExportExcelDataControl(object dataControl, ref DataTable dt, string title, eControl Control)
        {
            HttpResponse   Response          = System.Web.HttpContext.Current.Response;
            StringWriter   objStringWriter   = new StringWriter();
            HtmlTextWriter objHtmlTextWriter = new HtmlTextWriter(objStringWriter);

            if (Control == eControl.GridView)
            {
                GridView gvList = (GridView)dataControl;
                gvList.DataSource = dt;
                gvList.DataBind();
                gvList.RenderControl(objHtmlTextWriter);
            }
            if (Control == eControl.Repeater)
            {
                Repeater rpList = (Repeater)dataControl;
                rpList.DataSource = dt;
                rpList.DataBind();
                rpList.RenderControl(objHtmlTextWriter);
            }
            string style    = @"<html><head><meta http-equiv=""Content-Type"" content=""text/html; charset=utf-8"" /><style> .text { mso-number-format:\@; } </style></head><body>";
            string filename = title + DateTime.Now.ToString("yyyyMMddHHmmss");

            Response.Clear();
            Response.Buffer = true;
            Response.AppendHeader("Content-Disposition", "attachment;filename=" + filename + ".xls");
            Response.ContentType = "application/ms-excel";
            Response.Write(style);
            Response.Write(objStringWriter.ToString());
            Response.Write("</body></html>");
            Response.End();
        }
Exemple #11
0
 public SimpleMessage(eControl ctrl, byte?data = null) : base(ctrl)
 {
     this.Data = data;
 }
 private void SetControl(eControl Control)
 {
     pnlCourier.Visible        = Control == eControl.Courier;
     pnlShippingCharge.Visible = Control == eControl.ShippingCharge;
 }
Exemple #13
0
 public void SendSimpleMessage(eControl ctrl, byte?data = null, bool queue = false)
 {
     SendData(new SimpleMessage(ctrl, data), queue);
 }
Exemple #14
0
 private void SetControl(eControl Control)
 {
     pnlPriceList.Visible      = Control == eControl.PriceList;
     pnlPriceListValue.Visible = Control == eControl.PriceListValue;
 }
Exemple #15
0
 public void SendSimpleMessage(eControl ctrl, byte?data = null)
 {
     this.Presentation.SendData(new SimpleMessage(ctrl, data), true);
 }