Пример #1
0
        private void InvoiceForm_Load(object sender, EventArgs e)
        {
            APCContext = new APCEntities();

            List <Project> projectList = BLProject.GetAllProject(APCContext);

            ddlProject.DataSource    = projectList;
            ddlProject.DisplayMember = "Name";
            ddlProject.ValueMember   = "Id";

            dgInvoiceProduct.AutoGenerateColumns = false;
            dgInvoiceProduct.DataSource          = createInvoiceProductTable();
            //dgInvoiceProduct.Columns.Remove("Name");
            //dgInvoiceProduct.Columns.Remove("Kurs");
            //dgInvoiceProduct.Columns.Remove("SubCon");

            DataGridViewComboBoxColumn colName = BLHelper.ReturnDataGridComboBoxColumn("Name", "Name", "Name", "Name");

            colName.AutoSizeMode = DataGridViewAutoSizeColumnMode.NotSet;
            colName.DataSource   = APCContext.Category;

            DataGridViewComboBoxColumn colKurs = BLHelper.ReturnDataGridComboBoxColumn("Name", "Name", "Name", "Name");

            colName.AutoSizeMode = DataGridViewAutoSizeColumnMode.NotSet;
            colKurs.DataSource   = APCContext.Kurs;

            DataGridViewCheckBoxColumn colSubCon = BLHelper.ReturnDataGridCBColumn("SubCon");

            //dgInvoiceProduct.Columns.Insert(0, colName);
            //dgInvoiceProduct.Columns.Insert(5, colKurs);
            dgInvoiceProduct.Columns.Add(colName);
            dgInvoiceProduct.Columns.Add(colKurs);
            dgInvoiceProduct.Columns.Add(colSubCon);
        }
Пример #2
0
 public HttpResponseMessage GET()
 {
     try
     {
         var entity = obj.GetAllProject();
         if (entity != null)
         {
             return(Request.CreateResponse(HttpStatusCode.OK, entity));
         }
         else
         {
             return(Request.CreateResponse(HttpStatusCode.NotFound, "No record found"));
         }
     }
     catch (Exception ex)
     {
         return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ex));
     }
 }