コード例 #1
0
 public void Bind_DDL_Customer()
 {
     ddlCustmore.DataSource = Masters.Idv_Chetana_Get_ZoneCustomer(Convert.ToInt32(DDLZone.SelectedValue.ToString()));
     ddlCustmore.DataBind();
     ddlCustmore.Items.Insert(0, new ListItem("-Select Customer-", "0"));
 }
コード例 #2
0
 public void Bind_DDL_Supplier()
 {
     ddlSupplier.DataSource = Masters.Get_AreaZone_Zone_SuperZone(0, "Supplier");
     ddlSupplier.DataBind();
     ddlSupplier.Items.Insert(0, new ListItem("-Select Supplier-", "0"));
 }
コード例 #3
0
 public void Bind_DDL_Zone()
 {
     DDLZone.DataSource = Masters.Get_AreaZone_Zone_SuperZone(Convert.ToInt32(DDLSuperZone.SelectedValue.ToString()), "Zone");
     DDLZone.DataBind();
     DDLZone.Items.Insert(0, new ListItem("-Select Zone-", "0"));
 }
コード例 #4
0
        public void Validate()
        {
            // Wire up the node label parents.

            foreach (var node in NodeDefinitions.Values)
            {
                if (node.Labels != null)
                {
                    node.Labels.Node = node;
                }
            }

            // Validate the properties.

            Provisioner = Provisioner ?? defaultProvisioner;
            Kubernetes  = Kubernetes ?? new KubernetesOptions();
            Docker      = Docker ?? new DockerOptions();
            Ceph        = Ceph ?? new CephOptions()
            {
                Enabled = false
            };
            Mon = Mon ?? new MonOptions()
            {
                Enabled = false
            };
            Prometheus = Prometheus ?? new PrometheusOptions()
            {
                Enabled = false
            };
            DrivePrefix = DrivePrefix ?? defaultDrivePrefix;
            Setup       = Setup ?? new SetupOptions();
            Hosting     = Hosting ?? new HostingOptions();
            NodeOptions = NodeOptions ?? new NodeOptions();
            Network     = Network ?? new NetworkOptions();

            Kubernetes.Validate(this);
            Docker.Validate(this);
            Ceph.Validate(this);
            Mon.Validate(this);
            Prometheus.Validate(this);
            Setup.Validate(this);
            Network.Validate(this);
            Hosting.Validate(this);
            NodeOptions.Validate(this);
            Network.Validate(this);

            new HostingManagerFactory().Validate(this);

            if (TimeSources == null || TimeSources.Length == 0 || TimeSources.Count(ts => string.IsNullOrWhiteSpace(ts)) > 0)
            {
                TimeSources = new string[] { "pool.ntp.org" };
            }

            if (NodeDefinitions == null || NodeDefinitions.Count == 0)
            {
                throw new ClusterDefinitionException("At least one cluster node must be defined.");
            }

            foreach (var node in NodeDefinitions.Values)
            {
                node.Validate(this);
            }

            if (Name == null)
            {
                throw new ClusterDefinitionException($"The [{nameof(ClusterDefinition)}.{nameof(Name)}] property is required.");
            }

            if (!IsValidName(Name))
            {
                throw new ClusterDefinitionException($"The [{nameof(ClusterDefinition)}.{nameof(Name)}={Name}] property is not valid.  Only letters, numbers, periods, dashes, and underscores are allowed.");
            }

            if (Datacenter == null)
            {
                throw new ClusterDefinitionException($"The [{nameof(ClusterDefinition)}.{nameof(Datacenter)}] property is required.");
            }

            if (!IsValidName(Datacenter))
            {
                throw new ClusterDefinitionException($"The [{nameof(ClusterDefinition)}.{nameof(Datacenter)}={Datacenter}] property is not valid.  Only letters, numbers, periods, dashes, and underscores are allowed.");
            }

            var masterNodeCount = Masters.Count();

            if (masterNodeCount == 0)
            {
                throw new ClusterDefinitionException("Clusters must have at least one master node.");
            }
            else if (masterNodeCount > 5)
            {
                throw new ClusterDefinitionException("Clusters may not have more than [5] master nodes.");
            }
            else if (!NeonHelper.IsOdd(masterNodeCount))
            {
                throw new ClusterDefinitionException($"[{masterNodeCount}] master nodes is not allowed.  Only an off number of master nodes is allowed: [1, 3, or 5]");
            }

            if (!string.IsNullOrEmpty(PackageProxy))
            {
                // Ensure that this is set to zero or more network endpoints
                // formatted like:
                //
                //      HOSTNAME:PORT
                //      ADDRESS:PORT

                foreach (var endpoint in PackageProxy.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries))
                {
                    var fields = endpoint.Split(':');

                    if (!IPAddress.TryParse(fields[0], out var address) && !NetHelper.IsValidHost(fields[0]))
                    {
                        throw new ClusterDefinitionException($"Invalid IP address or HOSTNAME [{fields[0]}] in [{nameof(ClusterDefinition)}.{nameof(PackageProxy)}={PackageProxy}].");
                    }

                    if (!int.TryParse(fields[1], out var port) || !NetHelper.IsValidPort(port))
                    {
                        throw new ClusterDefinitionException($"Invalid port [{fields[1]}] in [{nameof(ClusterDefinition)}.{nameof(PackageProxy)}={PackageProxy}].");
                    }
                }
            }

            // Ensure that each node has a valid unique or NULL IP address.

            NetworkCidr nodesSubnet = null;

            if (Network.NodeSubnet != null)
            {
                nodesSubnet = NetworkCidr.Parse(Network.NodeSubnet);
            }

            var addressToNode = new Dictionary <string, NodeDefinition>();

            foreach (var node in SortedNodes)
            {
                if (node.PrivateAddress != null)
                {
                    NodeDefinition conflictNode;

                    if (addressToNode.TryGetValue(node.PrivateAddress, out conflictNode))
                    {
                        throw new ClusterDefinitionException($"Node [name={node.Name}] has invalid private IP address [{node.PrivateAddress}] that conflicts with node [name={conflictNode.Name}].");
                    }
                }
            }

            foreach (var node in SortedNodes)
            {
                if (node.PrivateAddress != null)
                {
                    if (!IPAddress.TryParse(node.PrivateAddress, out var address))
                    {
                        throw new ClusterDefinitionException($"Node [name={node.Name}] has invalid private IP address [{node.PrivateAddress}].");
                    }

                    if (nodesSubnet != null && !nodesSubnet.Contains(address))
                    {
                        throw new ClusterDefinitionException($"Node [name={node.Name}] has private IP address [{node.PrivateAddress}] that is not within the hosting [{nameof(Network.NodeSubnet)}={Network.NodeSubnet}].");
                    }
                }
                else if (!Hosting.IsCloudProvider)
                {
                    throw new ClusterDefinitionException($"Node [name={node.Name}] is not assigned a private IP address.  This is required when deploying to a [{nameof(Environment)}={Environment}] hosting environment.");
                }
            }
        }
コード例 #5
0
 public void Prep()
 {
     Instances = Instances.OrderBy(i => i.Port).ThenBy(i => i.Name).ThenBy(i => i.Host.HostName).ToList();
     Masters   = Instances.Where(i => i.IsMaster).ToList();
     Slaving   = Instances.Where(i => i.IsSlaving).ToList();
     Missing   = Instances.Where(i => !Slaving.Contains(i) && (i.Info == null || i.Role == RedisInfo.RedisInstanceRole.Unknown || !i.Info.LastPollSuccessful)).ToList();
     // In the single server view, everything is top level
     Heads             = View == RedisViews.Server ? Instances.ToList() : Masters.Where(m => m.SlaveCount > 0).ToList();
     StandAloneMasters = View == RedisViews.Server ? new List <RedisInstance>() : Masters.Where(m => m.SlaveCount == 0 && !Missing.Contains(m)).ToList();
 }
コード例 #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["ChetanaCompanyName"] != null)
     {
         if (Session["FY"] != null)
         {
             strChetanaCompanyName = Session["ChetanaCompanyName"].ToString();
             strFY = Session["FY"].ToString();
         }
         else
         {
             Session.Clear();
         }
         //Response.Write(strFY);
     }
     if (!Page.IsPostBack)
     {
         if (ddlCustmore.SelectedValue.ToLower().ToString() == "0" || ddlCustmore.SelectedValue.ToLower().ToString() == "")
         {
         }
         else
         {
             // ShowDetails();
         }
         ddlSDZone.DataSource = Masters.Get_AreaZone_Zone_SuperZone(0, "SDZone");
         ddlSDZone.DataBind();
         ddlSDZone.Focus();
         DDLSuperZone.Items.Clear();
         // ddlSDZone.Items.Insert(0, new ListItem("-Select Super Duper Zone-", "0"));
         DDLSuperZone.Items.Insert(0, new ListItem("-Select Super Zone-", "0"));
         pnlzone.Visible     = true;
         pnlcustomer.Visible = false;
         // DDLSuperZone.SelectedIndex = 0;
         //DDLZone.SelectedIndex = 0;
         ddlCustmore.SelectedIndex       = 0;
         CustomerReportView.ReportSource = null;
         txtcustomer.Text = "";
         lblCustName.Text = "";
         DDLSuperZone.Focus();
         DDLZone.Items.Insert(0, new ListItem("-Select Zone-", "0"));
         ddlCustmore.Items.Insert(0, new ListItem("-Select Customer-", "0"));
         setddl(Session["zoneLevel"].ToString(), Session["zoneId"].ToString());
     }
     if (IsPostBack)
     {
         if (rdbselect.SelectedValue == "Customer")
         {
             // if (txtcustomer.Text.ToString().Trim() != "")
             // {
             //     if (txtFrom.Text.Trim() != "" && txtTo.Text.Trim() != "")
             //     {
             //         ShowDetails();
             //     }
             // }
             //else
             // {
             //     if (ddlDetails.SelectedValue == "details")
             //     {
             //         MessageBox("Select Customer");
             //     }
             //     else
             //     {
             if (txtFrom.Text != "" && txtTo.Text != "")
             {
                 ShowDetails();
             }
             // }
             // }
         }
         else
         {
             if (DDLSuperZone.SelectedValue != "0")
             {
                 if (txtFrom.Text.Trim() != "" && txtTo.Text.Trim() != "")
                 {
                     ShowDetails();
                 }
             }
             else
             {
                 //  MessageBox("Select SuperZone");
             }
         }
     }
 }
コード例 #7
0
    public void FillForm()
    {
        try
        {
            //DDLareazone.Enabled = true;
            //DDLarea.Enabled = true;
            //DDLzone.Enabled = true;
            //btnSave.Visible = true;
            PnlAdd.Visible = true;
            //PnlAdd.Enabled= false;

            //btnSave.Text = "Update";
            //btnSave.Enabled = true;
            LblCustId.Text           = ((Label)grdCustDetails.Rows[0].FindControl("lblCustID")).Text;
            TxtCustCode.Text         = ((Label)grdCustDetails.Rows[0].FindControl("lblCustCode")).Text;
            TxtShortForm.Text        = ((Label)grdCustDetails.Rows[0].FindControl("lblShortForm")).Text;
            TxtFamilyCode.Text       = ((Label)grdCustDetails.Rows[0].FindControl("lblFamilyCode")).Text;
            TxtAddress.Text          = ((Label)grdCustDetails.Rows[0].FindControl("lblAddress")).Text;
            TxtZip.Text              = ((Label)grdCustDetails.Rows[0].FindControl("lblZip")).Text;
            TxtPhone1.Text           = ((Label)grdCustDetails.Rows[0].FindControl("lblPhone1")).Text;
            TxtPhone2.Text           = ((Label)grdCustDetails.Rows[0].FindControl("lblPhone2")).Text;
            TxtEmailID.Text          = ((Label)grdCustDetails.Rows[0].FindControl("lblEmailID")).Text;
            TxtCustName.Text         = ((Label)grdCustDetails.Rows[0].FindControl("lblCustName")).Text;
            TxtCreditLimit.Text      = ((Label)grdCustDetails.Rows[0].FindControl("lblCreditLimit")).Text;
            TxtPrincipalName.Text    = ((Label)grdCustDetails.Rows[0].FindControl("LblPrincipalName")).Text;
            TxtPrincipalMobile.Text  = ((Label)grdCustDetails.Rows[0].FindControl("LblPrincipalMobile")).Text;
            TxtPrincipalDOB.Text     = ((Label)grdCustDetails.Rows[0].FindControl("LblPrincipalDOB")).Text;
            TxtKeyPersonName.Text    = ((Label)grdCustDetails.Rows[0].FindControl("LblKeyPersonName")).Text;
            TxtKeyPersonMobile.Text  = ((Label)grdCustDetails.Rows[0].FindControl("LblKeyPersonMobile")).Text;
            TxtKeyPersonDOB.Text     = ((Label)grdCustDetails.Rows[0].FindControl("LblKeyPersonDOB")).Text;
            TxtAdditinalDis.Text     = ((Label)grdCustDetails.Rows[0].FindControl("LblAdditinalDis")).Text;
            TxtVIPRemark.Text        = ((Label)grdCustDetails.Rows[0].FindControl("LblVIPRemark")).Text;
            TxtMedium.Text           = ((Label)grdCustDetails.Rows[0].FindControl("LblMedium")).Text;
            ChkIsActive.Checked      = ((CheckBox)grdCustDetails.Rows[0].FindControl("chkisActive")).Checked;
            LblSuperzone.Text        = ((Label)grdCustDetails.Rows[0].FindControl("LblSuperZoneID")).Text;
            Lblzone.Text             = ((Label)grdCustDetails.Rows[0].FindControl("LblZoneID")).Text;
            LblAreazone.Text         = ((Label)grdCustDetails.Rows[0].FindControl("LblAreaZoneID")).Text;
            LblArea.Text             = ((Label)grdCustDetails.Rows[0].FindControl("LblAreaID")).Text;
            LblCustDetailID1.Text    = ((Label)grdCustDetails.Rows[0].FindControl("LblCustDetailID")).Text;
            TxtCustomerType.Text     = ((Label)grdCustDetails.Rows[0].FindControl("lblctype")).Text;
            txtcreditdays.Text       = ((Label)grdCustDetails.Rows[0].FindControl("lblcreditdays")).Text;
            lblrating.Text           = ((Label)grdCustDetails.Rows[0].FindControl("lblcustrating")).Text;
            txtSchAdditionalDis.Text = ((Label)grdCustDetails.Rows[0].FindControl("lblSchAdditionalDis")).Text;
            txtTODValue1.Text        = ((Label)grdCustDetails.Rows[0].FindControl("lblTODValue1")).Text;
            txtTODValue2.Text        = ((Label)grdCustDetails.Rows[0].FindControl("lblTODValue2")).Text;
            txtTODValue3.Text        = ((Label)grdCustDetails.Rows[0].FindControl("lblTODValue3")).Text;
            txtTODDisc1.Text         = ((Label)grdCustDetails.Rows[0].FindControl("lblTODDisc1")).Text;
            txtTODDisc2.Text         = ((Label)grdCustDetails.Rows[0].FindControl("lblTODDisc2")).Text;
            txtTODDisc3.Text         = ((Label)grdCustDetails.Rows[0].FindControl("lblTODDisc3")).Text;
            TxtblkRemark.Text        = ((Label)grdCustDetails.Rows[0].FindControl("Lblblkremark")).Text;
            TxtblkDate.Text          = ((Label)grdCustDetails.Rows[0].FindControl("Lblblkdate")).Text;
            txtUpperlimit.Text       = ((Label)grdCustDetails.Rows[0].FindControl("lblCUL")).Text;
            txtLowerlimit.Text       = ((Label)grdCustDetails.Rows[0].FindControl("lblCLL")).Text;
            chk_splitdc.Checked      = ((CheckBox)grdCustDetails.Rows[0].FindControl("chk_isSplit")).Checked;
            //ReadMe Comment(Zaid Ansari) Any Problem SBUCode Dropdown Bind Find This Method GetSBUCode()
            lblSBUCodeNone.Text = ((Label)grdCustDetails.Rows[0].FindControl("lblSUBCode")).Text == "" ? "0" : lblSBUCodeNone.Text = ((Label)grdCustDetails.Rows[0].FindControl("lblSUBCode")).Text;
            txtPANNo.Text       = ((Label)grdCustDetails.Rows[0].FindControl("lblPan")).Text;
            txtGst.Text         = ((Label)grdCustDetails.Rows[0].FindControl("lblGst")).Text;
            txtStateCode.Text   = ((Label)grdCustDetails.Rows[0].FindControl("lblStateCode")).Text;
            try
            {
                //ReadMe Comment(Zaid Ansari)(Dropdown Bind) Super Zone ,State,City,Category Any Problem Find This Method fillzones()
                ddlSbucode.DataSource = Masterofmaster.Get_MasterOfMaster_ByGroup_ForDropdown("SBU", "DropDown");
                ddlSbucode.DataBind();
                ddlSbucode.Items.Insert(0, new ListItem("--Seelct SBU Code--", "0"));
                ddlSbucode.SelectedValue = lblSBUCodeNone.Text;

                DDLsuperzone.SelectedValue = LblSuperzone.Text;
                DDLzone.DataSource         = Masters.Get_AreaZone_Zone_SuperZone(Convert.ToInt32(LblSuperzone.Text), "Zone");
                DDLzone.DataBind();
                DDLzone.Items.Insert(0, new ListItem("--Select Zone--", "0"));
                DDLzone.SelectedValue = Lblzone.Text.Trim();

                DDLareazone.DataSource = Masters.Get_AreaZone_Zone_SuperZone(Convert.ToInt32(Lblzone.Text), "AreaZone");
                DDLareazone.DataBind();
                DDLareazone.Items.Insert(0, new ListItem("--Select AreaZone--", "0"));
                DDLareazone.SelectedValue = LblAreazone.Text.Trim();

                DDLarea.DataSource = Masters.Get_AreaZone_Zone_SuperZone(Convert.ToInt32(LblAreazone.Text), "Area");
                DDLarea.DataBind();
                DDLarea.Items.Insert(0, new ListItem("--Select Area--", "0"));
                DDLarea.SelectedValue = LblArea.Text.Trim();
            }
            catch { }
            ddLStates.DataSource = Destination.GetDestination(flag);
            ddLStates.DataBind();
            ddLStates.Items.Insert(0, new ListItem("--Select State--", "0"));
            ddLStates.SelectedValue = ((Label)grdCustDetails.Rows[0].FindControl("lblstate1")).Text.Trim();

            ddlCity.DataSource = Destination.GetDestination(Convert.ToString(ddLStates.SelectedValue));
            ddlCity.DataBind();
            ddlCity.Items.Insert(0, new ListItem("--Select City--", "0"));
            ddlCity.SelectedValue = ((Label)grdCustDetails.Rows[0].FindControl("lblCity")).Text.Trim();

            DataView dv1 = new DataView(Masterofmaster.Get_MasterOfMaster_ByGroup("CustRating").Tables[0]);
            DdlCustRating.DataSource = dv1;
            DdlCustRating.DataBind();
            DdlCustRating.Items.Insert(0, new ListItem("--Select Rating--", "0"));
            DdlCustRating.SelectedValue = lblrating.Text.Trim();
            ChkBlacklist.Checked        = ((CheckBox)grdCustDetails.Rows[0].FindControl("ChKBList")).Checked;

            //lblboardid.Text = ((Label)grdCustDetails.Rows[0].FindControl("lblboardid")).Text;
            //DDLBoard.DataSource = Masterofmaster.Get_MasterOfMaster_ByGroup("Board").Tables[0];
            //DDLBoard.DataBind();
            //DDLBoard.Items.Insert(0, new ListItem("--Select Board--", "0"));
            //DDLBoard.SelectedValue = ((Label)grdCustDetails.Rows[0].FindControl("lblboardid")).Text;
            txtassociation.Text = ((Label)grdCustDetails.Rows[0].FindControl("lblassociation")).Text;
            txtcgp.Text         = ((Label)grdCustDetails.Rows[0].FindControl("lblcgp")).Text;
            txtbuisiness.Text   = ((Label)grdCustDetails.Rows[0].FindControl("lblbuisiness")).Text;

            DDLCC.DataSource = CustCategory.GetCustomerCategoryMaster(flag);
            DDLCC.DataBind();
            DDLCC.Items.Insert(0, new ListItem("--Select Category--", "0"));
            DDLCC.SelectedValue = ((Label)grdCustDetails.Rows[0].FindControl("lblCMID")).Text.Trim();

            DDLCSC.DataSource = CustCategory.GetCustomerCategoryMaster(Convert.ToString(DDLCC.SelectedValue));
            DDLCSC.DataBind();
            DDLCSC.Items.Insert(0, new ListItem("--Select City--", "0"));
            DDLCSC.SelectedValue = ((Label)grdCustDetails.Rows[0].FindControl("lblCMIDSUB")).Text.Trim();
        }
        catch (Exception ex)
        {
        }
    }
コード例 #8
0
    protected void grdEmpDetails_RowEditing(object sender, GridViewEditEventArgs e)
    {
        try
        {
            pnlEmployeeDetails.Visible = false;
            Panel1.Visible             = true;
            btnSavE.Visible            = false;
            filter.Visible             = false;

            txtempCode.Text = ((Label)grdEmpDetails.Rows[e.NewEditIndex].FindControl("lblEmpcode")).Text;
            //DDLsuperzone.DataSource = SuperZone.GetSuperzonemaster();
            //DDLsuperzone.DataBind();
            // DDLsuperzone.Items.Insert(0, new ListItem("--Select SuperZone--", "0"));
            //
            DDLSDZone.DataSource = Masters.Get_AreaZone_Zone_SuperZone(0, "SDZone");
            DDLSDZone.DataBind();
            DDLSDZone.Items.Insert(0, new ListItem("All", "0"));


            DDLstate.DataSource = Customer_cs.Get_DestinationMaster("state");
            DDLstate.DataBind();
            DDLstate.Items.Insert(0, new ListItem("--Select State--", "0"));
            //
            pnlEmployeeDetails.Visible = false;
            Panel1.Visible             = true;
            LblEmpID.Text  = ((Label)grdEmpDetails.Rows[e.NewEditIndex].FindControl("lblEID")).Text;
            txtFname.Text  = ((Label)grdEmpDetails.Rows[e.NewEditIndex].FindControl("lblFName")).Text;
            txtMname.Text  = ((Label)grdEmpDetails.Rows[e.NewEditIndex].FindControl("lblMiddleName")).Text;
            txtLname.Text  = ((Label)grdEmpDetails.Rows[e.NewEditIndex].FindControl("LblLastName")).Text;
            Rdogender.Text = ((Label)grdEmpDetails.Rows[e.NewEditIndex].FindControl("LblGender")).Text;
            txtDob.Text    = ((Label)grdEmpDetails.Rows[e.NewEditIndex].FindControl("LblDOB")).Text;
            //
            txtphne1.Text   = ((Label)grdEmpDetails.Rows[e.NewEditIndex].FindControl("LblPhone1")).Text;
            txtphne2.Text   = ((Label)grdEmpDetails.Rows[e.NewEditIndex].FindControl("LblPhone2")).Text;
            txtzipCode.Text = ((Label)grdEmpDetails.Rows[e.NewEditIndex].FindControl("LblZip")).Text;
            txtEmail.Text   = ((Label)grdEmpDetails.Rows[e.NewEditIndex].FindControl("LblEmailID")).Text;
            txtAdd.Text     = ((Label)grdEmpDetails.Rows[e.NewEditIndex].FindControl("LblAddress")).Text;

            ///
            DDLSDZone.SelectedValue = ((Label)grdEmpDetails.Rows[e.NewEditIndex].FindControl("LblSDZoneId")).Text;
            DDLsuperzone.DataSource = Masters.Get_AreaZone_Zone_SuperZone(Convert.ToInt32(DDLSDZone.SelectedValue.ToString()), "SuperZone1");
            DDLsuperzone.DataBind();
            DDLsuperzone.Items.Insert(0, new ListItem("All", "0"));
            ///
            //
            DDLsuperzone.SelectedValue = ((Label)grdEmpDetails.Rows[e.NewEditIndex].FindControl("lblSuperZoneID")).Text;
            DDLzone.DataSource         = Masters.Get_AreaZone_Zone_SuperZone(Convert.ToInt32(DDLsuperzone.SelectedValue.ToString()), "Zone");
            DDLzone.DataBind();
            DDLzone.Items.Insert(0, new ListItem("All", "0"));
            DDLzone.Enabled = true;

            ////
            DDLzone.SelectedValue  = ((Label)grdEmpDetails.Rows[e.NewEditIndex].FindControl("lblZoneID")).Text;
            DDLareazone.DataSource = Masters.Get_AreaZone_Zone_SuperZone(Convert.ToInt32(DDLzone.SelectedValue.ToString()), "AreaZone");
            DDLareazone.DataBind();
            DDLareazone.Items.Insert(0, new ListItem("All", "0"));
            DDLareazone.Enabled = true;
            ////
            DDLareazone.SelectedValue = ((Label)grdEmpDetails.Rows[e.NewEditIndex].FindControl("lblAreaZoneID")).Text;
            Chkarea.DataSource        = Masters.Get_AreaZone_Zone_SuperZone(Convert.ToInt32(DDLareazone.SelectedValue.ToString()), "Area");
            Chkarea.DataBind();
            Chkarea.Items.Insert(0, new ListItem("All", "0"));
            Chkarea.Enabled = true;
            selectArea(Convert.ToInt32(LblEmpID.Text.Trim()));
            //Chkarea.SelectedValue = ((Label)grdEmpDetails.Rows[e.NewEditIndex].FindControl("lblAreaID")).Text;

            txtDepCode.Text = ((Label)grdEmpDetails.Rows[e.NewEditIndex].FindControl("lblDeptId")).Text;
            string JoinDate        = ((Label)grdEmpDetails.Rows[e.NewEditIndex].FindControl("LblJoinDate")).Text;
            string ResignationDate = ((Label)grdEmpDetails.Rows[e.NewEditIndex].FindControl("LblResignationDate")).Text;
            Chekacv.Checked = ((CheckBox)grdEmpDetails.Rows[e.NewEditIndex].FindControl("chkisActive")).Checked;
            txtjoin.Text    = JoinDate;
            txtResign.Text  = ResignationDate;

            DDLstate.SelectedValue = ((Label)grdEmpDetails.Rows[e.NewEditIndex].FindControl("lblState")).Text;


            DDLcity.DataSource = Customer_cs.Get_DestinationMaster(DDLstate.SelectedValue.ToString());
            DDLcity.DataBind();
            DDLcity.Items.Insert(0, new ListItem("--Select City--", "0"));
            DDLcity.Enabled = true;
            DDLcity.Focus();

            // DDLcity.DataSource = Customer_cs.Get_DestinationMaster(DDLstate.SelectedValue.ToString());
            // DDLcity.DataBind();
            // DDLcity.Items.Insert(0, new ListItem("--Select City--", "0"));
            // DDLcity.Enabled = true;


            DDLcity.SelectedItem.Text = ((Label)grdEmpDetails.Rows[e.NewEditIndex].FindControl("LblCity")).Text;
            imgprof.ImageUrl          = "../Images/profileimg/" + ((Label)grdEmpDetails.Rows[e.NewEditIndex].FindControl("lblphoto")).Text;
            lblImage.Text             = ((Label)grdEmpDetails.Rows[e.NewEditIndex].FindControl("lblphoto")).Text;

            ddlqulification.Text = ((Label)grdEmpDetails.Rows[e.NewEditIndex].FindControl("LblQualification")).Text;
            fillQualification();
            DDlDesignation.Text = ((Label)grdEmpDetails.Rows[e.NewEditIndex].FindControl("LblDesignation")).Text;
            fillDesignation();
        }
        catch
        {
        }
    }
コード例 #9
0
ファイル: Tes4.cs プロジェクト: tstavrianos/patcher
 public override IEnumerable <string> GetMasterFiles()
 {
     return(Masters != null?Masters.Select(m => m.Filename) : Enumerable.Empty <string>());
 }
コード例 #10
0
 public void Bind_DDL_SuperZone()
 {
     DDLSuperZone.DataSource = Masters.Get_AreaZone_Zone_SuperZone(0, "SuperZone");
     DDLSuperZone.DataBind();
     DDLSuperZone.Items.Insert(0, new ListItem("-Select SuperZone-", "0"));
 }
コード例 #11
0
        public ClaimViewModel(User currentUser,
                              Claim claim,
                              IReadOnlyCollection <PlotElement> plotElements,
                              IUriService uriService,
                              IEnumerable <ProjectAccommodationType>?availableAccommodationTypes = null,
                              IEnumerable <AccommodationRequest>?accommodationRequests           = null,
                              IEnumerable <AccommodationPotentialNeighbors>?potentialNeighbors   = null,
                              IEnumerable <AccommodationInvite>?incomingInvite = null,
                              IEnumerable <AccommodationInvite>?outgoingInvite = null)
        {
            ClaimId             = claim.ClaimId;
            CommentDiscussionId = claim.CommentDiscussionId;
            RootComments        = claim.CommentDiscussion.ToCommentTreeViewModel(currentUser.UserId);
            HasMasterAccess     = claim.HasMasterAccess(currentUser.UserId);
            CanManageThisClaim  = claim.HasAccess(currentUser.UserId,
                                                  acl => acl.CanManageClaims,
                                                  ExtraAccessReason.ResponsibleMaster);
            CanChangeRooms = claim.HasAccess(currentUser.UserId,
                                             acl => acl.CanSetPlayersAccommodations,
                                             ExtraAccessReason.PlayerOrResponsible);
            IsMyClaim                   = claim.PlayerUserId == currentUser.UserId;
            Player                      = claim.Player;
            ProjectId                   = claim.ProjectId;
            ProjectName                 = claim.Project.ProjectName;
            Status                      = new ClaimFullStatusView(claim, new AccessArguments(claim, currentUser.UserId));
            CharacterGroupId            = claim.CharacterGroupId;
            GroupName                   = claim.Group?.CharacterGroupName;
            CharacterId                 = claim.CharacterId;
            CharacterActive             = claim.Character?.IsActive;
            CharacterAutoCreated        = claim.Character?.AutoCreated;
            AvailableAccommodationTypes = availableAccommodationTypes?.Where(a =>
                                                                             a.IsPlayerSelectable || a.Id == claim.AccommodationRequest?.AccommodationTypeId ||
                                                                             claim.HasMasterAccess(currentUser.UserId)).ToList();
            PotentialNeighbors               = potentialNeighbors;
            AccommodationRequest             = claim.AccommodationRequest;
            IncomingInvite                   = incomingInvite;
            OutgoingInvite                   = outgoingInvite;
            OtherClaimsForThisCharacterCount = claim.IsApproved
                ? 0
                : claim.OtherClaimsForThisCharacter().Count();
            HasOtherApprovedClaim = !claim.IsApproved &&
                                    claim.OtherClaimsForThisCharacter().Any(c => c.IsApproved);
            Data = new CharacterTreeBuilder(claim.Project.RootGroup, currentUser.UserId).Generate();
            OtherClaimsFromThisPlayerCount     =
                OtherClaimsFromThisPlayerCount =
                    claim.IsApproved || claim.Project.Details.EnableManyCharacters
                        ? 0
                        : claim.OtherPendingClaimsForThisPlayer().Count();
            Masters = claim.Project.GetMasterListViewModel().ToList();

            if (claim.ResponsibleMasterUserId is null)
            {
                Masters.Add(new MasterListItemViewModel()
                {
                    Id = "-1", Name = "Нет"
                });
            }

            ResponsibleMasterId = claim.ResponsibleMasterUserId ?? -1;
            ResponsibleMaster   = claim.ResponsibleMasterUser;
            Fields     = new CustomFieldsViewModel(currentUser.UserId, claim);
            Navigation =
                CharacterNavigationViewModel.FromClaim(claim,
                                                       currentUser.UserId,
                                                       CharacterNavigationPage.Claim);
            Problems      = claim.GetProblems().Select(p => new ProblemViewModel(p)).ToList();
            PlayerDetails = new UserProfileDetailsViewModel(claim.Player,
                                                            (AccessReason)claim.Player.GetProfileAccess(currentUser));
            ProjectActive        = claim.Project.Active;
            CheckInStarted       = claim.Project.Details.CheckInProgress;
            CheckInModuleEnabled = claim.Project.Details.EnableCheckInModule;
            Validator            = new ClaimCheckInValidator(claim);

            AccommodationEnabled = claim.Project.Details.EnableAccommodation;

            if (claim.HasAccess(currentUser.UserId,
                                acl => acl.CanManageMoney, ExtraAccessReason.Player))
            {
                // Finance admins can create any payment.
                // User also can create any payment, but it will be moderated
                PaymentTypes = claim.Project.ActivePaymentTypes.Select(pt => new PaymentTypeViewModel(pt));
            }
            else
            {
                // All other masters can create payments only from a user to himself
                PaymentTypes = claim.Project.ActivePaymentTypes
                               .Where(pt => pt.UserId == currentUser.UserId)
                               .Select(pt => new PaymentTypeViewModel(pt));
            }
            ClaimFee = new ClaimFeeViewModel(claim, this, currentUser.UserId);

            if (claim.Character != null)
            {
                ParentGroups = new CharacterParentGroupsViewModel(claim.Character,
                                                                  claim.HasMasterAccess(currentUser.UserId));
            }

            if (claim.IsApproved && claim.Character != null)
            {
                var readOnlyList = claim.Character.GetOrderedPlots(plotElements);
                Plot = PlotDisplayViewModel.Published(readOnlyList,
                                                      currentUser.UserId,
                                                      claim.Character,
                                                      uriService);
            }
            else
            {
                Plot = PlotDisplayViewModel.Empty();
            }
        }
コード例 #12
0
 private void FillMasters()
 {
     Masters.Clear();
     PersonalStorage.Instance.Masters.ForEach(x => Masters.Add(x));
 }