示例#1
0
        private void OnToolWindowCreated(object sender, Telerik.Windows.Controls.Docking.ElementCreatedEventArgs e)
        {
            var toolWindow = e.CreatedElement as ToolWindow;
            var pane = e.SourceElement as RadPane;
            var paneGroup = e.SourceElement as RadPaneGroup;
            object tag = null;
            if (pane == null && paneGroup != null)
            {
                pane = paneGroup.EnumeratePanes().FirstOrDefault();
            }
            else
            {
                if (pane != null)
                {
                    tag = pane.Tag;
                }
                else
                {
                    var splitContainer = e.SourceElement as RadSplitContainer;
                    if (splitContainer != null)
                    {
                        tag = splitContainer.Tag;
                    }
                }
            }

            SetToolWindowStyle(toolWindow, tag != null ? tag : pane.Tag);
        }
    public void RadGrid1_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {
        if (e.Item is GridCommandItem)
        {
            GridCommandItem commandItem = (e.Item as GridCommandItem);
            PlaceHolder container = (PlaceHolder)commandItem.FindControl("PlaceHolder1");
            Label label = new Label();
            label.Text = "  ";

            container.Controls.Add(label);

            for (int i = 65; i <= 65 + 25; i++)
            {
                LinkButton linkButton1 = new LinkButton();

                LiteralControl lc = new LiteralControl("&nbsp;&nbsp;");

                linkButton1.Text = "" + (char)i;

                linkButton1.CommandName = "alpha";
                linkButton1.CommandArgument = "" + (char)i;

                container.Controls.Add(linkButton1);
                container.Controls.Add(lc);
            }

            LiteralControl lcLast = new LiteralControl("&nbsp;");
            container.Controls.Add(lcLast);

            LinkButton linkButtonAll = new LinkButton();
            linkButtonAll.Text = "Tất cả";
            linkButtonAll.CommandName = "NoFilter";
            container.Controls.Add(linkButtonAll);
        }
    }
 protected void grid_VisitorContacts_Delete(object sender, Telerik.Web.UI.GridCommandEventArgs e)
 {
     int id = Convert.ToInt32((e.Item as GridDataItem).OwnerTableView.DataKeyValues[e.Item.ItemIndex]["VisitorContactID"]);
     BallyliffinDataContext db = new BallyliffinDataContext();
     db.sp_visitorContacts_Delete(id);
     grid_VisitorContacts.Rebind();
 }
 protected void ddlTipoArchivo_SelectedIndexChanged(object sender, Telerik.Web.UI.DropDownListEventArgs e)
 {
     cargarColumnas(this.ddlTipoArchivo.SelectedValue);
     cargarGrilla();
     limpiarLabels();
     this.myPanel3.Visible = false;
 }
示例#5
0
 protected void list_NeedDataSource(object sender, Telerik.Web.UI.RadListViewNeedDataSourceEventArgs e)
 {
     var doc = XDocument.Load(Server.MapPath("~/Common/配置/Depot.Mobile.xml"));
     var users = doc.Root.Elements();
     var source = users.Select(o => new { Id = o.Attribute("Id").Value, Name = o.Attribute("Name").Value }).ToList();
     list.DataSource = source;
 }
        protected void Bootstrapper_Initialized(object sender, Telerik.Sitefinity.Data.ExecutedEventArgs args)
        {
            //Register Inbound Pipe
            PublishingSystemFactory.RegisterPipe(XmlInboundPipe.PipeName, typeof(XmlInboundPipe));

            //Register Mappings
            var mappingsList = XmlInboundPipe.GetDefaultMapping();
            PublishingSystemFactory.RegisterPipeMappings(XmlInboundPipe.PipeName, true, mappingsList);

            //Register Pipe Settings
            RssPipeSettings pipeSettings = new RssPipeSettings();
            pipeSettings.IsInbound = true;
            pipeSettings.IsActive = true;
            pipeSettings.MaxItems = 25;
            pipeSettings.InvocationMode = PipeInvokationMode.Push;
            pipeSettings.UIName = "Brafton Feed";
            pipeSettings.PipeName = XmlInboundPipe.PipeName;
            pipeSettings.ResourceClassId = typeof(PublishingModuleExtensionsResources).Name;

            PublishingSystemFactory.RegisterPipeSettings(XmlInboundPipe.PipeName, pipeSettings);

            //Register Pipe Definitions
            var definitions = XmlInboundPipe.CreateDefaultPipeDefinitions();
            PublishingSystemFactory.RegisterPipeDefinitions(XmlInboundPipe.PipeName, definitions);

            //Register Outbound Pipe
            PublishingSystemFactory.RegisterPipe(CustomContentOutboundPipe.PipeName, typeof(CustomContentOutboundPipe));
        }
示例#7
0
 protected void RadComboBoxFirma_ItemsRequested(object sender, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
 {
     if (e.Text.Length > 3)
     {
         string sqlSelectCommand = "";
         sqlSelectCommand = "SELECT [UserID],[UserName] from [telerik_Users] ORDER BY [UserName]";
         SqlDataAdapter adapter = new SqlDataAdapter(sqlSelectCommand, ConfigurationManager.ConnectionStrings["KalData"].ConnectionString);
         adapter.SelectCommand.Parameters.AddWithValue("@text", e.Text);
         DataTable dataTable = new DataTable();
         adapter.Fill(dataTable);
         RadComboBoxFirma.Items.Clear();
         foreach (DataRow dataRow in dataTable.Rows)
         {
             string UserName = "";
             RadComboBoxItem item = new RadComboBoxItem();
             item.Text = (string)dataRow["UserName"].ToString();
             item.Value = dataRow["UserId"].ToString();
             UserName = (string)dataRow["UserName"];
             if (dataRow["UserName"] != System.DBNull.Value)
             {
                 UserName = (string)dataRow["UserName"];
             }
             //item.Attributes.Add("FIRMAADI", FirmaAdi);
             //item.Attributes.Add("IL_ILCE", IlIlce);
             RadComboBoxFirma.Items.Add(item);
             item.DataBind();
         }
         Label lbl = (Label)RadComboBoxFirma.Footer.FindControl("lblBulunanKayitSayisi");
         lbl.Text = "Bulunan kayıt sayısı:" + "  " + dataTable.Rows.Count.ToString();
     }
 }
示例#8
0
 protected void RadGrid1_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
 {
     // 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")
             id = (int)e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex][e.Item.OwnerTableView.DataKeyNames[0]];
         switch (imgb.ID)
         {
             case "Select":
                 break;
             case "Edit":
                 break;
             case "Delete":
                 Address adr = (from a in ctx.Addresses
                                where a.AddressId == id
                                select a).FirstOrDefault<Address>();
                 ctx.Delete(adr);
                 ctx.SaveChanges();
                 RefreshGrid(true);
                 break;
         }
     }
 }
示例#9
0
 protected void RadGridEditor_ItemDeleted(object source, Telerik.Web.UI.GridDeletedEventArgs e)
 {
     if (e.Exception != null)
     {
         e.ExceptionHandled = true;
         SqlException ex = e.Exception as SqlException;
         if (ex == null)
             DisplayMessage("لم نتمكن من حذف الصف وذلك بسبب:  " + Environment.NewLine + e.Exception.Message);
         else
             DisplayMessage("لم نتمكن من حذف الصف وذلك بسبب:  " + Environment.NewLine + MC.CheckExp(ex));
     }
     else
     {
         DisplayMessage("تم الحذف");
         SqlConnection con = MC.EStoreConnection;
         SqlCommand cmd = new SqlCommand("", con);
         try
         {
             con.Open();
             cmd.CommandText = "Delete From TblAccounts Where AccountId = " + e.Item["AccountId"].Text;
             cmd.ExecuteNonQuery();
         }
         catch (SqlException ex)
         {
             DisplayMessage("لم نتمكن من حذف الصف التابع وذلك بسبب:  " + Environment.NewLine + MC.CheckExp(ex));
         }
         con.Close();
     }
 }
 protected void Bootstrapper_Initializing(object sender, Telerik.Sitefinity.Data.ExecutingEventArgs e)
 {
     if (e.CommandName == "RegisterRoutes")
     {
         SampleUtilities.RegisterModule<TemplateImporterModule>("Template Importer", "This module imports templates from template builder.");
     }
 }
        protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            var values = new Hashtable();
            GridEditableItem item = e.Item as GridEditableItem;

            if ((e.Item is GridEditFormItem) && (e.Item.IsInEditMode))
            {

                GridEditFormItem editform = (GridEditFormItem)e.Item;
                RadComboBox ddAnswerType = (RadComboBox)editform.FindControl("ddAnswerType");
                RadTextBox Name = (RadTextBox)editform.FindControl("Name");
                ddAnswerType.DataSource = BLL.Survey.AnswerTypes.DataSource();
                ddAnswerType.DataTextField = "Name";
                ddAnswerType.DataValueField = "SurveyAnswerTypeID";
                ddAnswerType.DataBind();
                Name.Width = Unit.Pixel(500);
                ddAnswerType.Width = Unit.Pixel(500);

                if (!e.Item.OwnerTableView.IsItemInserted) //Skip on inserts
                {

                    EntityKey = (int)item.GetDataKeyValue("EntityKey");
                    values = BLL.Survey.AnswerGroups.GetAnswerGroup(EntityKey);

                    if (values["AnswerTypeID"] != null)
                    {
                        ddAnswerType.SelectedValue = values["AnswerTypeID"].ToString();
                    }

                }

            }
        }
示例#12
0
 protected void view_NeedDataSource(object sender, Telerik.Web.UI.RadListViewNeedDataSourceEventArgs e)
 {
     var timex = periodx.SelectedDate.HasValue ? periodx.SelectedDate.Value : DateTime.Today;
     var time = period.SelectedDate.HasValue ? period.SelectedDate.Value : DateTime.Today;
     if (timex > time)
     {
         var time_t = timex;
         timex = time;
         time = time_t;
     }
     var start = timex.AddMilliseconds(-1);
     var end = time.AddDays(1);
     var catalogs = tree.GetAllNodes().Where(o => o.Checked).Select(o => o.Value.GlobalId()).ToList();
     var source = catalogs.Join(DataContext.DepotRedoRecord.Where(o => o.Time > start && o.Time < end), o => o, o => o.CatalogId, (a, b) => b).ToList().OrderByDescending(o => o.Time).ToList();
     if (people.SelectedIndex > 0)
         source = source.Where(o => o.Operator == people.SelectedItem.Text).ToList();
     if (!"OrderId".Query().None())
     {
         var oid = "OrderId".Query().GlobalId();
         source = source.Where(o => o.OrderId == oid).ToList();
     }
     if (!toSearch.Text.Trim().None())
     {
         var a_source = DataContext.DepotObjectLoad(Depot.Id, null);
         if (!toSearch.Text.None())
         {
             var glist = a_source.Where(o => o.Name.ToLower().Contains(toSearch.Text.Trim().ToLower()) || o.PinYin.ToLower().Contains(toSearch.Text.Trim().ToLower()) || o.Code.ToLower() == toSearch.Text.Trim().ToLower()).Select(o => o.Id).ToList();
             source = glist.Join(source, o => o, o => o.ObjectId, (a, b) => b).ToList();
         }
     }
     view.DataSource = source.OrderByDescending(o => o.Time).ToList();
     //___total.Value = source.Sum(o => o.Amount).ToAmount(Depot.Featured(DepotType.小数数量库)) + "@@@" + source.Sum(o => o.Money).ToMoney();
     pager.Visible = source.Count > pager.PageSize;
 }
示例#13
0
 private void gvPerfiles_SelectionChanged(object sender, Telerik.Windows.Controls.SelectionChangeEventArgs e)
 {
     if (gvPerfiles.SelectedItem != null)
     {
         lblEstado.Visibility = Visibility.Visible;
         cmbEstado.Visibility = Visibility.Visible;
         T_C_Perfil temp = gvPerfiles.SelectedItem as T_C_Perfil;
         txtNombre.Text = temp.Nombre;
         txtDescripción.Text = temp.Descripcion;
         btnActualizar.IsEnabled = true;
         btnEliminar.IsEnabled = true;
         btnLimpiar.IsEnabled = true;
         btnRegistrar.IsEnabled = false;
         for (int i = 0; i <= cmbEstado.Items.Count - 1; i++)
         {
             if ((cmbEstado.Items[i] as T_C_Estado) == temp.Estado)
             {
                 cmbEstado.SelectedIndex = 1;
                 break;
             }
         }
     }
     else
     {
         lblEstado.Visibility = Visibility.Hidden;
         cmbEstado.Visibility = Visibility.Hidden;
         btnActualizar.IsEnabled = false;
         btnEliminar.IsEnabled = false;
         btnLimpiar.IsEnabled = false;
         btnRegistrar.IsEnabled = true;
     }
 }
		void OnCopied(object sender, Telerik.Windows.RadRoutedEventArgs e)
		{
			var productIDColumn = this.grid.Columns["ProductID"];
			this.dataContext = grid.DataContext as MyViewModel;
			if (this.dataContext != null && !this.dataContext.ShouldCopySelectColumn && this.grid.ClipboardCopyMode.HasFlag(GridViewClipboardCopyMode.Header))
			{
				string originalText = Telerik.Windows.Controls.Clipboard.GetText();
				string updatedText = string.Empty;
				if (this.grid.SelectionMode == System.Windows.Controls.SelectionMode.Single)
				{
					updatedText = originalText.Remove(0, 1);
				}
				else
				{
					var originalColumnHeader = originalText.Split('\t').FirstOrDefault(t => t.Contains("CheckBox"));
					updatedText = originalText.Remove(0, originalColumnHeader.Length + 1);
				}
				Telerik.Windows.Controls.Clipboard.SetText(updatedText);
			}
			if (productIDColumn.IsVisible && this.grid.ClipboardCopyMode.HasFlag(GridViewClipboardCopyMode.Header))
			{
				var headerText = (productIDColumn.Header as TextBlock).Text;

				string originalText = Telerik.Windows.Controls.Clipboard.GetText();
				var originalColumnHeader = originalText.Split('\t').FirstOrDefault(t => t.Contains("TextBlock"));
				var updatedText = originalText.Replace(originalColumnHeader, headerText);
				Telerik.Windows.Controls.Clipboard.SetText(updatedText);
			}
		}
示例#15
0
        protected void RadGridUserList_InsertCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
        {
            var editableitem = ((GridEditableItem)e.Item);
            UserControl userControl = (UserControl)e.Item.FindControl(GridEditFormItem.EditFormUserControlID);

            ///
            var useStore = new UserStore<AppUser>(new ApplicationDbContext());
            var manager = new UserManager<AppUser>(useStore);

            string LogInUserName=(editableitem.FindControl("RtxtLoginID") as RadTextBox).Text.Trim();

            var user = new AppUser { UserName = LogInUserName, FName = (editableitem.FindControl("RtxtFirstName") as RadTextBox).Text, LName = (editableitem.FindControl("RtxtLastName") as RadTextBox).Text };
            IdentityResult result = manager.Create(user, (editableitem.FindControl("RtxtPassword") as RadTextBox).Text);

            if (result.Succeeded)
            {
                //Get The Current Created UserInfo
                AppUser CreatedUser = manager.FindByName(LogInUserName);

                var RoleAddResult = manager.AddToRole(CreatedUser.Id.Trim(), (editableitem.FindControl("RDDListRole") as RadDropDownList).SelectedItem.Text.Trim());

                lblMessage.Text = string.Format("User {0} is creted successfully", user.UserName);
            }

            else
            {

                lblMessage.Text = result.Errors.FirstOrDefault();
                e.Canceled = true;
            }
        }
示例#16
0
 protected void RadGridEditor_ItemInserted(object source, Telerik.Web.UI.GridInsertedEventArgs e)
 {
     if (e.Exception != null)
     {
         e.ExceptionHandled = true;
         e.KeepInInsertMode = true;
         SqlException ex = e.Exception as SqlException;
         if (ex == null)
             DisplayMessage("لم نتمكن من اضافة الصف وذلك بسبب:  " + Environment.NewLine + e.Exception.Message);
         else
             DisplayMessage("لم نتمكن من اضافة الصف وذلك بسبب:  " + Environment.NewLine + MC.CheckExp(ex));
     }
     else
     {
         DisplayMessage("تم الاضافه");
         SqlConnection con = MC.EStoreConnection;
         SqlCommand cmd = new SqlCommand("", con);
         string AccountId = ViewState["AccountId"].ToString();
         try
         {
             con.Open();
             cmd.CommandText = string.Format(@"INSERT INTO TblAccounts (AccountId, AccountName, BasicAccountId, AccountTreeId, UserIn, TimeIn)
             VALUES ({0}, N'{1}', {2}, N'{3}', {4}, GETDATE())", AccountId, ViewState["Customer"], MC.GetOptionValue(MC.AppOptions.customer), TreeID(), TheSessions.UserID);
             cmd.ExecuteNonQuery();
         }
         catch (SqlException ex)
         {
             DisplayMessage("لم نتمكن من اضافة الصف التابع وذلك بسبب:  " + Environment.NewLine + MC.CheckExp(ex));
         }
         con.Close();
     }
 }
示例#17
0
 protected void grid_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
 {
     if (file.Value.None())
     {
         grid.DataSource = null;
         grid.Visible = false;
         return;
     }
     grid.Visible = true;
     var book = new Workbook(file.Value);
     var data = book.Worksheets[0].Cells.ExportDataTableAsString(0, 0, book.Worksheets[0].Cells.Rows.Where(o => o[0].Value != null && o[0].Value.ToString().Trim() != "").Count(), 16, true);
     var handled = new DataTable();
     foreach (var index in new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 })
     {
         handled.Columns.Add(data.Columns[index].ColumnName);
     }
     foreach (DataRow row in data.Rows)
     {
         var _row = handled.NewRow();
         foreach (DataColumn col in handled.Columns)
         {
             _row[col.ColumnName] = row[col.ColumnName];
         }
         handled.Rows.Add(_row);
     }
     grid.DataSource = handled;
 }
        private void MyRadDataForm_AutoGeneratingField(object sender, Telerik.Windows.Controls.Data.DataForm.AutoGeneratingFieldEventArgs e)
        {
            if (!displayedProperties.Contains(e.PropertyName))
            {
                e.Cancel = true;
            }
            if (e.PropertyName == "ReportsTo")
            {
                DataFormComboBoxField dataField = new DataFormComboBoxField();

                dataField.Label = "ReportsTo";
                dataField.ItemsSource = new List<EmployeeID>() 
                { 
                    new EmployeeID("Nancy Davolio", 1),
                    new EmployeeID("Andrew Fuller", 2),
                    new EmployeeID("Janet Leverling", 3),
                    new EmployeeID("Margaret Peacock", 4),
                    new EmployeeID("Steven Buchanan", 5),
                    new EmployeeID("Michael Suyama", 6),
                    new EmployeeID("Robert King", 7),
                    new EmployeeID("Laura Callahan", 8),
                    new EmployeeID("Anne Dodsworth", 9)
                };

                dataField.DisplayMemberPath = "Name";
                dataField.SelectedValuePath = "ID";
                dataField.DataMemberBinding = new Binding("ReportsTo");
                e.DataField = dataField;
            }
        }
示例#19
0
 // Gets the containers of the pasted objects and adds them in the pastedItems list.
 private void OnItemsChanged(object sender, Telerik.Windows.Controls.Diagrams.DiagramItemsChangedEventArgs e)
 {
     if (e.Action == NotifyCollectionChangedAction.Add && this.isPasting)
     {
         e.NewItems.ToList().ForEach(x => this.pastedItems.Add(this.ContainerGenerator.ContainerFromItem(x)));
     }
 }
示例#20
0
 protected void view_record_NeedDataSource(object sender, Telerik.Web.UI.RadListViewNeedDataSourceEventArgs e)
 {
     var id = "UseId".Query().GlobalId();
     var use = DataContext.DepotUse.Single(o => o.Id == id);
     var list = new List<UseRecord>();
     var isVirtual = Depot.Featured(DepotType.固定资产库);
     var amount = 0M;
     var money = 0M;
     foreach (var us in DataContext.DepotUseX.Where(o => o.UseId == use.Id).ToList())
     {
         amount += us.Amount;
         money += us.Money;
         if (list.Count(o => o.ObjectId == us.ObjectId && o.Type == us.Type && o.InId == us.InXId) == 0)
         {
             var objId = us.ObjectId;
             var obj = DataContext.DepotObject.Single(o => o.Id == objId);
             var catalog = DataContext.DepotObjectCatalog.Single(o => o.ObjectId == objId && o.IsLeaf == true && o.IsVirtual == isVirtual);
             list.Add(new UseRecord { ObjectId = us.ObjectId, Name = obj.Name, Brand = obj.Brand, Catalog = DataContext.ToCatalog(catalog.CatalogId, catalog.Level).Single(), Type = us.Type, Unit = obj.Unit, Specification = obj.Specification, Amount = us.Amount, Money = us.Money, Note = us.Note, InId = us.InXId, PerPrice = us.Amount == 0 ? us.DepotInX.PriceSet : decimal.Divide(us.Money, us.Amount) });
         }
         else
         {
             var x = list.First(o => o.ObjectId == us.ObjectId && o.Type == us.Type && o.InId == us.InXId);
             x.Amount += us.Amount;
             x.Money += us.Money;
         }
     }
     total.Value = amount.ToAmount(Depot.Featured(DepotType.小数数量库)) + "@@@" + money.ToMoney();
     view_record.DataSource = list.OrderBy(o => o.Name).ThenBy(o => o.Type);
 }
    protected void RadComboBoxFirma_ItemsRequested(object o, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
    {
        if (e.Text.Length > 3)
        {
            using (Service1Client client = new Service1Client())
            {
                intBolgeKodu = client.BolgeKoduDon(Context.User.Identity.Name);
            }
            string BolgeKodu = intBolgeKodu.ToString();
            string sqlSelectCommand = "";
            sqlSelectCommand = "SELECT [FIRMAID],[MUSTNO], [FIRMAADI], [IL_ILCE] from [firma] WHERE [FIRMAADI] LIKE '%'+ @text + '%' and SILINDI=0 and BOLGEKODU=" + BolgeKodu + " ORDER BY [FIRMAADI]";
            SqlDataAdapter adapter = new SqlDataAdapter(sqlSelectCommand, ConfigurationManager.ConnectionStrings["KalData"].ConnectionString);
            adapter.SelectCommand.Parameters.AddWithValue("@text", e.Text);
            DataTable dataTable = new DataTable();
            adapter.Fill(dataTable);

            RadComboBoxFirma.Items.Clear();
            foreach (DataRow dataRow in dataTable.Rows)
            {
                string IlIlce = "";
                RadComboBoxItem item = new RadComboBoxItem();
                item.Text = (string)dataRow["MUSTNO"].ToString();
                item.Value = dataRow["FIRMAID"].ToString();
                string FirmaAdi = (string)dataRow["FIRMAADI"];
                if (dataRow["IL_ILCE"] != System.DBNull.Value)
                    {
                        IlIlce = (string)dataRow["IL_ILCE"];
                    }
                item.Attributes.Add("FIRMAADI", FirmaAdi);
                item.Attributes.Add("IL_ILCE", IlIlce);
                RadComboBoxFirma.Items.Add(item);
                item.DataBind();
            }
        }
    }
    protected void RadCalendar1_DayRender(object sender, Telerik.Web.UI.Calendar.DayRenderEventArgs e)
    {
        BLL.FoodIntakeLib oFoodIntakeLib = new BLL.FoodIntakeLib();

        List<Entity.FoodIntakeInfo> oListFoodIntakeInfo = new List<Entity.FoodIntakeInfo>();
        oListFoodIntakeInfo = oFoodIntakeLib.GetFoodIntakeDetailsByUserId(AppLib.GetLoggedInUserName());
        foreach (var item in oListFoodIntakeInfo)
        {
            if (e.Day.Date == item.DtFoodIntakeDate)
            {
                e.Cell.HorizontalAlign = HorizontalAlign.Left;
                string _strFoodDetails = @"<table style='width:100%;' align='left' border='1'>
        <tr class='trAlt'><td style='text-align:left;'>Date:&nbsp;" + item.DtFoodIntakeDate.ToString("MM/dd/yyyy") + @"
        </td><td style='text-align:left;'>Calorie:&nbsp;" + item.IntCalorie.ToString() + @"</td></tr>
        <tr class='trAlt'><td  style='text-align:left;'>Milk:" + GetSplitedDetailsofActivity(item.StrMilkDetails.ToString()) +
        @"</td><td style='text-align:left;'>Fruit:" + GetSplitedDetailsofActivity(item.StrFruitDetails.ToString()) + @"</td></tr>
        <tr class='trAlt'><td style='text-align:left;'>Vegetables:" + GetSplitedDetailsofActivity(item.StrVegetablesDetails.ToString()) + @"</td>
        <td style='text-align:left;'>Starch:" + GetSplitedDetailsofActivity(item.StrStarchDetails.ToString()) + @"</td></tr>
        <tr class='trAlt'><td style='text-align:left;'>Protein:" + GetSplitedDetailsofActivity(item.StrProteinDetails.ToString()) + @"</td>
        <td style='text-align:left;'>FAT:" + GetSplitedDetailsofActivity(item.StrFATDetails.ToString()) + @"</td></tr>
        <tr class='trAlt'><td colspan='2' style='text-align:left;'>Water:" + GetSplitedDetailsofActivity(item.StrWaterDetails.ToString()) + @"</td></tr>
        </table>";

                e.Cell.Text = _strFoodDetails;
            }

        }

        oListFoodIntakeInfo = null;
        oFoodIntakeLib = null;
    }
示例#23
0
 protected void grid_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
 {
     var id = Guid.Parse(Request.QueryString["CampusId"]);
     var source = HomoryContext.Value.ViewDingDing.Where(o => o.TopDepartmentId == id).OrderBy(o => o.Account).ThenBy(o => o.DingKey).ToList();
     grid.DataSource = source;
     var list = new List<DingUser>();
     list.AddRange(source.Select(o => o.Account).Distinct().Select(o => new DingUser { userid = o }));
     foreach (var x in list)
     {
         var first = source.First(o => o.Account == x.userid);
         x.name = first.RealName;
         x.mobile = first.Phone;
         x.position = first.PerStaff;
         x.department = source.Where(o => o.Account == x.userid).Select(o => int.Parse(o.DingKey)).ToArray();
         x.orderInDepts = "{";
         foreach (var key in x.department)
         {
             x.orderInDepts += key.ToString() + ":" + source.First(o => o.Account == x.userid && o.DingKey == key.ToString()).Ordinal + ",";
         }
         if (x.orderInDepts.Length > 1)
             x.orderInDepts = x.orderInDepts.Substring(0, x.orderInDepts.Length - 1);
         x.orderInDepts += "}";
     }
     user_list.InnerText = Newtonsoft.Json.JsonConvert.SerializeObject(list);
 }
示例#24
0
        void myReader_PreviewReadCompleted(object sender, Telerik.Windows.Controls.Map.PreviewReadShapesCompletedEventArgs eventArgs)
        {
            // InformationLayer layer = (sender as MapShapeReader).Layer;

            // extract the seat colorization information from the data attributes
            //foreach (MapShape shape in layer.Items)
            //{
            //   // byte red = byte.Parse(shape.ExtendedData.GetValue("RGB0").ToString(), CultureInfo.InvariantCulture);
            //   // byte green = byte.Parse(shape.ExtendedData.GetValue("RGB1").ToString(), CultureInfo.InvariantCulture);
            //   // byte blue = byte.Parse(shape.ExtendedData.GetValue("RGB2").ToString(), CultureInfo.InvariantCulture);

            //   // shape.Fill = new SolidColorBrush(Color.FromArgb(255, red, green, blue));
            //    shape.MouseLeftButtonDown += new MouseButtonEventHandler(shape_MouseLeftButtonDown);
            //}

            foreach (var poly in eventArgs.Items)
            {
                if (poly is MapShape)
                {
                    double myHectares = Convert.ToDouble((poly as MapShape).ExtendedData.GetValue("Hectares"));
                    String myName = Convert.ToString((poly as MapShape).ExtendedData.GetValue("WRIA_NM"));
                    (poly as MapShape).MouseLeftButtonDown += new MouseButtonEventHandler(shape_MouseLeftButtonDown);
                    (poly as MapShape).MouseEnter += new MouseEventHandler(MainPage_MouseEnter);
                    ShapeData temp = new ShapeData() { Hectares = myHectares, WriaName = myName };
                    shapeData.Add(temp);

                }
            }
        }
示例#25
0
 protected void cmbMerchants_SelectedIndexChanged(object o, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)
 {
     if (cmbMerchants.SelectedValue != "0")
     {
         Response.Redirect("2009Special.aspx?name=" + cmbMerchants.SelectedItem.Value + "&level=1");
     }
 }
示例#26
0
 protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
 {
     var mKas = from mK in rscm.KAs
                join P in rscm.PeriodeAnggarans on mK.PERIODE_ID equals P.id
                select new { mK.id, mK.KA_CODE, mK.KA_NAME, mK.SALDO_AWAL, mK.PERIODE_ID, P.Start_Period, P.End_Period, P.Is_Closed };
     RadGrid1.DataSource = mKas;
 }
 void RadAjaxManager1_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e)
 {
     // 由于无法获得 CurrentPageIndex,此次就是不断的增加PageSize 来达到获取获取数据的效果
     // 当到达最后时,将会获得所有的数据 PageSize>=MaxSize
     RadGrid_Second.PageSize += 20;
     RadGrid_Second.Rebind();
 }
示例#28
0
 protected void RadGrid1_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
 {
     // load grid data
     RadGrid1.DataSource = (from l in ctx.Logs
                            orderby l.Stamp descending
                            select l).ToList<Log>();
 }
示例#29
0
 protected void auFile_FileUploaded(object sender, Telerik.Web.UI.FileUploadedEventArgs e)
 {
     string targetFolder = Server.MapPath(Utils.GaleryImagePath);
     foreach (UploadedFile af in auFile.UploadedFiles)
     {
         DeletePhoto();
         hdPhotoNameDeleted.Value = "";
         string newGUID = Guid.NewGuid().ToString();
         string extension = af.GetExtension();
         string newFileName = newGUID + extension;
         ViewState["VIKKI_UPLOAD_PHOTO_NAME" + this.ClientID] = newFileName;
         string path = Path.Combine(targetFolder, newFileName);
         af.SaveAs(path, true);
         if (CreateThumbnail)
         {
             try
             {
                 System.IO.FileStream fs = System.IO.File.OpenRead(Path.Combine(targetFolder, newFileName));
                 byte[] b = new byte[fs.Length];
                 fs.Read(b, 0, b.Length);
                 newFileName = newGUID + "_s" + extension;
                 Utils.ResizeAndSaveJpgImage(b, 181, 244, Path.Combine(targetFolder, newFileName), true);
                 fs.Dispose();
             }
             catch
             {
             }
         }
     }
 }
示例#30
0
 private void chkCredit_ToggleStateChanged(object sender, Telerik.WinControls.UI.StateChangedEventArgs args)
 {
     if (chkCredit.Checked)
     {
         chkDebit.Checked = false;
     }
 }