当前位置: 首页>>代码示例>>C#>>正文


C# Ticket.GetType方法代码示例

本文整理汇总了C#中Ticket.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# Ticket.GetType方法的具体用法?C# Ticket.GetType怎么用?C# Ticket.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Ticket的用法示例。


在下文中一共展示了Ticket.GetType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RadGrid1_ItemDataBound

    protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {
        if (e.Item is GridCommandItem)
        {
            ImageButton imgb = (ImageButton)e.Item.FindControl("New");
            imgb.Visible = per.Create;
            if (pat != null)
                imgb.OnClientClick = "NewTicketRecordInTab();";
        }
        if (e.Item is GridDataItem)
        {
            ImageButton imgb = null;
            string name = "";
            string command = "";
            GridDataItem gdi;
            string id = "";
            ArrayList selectedItems;
            
            // assign javascript function to select button
            imgb = (ImageButton)e.Item.FindControl("Select");
            gdi = (GridDataItem)e.Item;
            // payed?
                
            if (Session["selectedItems"] == null)
            {
                selectedItems = new ArrayList();
            }
            else
            {
                selectedItems = (ArrayList)Session["selectedItems"];
            }
            id = e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex][e.Item.OwnerTableView.DataKeyNames[0]].ToString();
            if (selectedItems.Contains(id))
            {
                //e.Item.Selected = true;
                gdi.BackColor = Color.LightGreen;
                //gdi["Policy.Insurance.Name"].BackColor = Color.LightGreen;
            }
            else
            {
                gdi.BackColor = new Color();
                //e.Item.Selected = false;
            }
            
            //}
            //if (e.Item is GridDataItem)
            //{
            //ImageButton imgb = null;
            //string name = "";
            //string command = "";
            //GridDataItem gdi;
            //int id = 0;
            
            //id = (int)e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex][e.Item.OwnerTableView.DataKeyNames[0]];
            
            //// assign javascript function to select button
            //imgb = (ImageButton)e.Item.FindControl("Select");
            //gdi = (GridDataItem)e.Item;
            //// payed?
            
            // backgroud color for primary types
            //if (gdi["Checked"].Text == "True")
            //{
            //    //gdi["Policy.Insurance.Name"].BackColor = Color.LightGreen;
            //    gdi["Policy.Insurance.Name"].BackColor = Color.LightGreen;
            //}
            name = String.Format("{0} ({1}: {2})",
                gdi["Policy.Customer.FullName"].Text,
                gdi["Description"].Text,
                gdi["Amount"].Text);
            command = String.Format("return Selection('{0}','{1}','{2}','{3}','{4}');",
                id.ToString(),
                gdi["Amount"].Text.Replace("€", ""),
                name,
                null,
                "Ticket");
            imgb.OnClientClick = command;
            if (type != "S")
                imgb.Visible = false; // not called from another form
            
            // assign javascript function to edit button
            imgb = (ImageButton)e.Item.FindControl("Edit");
            //if (pat == null)
            //    command = String.Format("return EditTicketRecord({0});", id);
            //else
            //    command = String.Format("return EditTicketRecordInTab({0});", id);
            tck = CntAriCli.GetTicket(int.Parse(id), ctx);
            if (tck.GetType() == typeof(AnestheticTicket))
            {
                command = String.Format("EditAnestheticTicketRecord({0})", id); // general ticket grid
            }
            else
            {
                command = String.Format("EditTicketRecord({0})", id); // general ticket grid
            }

            imgb.OnClientClick = command;
            
            // assigning javascript functions to delete button
            imgb = (ImageButton)e.Item.FindControl("Delete");
//.........这里部分代码省略.........
开发者ID:ragare62,项目名称:AriClinic,代码行数:101,代码来源:SettlementGrid.aspx.cs

示例2: RadGrid1_ItemCommand

 protected void RadGrid1_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
 {
     string command = "";
     // weonly process commands with a datasource (our image buttons)
     if (e.CommandSource == null)
         return;
     string typeOfControl = e.CommandSource.GetType().ToString();
     if (typeOfControl.Equals("System.Web.UI.WebControls.ImageButton"))
     {
         int id = 0;
         ImageButton imgb = (ImageButton)e.CommandSource;
         if (imgb.ID != "New" && imgb.ID != "Exit" && imgb.ID != "NewAnesthetic")
             id = (int)e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex][e.Item.OwnerTableView.DataKeyNames[0]];
         switch (imgb.ID)
         {
             case "Select":
                 break;
             case "Edit":
                 // new tratement (now there's more that one ticket's kind)
                 tck = CntAriCli.GetTicket(id, ctx);
                 if (tck.GetType() == typeof(AnestheticTicket))
                 {
                     if (cus == null)
                     {
                         if (asn == null)
                             command = String.Format("EditAnestheticTicketRecord({0})", id); // general ticket grid
                         else
                         // asn have only anesthetic tickets 
                             command = String.Format("EditAnestheticTicketRecordServiceNote({0},{1})"
                                                     , asn.AnestheticServiceNoteId
                                                     , id);
                     }
                     else
                         command = String.Format("EditAnestheticTicketRecordInTab({0})", id); // inside tabstrip
                 }
                 else
                 {
                     // normal ticket
                     if (cus == null)
                     {
                         if (sn == null)
                             command = String.Format("EditTicketRecord({0})", id); // general ticket grid
                         else
                             command = String.Format("EditTicketRecordServiceNote({0},{1})"
                                                     , sn.ServiceNoteId
                                                     , id);
                     }
                     else
                         command = String.Format("EditTicketRecordInTab({0})", id); // inside tabstrip
                 }
                 RadAjaxManager1.ResponseScripts.Add(command);
                 break;
             case "Delete":
                 Session["DeleteId"] = id;
                 string message = Resources.GeneralResource.DeleteRecordQuestion;
                 GridDataItem gdi = (GridDataItem)e.Item;
                 message = String.Format("{0}<br/>{1}: {2}", message, gdi["Description"].Text, gdi["Amount"].Text);
                 command = String.Format("ariDialog('{0}','{1}','prompt',null,0,0)"
                                         , Resources.GeneralResource.Question
                                         , message);
                 RadAjaxManager1.ResponseScripts.Add(command);
                 break;
         }
     }
 }
开发者ID:ragare62,项目名称:AriClinic,代码行数:65,代码来源:TicketGrid.aspx.cs


注:本文中的Ticket.GetType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。