//IF EXISTS(
        //SELECT [Line]
        //        FROM [IMES_GetData_Datamaintain].[dbo].[Line]
        //where [Line]='line'
        //)
        //set @return='True'
        //ELSE
        //set @return='False'
        //Boolean IsExistLine(string line);

        public void AddLine(FailKPCollectionInfo item)
        {
            try
            {
                iPartRepository.AddFailKPCollection(item);
            }
            catch (Exception)
            {
                throw;
            }
        }
    protected void btnSave_ServerClick(Object sender, EventArgs e)
    {
        string id = this.hidId.Value.Trim();
        FailKPCollectionInfo items = new FailKPCollectionInfo();
        try
        {
            items.Family = this.cmbFamily.SelectedValue.ToString();
            items.PdLine = this.cmbPdLine.SelectedValue.ToString();
            items.PartName = this.cmbPartName.SelectedValue.ToString();
            items.PartNo = this.txtPartNO.Text.ToString();
            items.Vendor = this.cmbVendor.SelectedValue.ToString();
            items.Module = this.cmbModuleNo.SelectedValue.ToString();
            items.FailReason = this.cmbFailReason.SelectedValue.ToString();
            items.Qty = Convert.ToInt32( this.txtQty.Text.ToString());
            items.Remark = this.txtRemark.Text.ToString();
            items.Editor = userName.ToString();
            if (id == "" || id == null)
            {
                items.Date = Convert.ToDateTime( this.hidshipdate.Value.ToString());
                iKeyPartDefectCollection.AddLine(items);
            }
            else
            {
                items.ID =Convert.ToInt32(id);
                items.Date = Convert.ToDateTime(this.hidselecttimeforsave.Value.ToString());
                iKeyPartDefectCollection.UpdateLine(items);
            }
        }
        catch (FisException ex)
        {
            showErrorMessage(ex.mErrmsg);
            return;
        }
        catch (Exception ex)
        {
            showErrorMessage(ex.Message);
            return;
        }
        ShowRunInTimeControlList();
        this.UpdatePanel1.Update();
        ScriptManager.RegisterStartupScript(this.updatePanelAll, typeof(System.Object), "Update", "resetTableHeight();", true);

    }
 public IList<int> ExistInFailKPCollection(FailKPCollectionInfo item)
 {
     try
     {
         return iPartRepository.ExistInFailKPCollection(item);
     }
     catch (Exception)
     {
         throw;
     }
 }