private void FatchTest() { try { EWA_UploadResult objEWA = new EWA_UploadResult(); BL_UploadResult objBL = new BL_UploadResult(); objEWA.OrgId = Session["OrgId"].ToString(); objEWA.CourseId = CourseId.ToString(); objEWA.BranchId = BranchId.ToString(); objEWA.ClassId = ClassId.ToString(); objEWA.SemesterId = ddlSemester.SelectedValue.ToString(); DataSet ds = objBL.FatchTest_BL(objEWA); ddlTest.DataSource = ds; if (ds.Tables[0].Rows.Count != 0) { ddlTest.DataTextField = "TestName"; ddlTest.DataValueField = "TestId"; ddlTest.DataBind(); } else { ddlTest.Items.Clear(); } ddlTest.Items.Insert(0, new System.Web.UI.WebControls.ListItem("Select", "0")); } catch (Exception exp) { GeneralErr(exp.Message.ToString()); } }
/// <summary> /// Configures the specified type. /// </summary> /// <param name="type">The type.</param> /// <param name="config">The config.</param> /// <exception cref="Glass.Mapper.Configuration.ConfigurationException">Type configuration is not of type {0}.Formatted(typeof (SitecoreTypeConfiguration).FullName)</exception> public override void Configure(Type type, Mapper.Configuration.AbstractTypeConfiguration config) { var scConfig = config as SitecoreTypeConfiguration; if (scConfig == null) { throw new ConfigurationException( "Type configuration is not of type {0}".Formatted(typeof(SitecoreTypeConfiguration).FullName)); } if (BranchId.IsNotNullOrEmpty()) { scConfig.BranchId = new ID(this.BranchId); } else { scConfig.BranchId = ID.Null; } if (TemplateId.IsNotNullOrEmpty()) { scConfig.TemplateId = new ID(this.TemplateId); } else { scConfig.TemplateId = ID.Null; } scConfig.CodeFirst = this.CodeFirst; scConfig.TemplateName = this.TemplateName; base.Configure(type, config); }
private static ConditionalWeakTable <DocumentId, SyntaxTreeIndex> GetInfoTable( BranchId branchId, Workspace workspace, ConditionalWeakTable <BranchId, ConditionalWeakTable <DocumentId, SyntaxTreeIndex> > cache) { return(cache.GetValue(branchId, id => { if (id == workspace.PrimaryBranchId) { workspace.DocumentClosed += (sender, e) => { if (!e.Document.IsFromPrimaryBranch()) { return; } if (cache.TryGetValue(e.Document.Project.Solution.BranchId, out var infoTable)) { // remove closed document from primary branch from live cache. infoTable.Remove(e.Document.Id); } }; } return new ConditionalWeakTable <DocumentId, SyntaxTreeIndex>(); })); }
/// <summary> /// Configures the specified type. /// </summary> /// <param name="type">The type.</param> /// <param name="config">The config.</param> /// <exception cref="Glass.Mapper.Configuration.ConfigurationException">Type configuration is not of type {0}.Formatted(typeof (SitecoreTypeConfiguration).FullName)</exception> public override AbstractTypeConfiguration Configure(Type type) { var scConfig = new SitecoreTypeConfiguration(); if (scConfig == null) { throw new ConfigurationException( "Type configuration is not of type {0}".Formatted(typeof(SitecoreTypeConfiguration).FullName)); } try { if (BranchId.HasValue()) { scConfig.BranchId = new ID(this.BranchId); } else { scConfig.BranchId = ID.Null; } } catch (Exception ex) { throw new MapperException("Failed to convert BranchId for type {0}. Value was {1}".Formatted(type.FullName, this.TemplateId), ex); } try { if (TemplateId.HasValue()) { scConfig.TemplateId = new ID(this.TemplateId); } else { scConfig.TemplateId = ID.Null; } } catch (Exception ex) { throw new MapperException("Failed to convert TemplateId for type {0}. Value was {1}".Formatted(type.FullName, this.TemplateId), ex); } if (TemplateId.IsNullOrEmpty() && this.EnforceTemplate.IsEnabled()) { throw new ConfigurationException( "The type {0} has EnforceTemplate set to true but no TemplateId".Formatted(type.FullName)); } scConfig.EnforceTemplate = this.EnforceTemplate; scConfig.TemplateName = this.TemplateName; scConfig.Cache = this.Cache; base.Configure(type, scConfig); return(scConfig); }
protected void btnClear_Click(object sender, EventArgs e) { CategoryId.ClearSelection(); AgeGroupId.ClearSelection(); BranchId.ClearSelection(); LocationID.ClearSelection(); odsBadges.DataBind(); rptr.DataBind(); }
public override int GetHashCode() { unchecked { int result = BranchId.GetHashCode(); result = (result * 397) ^ AgeId.GetHashCode(); result = (result * 397) ^ SexId.GetHashCode(); result = (result * 397) ^ JobId.GetHashCode(); return(result); } }
protected void Page_Load(object sender, EventArgs e) { if (!string.IsNullOrEmpty(Request.QueryString["FromDate"])) { FromDate.Value = startDate = Request.QueryString["FromDate"]; } if (!string.IsNullOrEmpty(Request.QueryString["ToDate"])) { ToDate.Value = endDate = Request.QueryString["ToDate"]; } divResult.InnerHtml = ""; divResult.Visible = false; var branches = IBranchService.GetUtilizedBranches(); BranchId.DataSource = branches; BranchId.DataTextField = "Code"; BranchId.DataValueField = "Id"; BranchId.DataBind(); BranchId.Items.Insert(0, new ListItem() { Text = "All", Value = "0" }); if (!string.IsNullOrEmpty(Request.QueryString["BranchId"])) { BranchId.SelectedValue = Request.QueryString["BranchId"]; } if (!string.IsNullOrEmpty(Request.QueryString["IsClear"]) && Request.QueryString["IsClear"] == "1") { FromDate.Value = ToDate.Value = startDate = endDate = string.Empty; BranchId.SelectedValue = "0"; } if (datechecking()) { Querys(); List <StatisticModel> last5DaysCount = IBatchService.GetDaysCountbyDepartment(barChatQuery, 0, 0, true); if (last5DaysCount.Count == 0) { divResult.InnerHtml = @"<div class='alert alert-block alert-danger fade in'><button data-dismiss='alert' class='close close-sm' type='button'> <i class='fa fa-times'></i> </button> <strong>Oh snap!</strong> No records found for the search criteria entered.</div>"; divResult.Visible = true; } else { dataBind(last5DaysCount); } } }
protected void btnClear_Click(object sender, EventArgs e) { CategoryId.ClearSelection(); AgeGroupId.ClearSelection(); BranchId.ClearSelection(); LocationID.ClearSelection(); odsBadges.DataBind(); rptr.DataBind(); var wt = new WebTools(); CategoryId.CssClass = wt.CssRemoveClass(CategoryId.CssClass, "gra-search-active"); AgeGroupId.CssClass = wt.CssRemoveClass(AgeGroupId.CssClass, "gra-search-active"); BranchId.CssClass = wt.CssRemoveClass(BranchId.CssClass, "gra-search-active"); LocationID.CssClass = wt.CssRemoveClass(LocationID.CssClass, "gra-search-active"); }
protected void UpdateBranchList() { BranchDataSource.Select(); BranchId.Items.Clear(); BranchId.DataBind(); if (BranchId.Items.Count == 2) { BranchId.SelectedIndex = 1; } var criteria = Session[SessionKey.EventFilter] as EventSearchCriteria; if (criteria != null) { DoFilter(criteria); } }
/// <summary> /// Configures the specified type. /// </summary> /// <param name="type">The type.</param> /// <param name="config">The config.</param> /// <exception cref="Glass.Mapper.Configuration.ConfigurationException">Type configuration is not of type {0}.Formatted(typeof (SitecoreTypeConfiguration).FullName)</exception> public override AbstractTypeConfiguration Configure(Type type) { var scConfig = new SitecoreTypeConfiguration(); if (scConfig == null) { throw new ConfigurationException( "Type configuration is not of type {0}".Formatted(typeof(SitecoreTypeConfiguration).FullName)); } if (BranchId.IsNotNullOrEmpty()) { scConfig.BranchId = new ID(this.BranchId); } else { scConfig.BranchId = ID.Null; } if (TemplateId.IsNotNullOrEmpty()) { scConfig.TemplateId = new ID(this.TemplateId); } else { scConfig.TemplateId = ID.Null; } if (TemplateId.IsNullOrEmpty() && this.EnforceTemplate != SitecoreEnforceTemplate.No) { throw new ConfigurationException( "The type {0} has EnforceTemplate set to true but no TemplateId".Formatted(type.FullName)); } scConfig.EnforceTemplate = this.EnforceTemplate; scConfig.CodeFirst = this.CodeFirst; scConfig.TemplateName = this.TemplateName; base.Configure(type, scConfig); return(scConfig); }
public async Task <RepositoryBranch> CreateAsync(CreateBranchRequest request, ISecurityContext context) { Ensure.NotNull(request, nameof(request)); var branchId = await BranchId.NextAsync(db.Context, request.RepositoryId); var branch = new RepositoryBranch( id: branchId, repositoryId: request.RepositoryId, name: request.Name, creatorId: context.UserId.Value ); await db.RepositoryBranches.InsertAsync(branch); return(branch); }
private static void CreateItem(string name, string description, string place, string startDate, string endDate, string eventtypes) { Item parentItem = GetParent(); var templateId = new BranchId(new ID("{3E8DADF5-9414-4888-8AAF-DFC42ACEDCD2}")); string itemName = ProposeValidItemName(name); var item = parentItem?.Children?.FirstOrDefault(c => c.Name.Equals(itemName, StringComparison.InvariantCultureIgnoreCase)); if (item == null) { item = parentItem.Add(itemName, templateId); } UpdateData(item, name, description, place, startDate, endDate, eventtypes); }
private static void CreateItem(string name, string description, string location) { string parentItemQuery = Context.Site.RootPath + "/*[@@templatename='Home']/*[@@templatename='Groups']"; Item parentItem = Context.Database.SelectSingleItem(parentItemQuery); // var parentItem = Sitecore.Context.Database.GetItem(Templates.Users.ID); var templateId = new BranchId(new ID("{4CBA4FE4-E13E-4777-8A46-3310F77FD331}")); string itemName = ProposeValidItemName(name); var item = parentItem?.Children?.FirstOrDefault(c => c.Name.Equals(itemName, StringComparison.InvariantCultureIgnoreCase)); if (item == null) { item = parentItem.Add(itemName, templateId); } UpdateData(item, name, description, location); }
public virtual void WriteYaml(YamlWriter writer) { writer.WriteMap("ID", Id.ToString("D")); writer.WriteMap("Parent", ParentId.ToString("D")); writer.WriteMap("Template", TemplateId.ToString("D")); writer.WriteMap("Path", Path); writer.WriteMap("DB", DatabaseName); if (BranchId != default(Guid)) { writer.WriteMap("BranchID", BranchId.ToString()); } if (SharedFields.Any()) { writer.WriteMap("SharedFields"); writer.IncreaseIndent(); foreach (var field in SharedFields) { field.WriteYaml(writer); } writer.DecreaseIndent(); } if (Languages.Any()) { writer.WriteMap("Languages"); writer.IncreaseIndent(); foreach (var language in Languages) { language.WriteYaml(writer); } writer.DecreaseIndent(); } }
public Dictionary <string, string> GetByName() { var result = new Dictionary <string, string> { { "Id", Id }, { "UserId", UserId.ToString() }, { "UserName", UserName }, { "Name", Name }, { "Phone", Phone }, { "Email", Email }, { "Expired", Expired.ToString() }, { "ActiveBranchId", ActiveBranchId.ToString() }, { "ParentBranchId", ParentBranchId.ToString() }, { "ActiveRoleName", ActiveRoleName }, { "RoleNames", RoleNames }, { "ActiveRoleId", ActiveRoleId.ToString() }, { "RoleIds", RoleIds }, { "PermittedBranchs", PermittedBranchs }, { "UniqueName", UniqueName }, { "BranchId", BranchId.ToString() }, }; return(result); }
public override int GetHashCode() { return(BranchId.GetHashCode()); }
private Dictionary <ProjectId, CompilationSet> GetVersionMapFromBranch(Workspace workspace, BranchId branchId) { var branchMap = GetBranchMap(workspace); return(branchMap.GetValue(branchId, createVersionMap)); }
private Dictionary <ProjectId, CompilationSet> GetVersionMapFromBranchOrPrimary(Workspace workspace, BranchId branchId) { var branchMap = GetBranchMap(workspace); // check whether we already have one Dictionary <ProjectId, CompilationSet> versionMap; if (branchMap.TryGetValue(branchId, out versionMap)) { return(versionMap); } // check primary branch if (branchMap.TryGetValue(workspace.PrimaryBranchId, out versionMap)) { return(versionMap); } // okay, create one return(branchMap.GetValue(branchId, createVersionMap)); }
private Item CreateItem([NotNull] Item parent, Guid templateID, [NotNull] string itemName) { Item output; var template = this.MasterDatabase.GetTemplate(new ID(templateID)); if (template != null) { output = parent.Add(itemName, template); } else { var branchID = new BranchId(new ID(templateID)); output = parent.Add(itemName, branchID); } return output; }
private Dictionary<ProjectId, CompilationSet> GetVersionMapFromBranch(Workspace workspace, BranchId branchId) { var branchMap = GetBranchMap(workspace); return branchMap.GetValue(branchId, createVersionMap); }
private Dictionary<ProjectId, CompilationSet> GetVersionMapFromBranchOrPrimary(Workspace workspace, BranchId branchId) { var branchMap = GetBranchMap(workspace); // check whether we already have one Dictionary<ProjectId, CompilationSet> versionMap; if (branchMap.TryGetValue(branchId, out versionMap)) { return versionMap; } // check primary branch if (branchMap.TryGetValue(workspace.PrimaryBranchId, out versionMap)) { return versionMap; } // okay, create one return branchMap.GetValue(branchId, createVersionMap); }
string GetCmdText(int Step) //fold00 { AccCode = AccCode.Trim(); ClientCode = ClientCode.Trim(); CurrencyTag = CurrencyTag.Trim().ToUpper(); string Result = " exec dbo.Mega_Extract"; switch (Step) { case 1: { Result += ";1 " + " @DateFrom=" + DateFrom.ToString() + " , @DateInto=" + DateInto.ToString() + " , @OverMode=" + (OverMode & 3).ToString() + " , @OverDate=" + DateInto.ToString() + " , @FlgTag=" + ((CurrencyTag == "") ? "0" : "1") + " , @CbMode=" + ((CbMode) ? "2" : "1") + " , @UserId=" + UserId.ToString() + " , @ClientCode='" + ClientCode + "'" + " , @BranchId=" + BranchId.ToString() + " , @GroupId=" + GroupId.ToString() + " , @AmountCode='" + __.GetCodeByMoniker(AccCode) + "%'" + " , @CurrencyTag='" + ((CurrencyTag == "UAH") ? "" : CurrencyTag) + "'" + " , @AllAmounts=" + ((AllAmounts) ? "1" : "0") + " , @AmountMode= 0 , @IsExpected=0 " ; break; } case 2: { Result += ";4 " + " @DateFrom=" + DateFrom.ToString() + " , @DateInto=" + DateInto.ToString() + " , @OverMode=" + (OverMode & 3).ToString() + " , @OverDate=" + DateInto.ToString() + " , @AmountId=" + Accounts_ExtId.ToString() + " , @ShowSubRate=1 , @Mode=1 , @Depth=1 " ; break; } case 3: { int Date = Amounts_LastDate; if (__.Month(Date) < __.Month(DateFrom)) { Date = __.GetDate(__.Year(DateFrom) + "/" + __.Month(DateFrom).ToString("00") + "/01") - 1; } Result += ";5 " + " @DateFrom=" + (Date + 1).ToString() + " , @DateInto=" + Amounts_DateInto.ToString() + " , @AmountId=" + Accounts_RootId.ToString() + " , @SortMode=" + (SortMode & 7).ToString() + " , @IsRight=0 , @IsExpected=0 " ; break; } case 4: { Result += (((DateFrom == DateInto) && (DateFrom == TODAY)) ? ";6 " : ";5 ") + " @DateFrom=" + DateFrom.ToString() + " , @DateInto=" + DateInto.ToString() + " , @AmountId=" + Accounts_ExtId.ToString() + " , @SortMode=" + (SortMode & 7).ToString() + " , @IsRight=0 , @IsExpected=0 " ; break; } } return(Result); } //FOLD00
protected void Page_Load(object sender, EventArgs e) { if (Session["UserId"] != null) { Int32 UserId = Convert.ToInt32(Session["UserId"].ToString()); User user = IUserService.GetSingle(UserId); UserRole userRole = IUserRoleService.GetSingle(user.UserRoleId); if (user.BranchId != 0) { BranchId.Disabled = true; BranchId.Value = user.BranchId.ToString(); } List <Branch> branches = IBranchService.GetDataByPropertyName(nameof(Branch.CompanyId), "1", true, 0, 0, false); List <UserRole> adminRoles = IUserRoleService.GetDataByPropertyName(nameof(UserRole.UserTypeId), "6", true, 0, 0, false); if (userRole.Name == "HQ Admin") { adminRoles = adminRoles.Where(x => x.Id > userRole.Id).ToList(); } else if (userRole.Name == "Regional Admin") { if (user.IsAll == 0) { List <BranchUser> userBranches = IBranchUserService.GetDataByFilter(" user_id = '" + user.Id + "' and status='1'", 0, 0, false); branches = IBranchService.GetDataByFilter(" ID not in (" + String.Join(",", userBranches.Select(x => x.BranchId).ToArray()) + ")", 0, 0, false); } adminRoles = adminRoles.Where(x => x.Id > userRole.Id).ToList(); } else if (userRole.Name == "Branch Admin") { Branch branch = IBranchService.GetSingle(user.BranchId); List <Branch> AdminBranches = new List <Branch>(); AdminBranches.Add(branch); branches = AdminBranches; adminRoles = adminRoles.Where(x => x.Id > userRole.Id).ToList(); } UserRoleId.DataSource = adminRoles; UserRoleId.DataTextField = "Name"; UserRoleId.DataValueField = "Id"; UserRoleId.DataBind(); UserRoleId.Items.Insert(0, new ListItem { Value = "", Text = "Select" }); BranchId.DataSource = branches; BranchId.DataTextField = "Code"; BranchId.DataValueField = "Id"; BranchId.DataBind(); BranchId.Items.Insert(0, new ListItem { Value = "0", Text = "Select" }); } string currentDateString = DateTime.Now.ToString("MM/dd/yyyy"); CreatedBy.Value = "0"; UpdatedBy.Value = "0"; CreatedDate.Value = currentDateString; UpdatedDate.Value = currentDateString; ApiAuthToken.Attributes.Add("readonly", "readonly"); string idString = Request.QueryString["id"]; if (idString != null && idString != "") { int id = Convert.ToInt32(idString); User obj = IUserService.GetSingle(id); UserRoleId.Value = obj.UserRoleId.ToString(); Username.Value = obj.Username; EmailId.Value = obj.EmailId; MobileNumber.Value = obj.MobileNumber; Password.Value = obj.Password; TransPwd.Value = obj.TransPwd; UniqueKey.Value = obj.UniqueKey; IsOnline.Value = obj.IsOnline.ToString(); IsActive.Value = obj.IsActive.ToString(); IsPrimary.Value = obj.IsPrimary.ToString(); RegisterIp.Value = obj.RegisterIp.ToString(); LastLoginOn.Value = obj.LastLoginOn == null?DateTime.Now.ToString("MM/dd/yyyy HH:mm:ss") : obj.LastLoginOn.Value.ToString("MM/dd/yyyy HH:mm:ss"); LastLoginIp.Value = obj.LastLoginIp.ToString(); ApiAuthToken.Value = obj.ApiAuthToken; Id.Value = obj.Id.ToString(); Status.Value = obj.Status.ToString(); CreatedBy.Value = obj.CreatedBy.ToString(); CreatedDate.Value = obj.CreatedOn.ToString("MM/dd/yyyy HH:mm:ss"); UpdatedBy.Value = obj.UpdatedBy.ToString(); UpdatedDate.Value = obj.UpdatedOn == null?DateTime.Now.ToString("MM/dd/yyyy HH:mm:ss") : obj.UpdatedOn.Value.ToString("MM/dd/yyyy HH:mm:ss"); CompanyId.Value = "1"; BranchId.Value = obj.BranchId == 0 ? "0" : obj.BranchId.ToString(); DepartmentId.Value = obj.DepartmentId == 0 ? "0" : obj.DepartmentId.ToString(); IsAll.Value = obj.IsAll.ToString(); } }
public virtual IItem Add(string name, BranchId branchId) { return ItemFactory.BuildItem(_item.Add(name, branchId)); }
public virtual IItem Add(string name, BranchId branchId) { return(ItemFactory.BuildItem(_item.Add(name, branchId))); }
private static ConditionalWeakTable<DocumentId, SyntaxTreeIndex> GetInfoTable( BranchId branchId, Workspace workspace, ConditionalWeakTable<BranchId, ConditionalWeakTable<DocumentId, SyntaxTreeIndex>> cache) { return cache.GetValue(branchId, id => { if (id == workspace.PrimaryBranchId) { workspace.DocumentClosed += (sender, e) => { if (!e.Document.IsFromPrimaryBranch()) { return; } if (cache.TryGetValue(e.Document.Project.Solution.BranchId, out var infoTable)) { // remove closed document from primary branch from live cache. infoTable.Remove(e.Document.Id); } }; } return new ConditionalWeakTable<DocumentId, SyntaxTreeIndex>(); }); }
private static ConditionalWeakTable<DocumentId, SyntaxTreeIdentifierInfo> GetInfoTable(BranchId branchId, Workspace workspace) { return cache.GetValue(branchId, id => { if (id == workspace.PrimaryBranchId) { workspace.DocumentClosed += OnDocumentClosed; } return new ConditionalWeakTable<DocumentId, SyntaxTreeIdentifierInfo>(); }); }
private static ConditionalWeakTable <DocumentId, SyntaxTreeIdentifierInfo> GetInfoTable(BranchId branchId, Workspace workspace) { return(cache.GetValue(branchId, id => { if (id == workspace.PrimaryBranchId) { workspace.DocumentClosed += OnDocumentClosed; } return new ConditionalWeakTable <DocumentId, SyntaxTreeIdentifierInfo>(); })); }
protected void Page_Load(object sender, EventArgs e) { string currentDateString = DateTime.Now.ToString("MM/dd/yyyy"); CreatedDate.Value = currentDateString; UpdatedDate.Value = currentDateString; List <Branch> branches = IBranchService.GetData(0, 0, false); List <ListItem> branchesList = new List <ListItem>(); branches.ForEach(obj => { branchesList.Add(new ListItem() { Text = obj.Code + " - " + obj.Name, Value = obj.Id.ToString() }); }); BranchId.DataSource = branchesList; BranchId.DataTextField = "Text"; BranchId.DataValueField = "Value"; BranchId.DataBind(); List <Department> departments = IDepartmentService.GetData(0, 0, false); List <ListItem> departmentsList = new List <ListItem>(); departments.ForEach(obj => { departmentsList.Add(new ListItem() { Text = obj.Code + " - " + obj.Name, Value = obj.Id.ToString() }); }); DepartmentId.DataSource = departmentsList; DepartmentId.DataTextField = "Text"; DepartmentId.DataValueField = "Value"; DepartmentId.DataBind(); List <Stage> stages = IStageService.GetData(0, 0, false); List <ListItem> stagesList = new List <ListItem>(); stages.ForEach(obj => { stagesList.Add(new ListItem() { Text = obj.Code + " - " + obj.Name, Value = obj.Id.ToString() }); }); StageId.DataSource = stagesList; StageId.DataTextField = "Text"; StageId.DataValueField = "Value"; StageId.DataBind(); Status.Value = "1"; string idString = Request.QueryString["id"]; if (idString != null && idString != "") { int id = Convert.ToInt32(idString); Batch obj = IBatchService.GetSingle(id); Id.Value = obj.Id.ToString(); BranchId.Value = obj.BranchId.ToString(); StageId.Value = obj.StageId.ToString(); BatchKey.Value = obj.BatchKey; BatchNo.Value = obj.BatchNo; BatchCount.Value = obj.BatchCount.Value.ToString(); BatchStatus.Value = obj.BatchStatus.ToString(); Status.Value = obj.Status.ToString(); } }