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


C# TaskResult.ToString方法代码示例

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


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

示例1: UpdateBeachCampEvent

        private string UpdateBeachCampEvent(TaskResult status)
        {
            string output = string.Empty;
            try
            {
                if (string.IsNullOrEmpty(lblError.Text) && lblError.Visible)
                    return lblError.Text;

                string sectionPeriod = string.Empty;
                double totalPrice = 0;

                if (string.IsNullOrEmpty(txtEventDate.Text))
                    return Constants.ERROR_MESSAGE;

                string[] eventDateArray = txtEventDate.Text.Split('/');

                DateTime beachCampDate = new DateTime(int.Parse(eventDateArray[2]), int.Parse(eventDateArray[1]), int.Parse(eventDateArray[0])); //DateTime.Parse(ffEventDate.Value.ToString());

                SPFieldUserValue userValue = new SPFieldUserValue(SPContext.Current.Web, SPContext.Current.ListItem[SPBuiltInFieldId.Author].ToString());

                bool isReserved = BeachCampHelper.IsUserReserved(SPContext.Current.Web, userValue.User.ID.ToString(), beachCampDate, SPContext.Current.ItemId);
                if (isReserved)
                    return Constants.ERROR_MESSAGE1;//return "You can only reserve beach camp one a month. Please select another day!";

                foreach (RepeaterItem prices in repeaterPrices.Items)
                {
                    CheckBox chkPeriod1 = (CheckBox)prices.FindControl("chkPeriod1");
                    if (chkPeriod1 != null && chkPeriod1.Checked)
                    {
                        sectionPeriod += chkPeriod1.ToolTip + "|";
                        totalPrice += double.Parse(chkPeriod1.Text.Split(' ')[0]);
                    }

                    CheckBox chkPediod2 = (CheckBox)prices.FindControl("chkPeriod2");
                    if (chkPediod2 != null && chkPediod2.Checked)
                    {
                        sectionPeriod += chkPediod2.ToolTip + "|";
                        totalPrice += double.Parse(chkPediod2.Text.Split(' ')[0]);
                    }

                    CheckBox chkFullDay = (CheckBox)prices.FindControl("chkFullDay");
                    if (chkFullDay != null && chkFullDay.Checked)
                    {
                        sectionPeriod += chkFullDay.ToolTip + "|";
                        totalPrice += double.Parse(chkFullDay.Text.Split(' ')[0]);
                    }

                    CheckBox chkRamadan = (CheckBox)prices.FindControl("chkRamadan");
                    if (chkRamadan != null && chkRamadan.Checked)
                    {
                        sectionPeriod += chkRamadan.ToolTip + "|";
                        totalPrice += double.Parse(chkRamadan.Text.Split(' ')[0]);
                    }
                }

                if (string.IsNullOrEmpty(sectionPeriod))
                    return Constants.ERROR_MESSAGE3;//return "Please choose a Section and Period !";

                sectionPeriod = sectionPeriod.TrimEnd('|');

                string sectionPeriodReserved = CheckReverseSection(sectionPeriod);
                if (!string.IsNullOrEmpty(sectionPeriodReserved))
                    return sectionPeriodReserved;//"This section and period is reserved. Please choose another section - period !";

                string typeOfBeachCamp = rdbPersonal.Text;
                if (rdbBusiness.Checked)
                    typeOfBeachCamp = rdbBusiness.Text;

                //totalPrice = totalPrice * int.Parse(ffRequireDay.Value.ToString());

                SPListItem item = SPContext.Current.ListItem;
                item[SPBuiltInFieldId.Title] = ffTitle.Value;
                item["TypeOfBeachCamp"] = typeOfBeachCamp;
                item["EmployeeCode"] = ffEmployeeCode.Value;
                item["Department"] = ffDepartment.Value;
                item["Section"] = ffSection.Value;
                item["OfficeTel"] = ffOfficeTel.Value;
                item["Mobile"] = ffMobile.Value;
                item[SPBuiltInFieldId.StartDate] = beachCampDate;
                item[SPBuiltInFieldId.EndDate] = beachCampDate;//beachCampDate.AddDays(int.Parse(ffRequireDay.Value.ToString()));
                item["Reason"] = ffReason.Value;
                //item["RequireDay"] = ffRequireDay.Value;
                item["TotalPrice"] = totalPrice;
                item[SPBuiltInFieldId.Location] = sectionPeriod;

                item["GSApproval"] = status.ToString();

                item.Update();
            }
            catch (Exception ex)
            {
                Utility.LogError(ex.Message, BeachCampFeatures.BeachCamp);
                output = ex.Message;
            }
            return output;
        }
开发者ID:dangquocthai,项目名称:beachcamp,代码行数:96,代码来源:BeachCampEditEvent.ascx.cs


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