protected void RadGridResolutionProfile_ItemDataBound(object sender, GridItemEventArgs e) { if (e.Item is GridDataItem) { var item = e.Item as GridDataItem; if (item.ItemIndex > -1 && item.DataItem is ResolutionProfileBO) { ResolutionProfileBO objResolutionProfile = (ResolutionProfileBO)item.DataItem; HyperLink linkEdit = (HyperLink)item.FindControl("linkEdit"); linkEdit.Attributes.Add("qid", objResolutionProfile.ID.ToString()); HyperLink linkDelete = (HyperLink)item.FindControl("linkDelete"); linkDelete.Attributes.Add("qid", objResolutionProfile.ID.ToString()); ReturnIntViewBO objReturnInt = new ReturnIntViewBO(); objReturnInt = SettingsBO.ValidateField(0, "VisualLayout", "ResolutionProfile", objResolutionProfile.ID.ToString()); linkDelete.Visible = objReturnInt.RetVal == 1; //linkDelete.Visible = (objResolutionProfile.VisualLayoutsWhereThisIsResolutionProfile.Any()) ? false : true; } } }
protected void cfvEmailAddress_Validate(object sender, ServerValidateEventArgs e) { //List<UserBO> lstEmailAddress = new List<UserBO>(); //if (!String.IsNullOrEmpty(this.txtEmailAddress.Text)) //{ // lstEmailAddress = (from o in (new UserBO()).GetAllObject() // where o.ID != this.QueryID && o.EmailAddress == this.txtEmailAddress.Text.Trim() // select o).ToList(); //} //e.IsValid = !(lstEmailAddress.Count > 0); try { ReturnIntViewBO objReturnInt = new ReturnIntViewBO(); objReturnInt = SettingsBO.ValidateField(this.QueryID, "User", "EmailAddress", this.txtEmailAddress.Text); e.IsValid = objReturnInt.RetVal == 1; } catch (Exception ex) { IndicoLogging.log.Error("Error occured while cvTxtName_ServerValidate on AddEditUser.aspx", ex); } }
protected void RadGridShipmentMode_ItemDataBound(object sender, GridItemEventArgs e) { if (e.Item is GridDataItem) { var item = e.Item as GridDataItem; if (item.ItemIndex > -1 && item.DataItem is ShipmentModeBO) { ShipmentModeBO objShipmentMode = (ShipmentModeBO)item.DataItem; HyperLink linkEdit = (HyperLink)item.FindControl("linkEdit"); linkEdit.Attributes.Add("qid", objShipmentMode.ID.ToString()); HyperLink linkDelete = (HyperLink)item.FindControl("linkDelete"); linkDelete.Attributes.Add("qid", objShipmentMode.ID.ToString()); //linkDelete.Visible = (objShipmentMode.OrdersWhereThisIsShipmentMode.Count == 0 || // objShipmentMode.ReservationsWhereThisIsShipmentMode.Count == 0); ReturnIntViewBO objReturnInt = new ReturnIntViewBO(); objReturnInt = SettingsBO.ValidateField(0, "Order", "ShipmentMode", objShipmentMode.ID.ToString()); linkDelete.Visible = objReturnInt.RetVal == 1; } } }