Exemple #1
0
 /// <summary>
 /// Opens the Connection Create Dialog
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
 private void Btn_OpenCreateNewConnection_Click(object sender, RoutedEventArgs e)
 {
     using (ConnectionManger connectionManger = new ConnectionManger())
     {
         connectionManger.ShowDialog();
         this.ReloadConnections();
     }
 }
        protected void btnReject_Click(object sender, EventArgs e)
        {
            connectionManger       = new ConnectionManger();
            Session["Result"]      = "Rejected";
            Session["AdminReflex"] = txtRequestID.Text;
            string str = "update Request set AdminVIPApproval = 0 where RequestId = '" + txtRequestID.Text + "'";

            connectionManger.ConnMan(str);
        }
        protected void ddlLocation_SelectedIndexChanged1(object sender, EventArgs e)
        {
            connectionManger = new ConnectionManger();
            string  QueryForCascading = "SELECT CanteenId, CanteenName FROM Canteen WHERE LocationId = " + ddlLocation.SelectedValue;
            DataSet dataSet           = connectionManger.Fill(QueryForCascading);

            if (dataSet.Tables[0].Rows.Count > 0)
            {
                ddlCanteen.DataSource     = dataSet.Tables[0];
                ddlCanteen.DataTextField  = "CanteenName";
                ddlCanteen.DataValueField = "CanteenId";
                ddlCanteen.DataBind();
                ddlCanteen.Items.Insert(0, "--Select--");
            }
        }
        private void AutoFillLoc()
        {
            connectionManger = new ConnectionManger();
            string  QueryForAutoFillingLoc = "SELECT LocationId, LocationName FROM Location";
            DataSet dataSet = connectionManger.Fill(QueryForAutoFillingLoc);

            if (dataSet.Tables[0].Rows.Count > 0)
            {
                ddlLocation.DataSource     = dataSet.Tables[0];
                ddlLocation.DataTextField  = "LocationName";
                ddlLocation.DataValueField = "LocationId";
                ddlLocation.DataBind();
                //ddlLocation.Items.Insert(0, "--Select--");
            }
        }
        protected void DropDownListCanteen_SelectedIndexChanged(object sender, EventArgs e)
        {
            string QueryForNoOfRequest = "select count(*) as NoOfRequests from Request group by DATEPART(mm, FromDate),LocId,CanteenId having DATEPART(mm, FromDate) =" + ddlMonth.SelectedValue + " and LocId =" + ddlLocation.SelectedValue + " and CanteenId =" + ddlCanteen.SelectedValue;

            connectionManger    = new ConnectionManger();
            txtNoOfRequest.Text = connectionManger.Selection(QueryForNoOfRequest, "RequestId");

            string QueryForNoOfConsumed = "select count(*) as NoOfConsumed from Request R full outer join ServedDetails S on R.RequestId = S.RequestId where S.IfServed = 1 group by DATEPART(mm, R.FromDate) ,LocId,CanteenId having DATEPART(mm, R.FromDate) = " + ddlMonth.SelectedValue + " and LocId =" + ddlLocation.SelectedValue + " and CanteenId =" + ddlCanteen.SelectedValue;

            connectionManger    = new ConnectionManger();
            txtNoOfRequest.Text = connectionManger.Selection(QueryForNoOfConsumed, "RequestId");

            string QueryForNoOfTotalCost = "select SUM(S.Cost) as TotalCost from Request R  full outer join ServedDetails S on R.RequestId = S.RequestId where S.IfServed = 1 group by DATEPART(mm, FromDate) ,LocId,CanteenId having DATEPART(mm, FromDate) =" + ddlMonth.SelectedValue + " and LocId =" + ddlMonth.SelectedValue + " and CanteenId =" + ddlCanteen.SelectedValue;

            connectionManger  = new ConnectionManger();
            txtTotalCost.Text = connectionManger.Selection(QueryForNoOfConsumed, "Cost");
        }
 public RedisSubPub()
 {
     _subscriber = ConnectionManger.GetSubscriber();
 }