예제 #1
0
        protected void btnSaveEditEquipment_Click(object sender, EventArgs e)
        {
            eResult = eResult.getEquipItem(txtEditEquipID.Text);
            if (ddlEditEquipNameType.SelectedValue!=null)
            {
                eResult.equipment.ItemID = ddlEditEquipNameType.SelectedIndex;
            }

            eResult.equipment.ItemType = ddlEditEquipNameType.SelectedItem.Text;
            //eResult.equipment.Description=txtEditEquipDescription.Text;
            eResult.equipment.LocationID = ddlEditLocation.SelectedIndex;
            //eResult.equipment.InstallDate=txtEditInstallDate.Text;
            eResult.equipment.FarFoxVAlue=double.Parse(txtEditFValue.Text);
            eResult.equipment.ClientValue=double.Parse(txtEditCValue.Text);
            eResult.equipment.LocationName= ddlEditLocation.SelectedItem.Text;
            eResult.UpdateTableEQ();
            //gvEquipment.DataBind();
            //myDal.AddParam("EquipmentID", txtEquipID.Text);
            //myDal.AddParam("Description", txtEditEquipDescription.Text);
            //myDal.AddParam("InstallDate", txtEditInstallDate.Text);
            //myDal.AddParam("ItemType", txtEditEquipNameType.Text);

            //myDal.ExecuteProcedure("spUpdateEQuipmentInfo");
            LoadGVEquipments();
            //gvEquipment.DataBind();
            pnlEditEquipment.Visible = false;
        }
예제 #2
0
 private void LoadGVEquipments()
 {
     Equipment getEQ = new Equipment();
     getEQ.getEQResult();
     gvEquipment.DataSource = getEQ.EquipList;
     gvEquipment.DataBind();
 }
예제 #3
0
        protected void gvEquipment_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "EditRow")
            {
                int rowID = Convert.ToInt32(e.CommandArgument);
                gvEquipment.SelectedIndex = rowID;
                string EquipmentID = gvEquipment.SelectedDataKey.Value.ToString();
                string cmd = e.CommandName;

                switch (cmd)
                {
                    case "EditRow":
                        pnlEditEquipment.Visible = true;

                        eResult = eResult.getEquipItem(EquipmentID);

                        PopulateEQEditControls();
                        break;
                }
            }
            pnlEquip.Visible = false;
            //LoadGVEquipments();
        }
예제 #4
0
 public Equipment(Equipment equipment)
 {
     this.equipment = equipment;
 }
예제 #5
0
 public Equipment getEquipItem(string eqID)
 {
     getEQResult();
     Equipment result = new Equipment(EquipList.Find(x => x.EquipmentID == Convert.ToInt32(eqID)));
     return result;
 }
예제 #6
0
 public void getEQResult()
 {
     dsResult = myDal.ExecuteProcedure("spGetEquipmentInfo");
     EquipList = new List<Equipment>();
     DataSet ds = dsResult;
     foreach (DataRow dr in ds.Tables[0].Rows)
     {
         Equipment e = new Equipment(
             int.Parse(dr["EquipmentID"].ToString()),
             int.Parse(dr["ItemID"].ToString()),
             dr["ItemType"].ToString(),
             //dr["Description"].ToString(),
             //int.Parse(dr["LocationID"].ToString()),
             //dr["LocationName"].ToString(),
             //dr["InstallDate"].ToString(),
             double.Parse(dr["FarFoxValue"].ToString()),
             double.Parse(dr["ClientValue"].ToString())
             );
         EquipList.Add(e);
     }
     EquipList.ToList();
 }