public bool dInsertUpdateStabilityCheck(StabilityCheck o) { string strQuery = "dbo.sprAddUpdStabilityCheck"; SqlCommand cmd = new SqlCommand(strQuery); cmd.Parameters.Add("@Id", SqlDbType.Int).Value = o.Id; cmd.Parameters.Add("@BatchId", SqlDbType.Int).Value = o.BatchId; cmd.Parameters.Add("@ChamberId", SqlDbType.Int).Value = o.ChamberId; cmd.Parameters.Add("@StudyReason", SqlDbType.NVarChar).Value = o.StudyReason; cmd.Parameters.Add("@ProtocolNo", SqlDbType.NVarChar).Value = o.ProtocolNo; cmd.Parameters.Add("@Remark", SqlDbType.NVarChar).Value = o.Remark; cmd.Parameters.Add("@M1", SqlDbType.Date).Value = o.M1; cmd.Parameters.Add("@M2", SqlDbType.Date).Value = o.M2; cmd.Parameters.Add("@M3", SqlDbType.Date).Value = o.M3; cmd.Parameters.Add("@M6", SqlDbType.Date).Value = o.M6; cmd.Parameters.Add("@M9", SqlDbType.Date).Value = o.M9; cmd.Parameters.Add("@M12", SqlDbType.Date).Value = o.M12; cmd.Parameters.Add("@M18", SqlDbType.Date).Value = o.M18; cmd.Parameters.Add("@M24", SqlDbType.Date).Value = o.M24; cmd.Parameters.Add("@M30", SqlDbType.Date).Value = o.M30; cmd.Parameters.Add("@M36", SqlDbType.Date).Value = o.M36; cmd.Parameters.Add("@M42", SqlDbType.Date).Value = o.M42; cmd.Parameters.Add("@M48", SqlDbType.Date).Value = o.M48; cmd.Parameters.Add("@M60", SqlDbType.Date).Value = o.M60; cmd.Parameters.Add("@M72", SqlDbType.Date).Value = o.M72; return(DMLCommand(cmd)); }
private void gridStabilityCheck_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { StabilityCheck op = new StabilityCheck(); if (gridStabilityCheck.SelectedCells.Count > 0) { int index = gridStabilityCheck.SelectedCells[0].RowIndex; DataGridViewRow s = gridStabilityCheck.Rows[index]; op.Id = Convert.ToInt32(s.Cells["Id"].Value); op.BatchId = Convert.ToInt32(s.Cells["BatchId"].Value); op.ChamberId = Convert.ToInt32(s.Cells["ChamberId"].Value); op.ProductId = Convert.ToInt32(s.Cells["ProductId"].Value); op.StudyReason = s.Cells["StudyReason"].Value.ToString(); op.ProtocolNo = s.Cells["ProtocolNo"].Value.ToString(); op.Remark = s.Cells["Remark"].Value.ToString(); op.M1 = s.Cells["M1"].Value.ToString(); op.M2 = s.Cells["M2"].Value.ToString(); op.M3 = s.Cells["M3"].Value.ToString(); op.M6 = s.Cells["M6"].Value.ToString(); op.M9 = s.Cells["M9"].Value.ToString(); op.M12 = s.Cells["M12"].Value.ToString(); op.M18 = s.Cells["M18"].Value.ToString(); op.M24 = s.Cells["M24"].Value.ToString(); op.M30 = s.Cells["M30"].Value.ToString(); op.M36 = s.Cells["M36"].Value.ToString(); op.M42 = s.Cells["M42"].Value.ToString(); op.M48 = s.Cells["M48"].Value.ToString(); op.M60 = s.Cells["M60"].Value.ToString(); op.M72 = s.Cells["M72"].Value.ToString(); } frmStabilityCheck p = new frmStabilityCheck(op); p.ShowDialog(); }
private void txtSave_Click(object sender, System.EventArgs e) { StabilityCheck o = new StabilityCheck(); o.Id = Id; o.BatchId = int.Parse(ddlBatch.SelectedValue.ToString()); o.ChamberId = int.Parse(ddlChamber.SelectedValue.ToString()); o.ProtocolNo = txtProtocolNo.Text; o.StudyReason = txtStudyReason.Text; o.Remark = txtRemark.Text; o.M1 = txt1M.Text; o.M2 = txt2M.Text; o.M3 = txt3M.Text; o.M6 = txt6M.Text; o.M9 = txt9M.Text; o.M12 = txt12M.Text; o.M18 = txt18M.Text; o.M24 = txt24M.Text; o.M30 = txt30M.Text; o.M36 = txt36M.Text; o.M42 = txt42M.Text; o.M48 = txt48M.Text; o.M60 = txt60M.Text; o.M72 = txt72M.Text; if (!oB.bInsertUpdateStabilityCheck(o)) { MetroMessageBox.Show(this, "Stability check for this batch/chamber is already added."); } this.Close(); }
public frmStabilityCheck(StabilityCheck o) { oB = new BAL(); InitializeComponent(); BindDD(); Id = o.Id; ddlProduct.SelectedValue = o.ProductId; txtProtocolNo.Text = o.ProtocolNo; txtStudyReason.Text = o.StudyReason; txtRemark.Text = o.Remark; txt1M.Text = o.M1; txt2M.Text = o.M2; txt3M.Text = o.M3; txt6M.Text = o.M6; txt9M.Text = o.M9; txt12M.Text = o.M12; txt18M.Text = o.M18; txt24M.Text = o.M24; txt30M.Text = o.M30; txt36M.Text = o.M36; txt42M.Text = o.M42; txt48M.Text = o.M48; txt60M.Text = o.M60; txt72M.Text = o.M72; ddlBatch.SelectedValue = o.BatchId; ddlChamber.SelectedValue = o.ChamberId; }
public List <StabilityCheck> bGetStabilityCheck(int id) { List <StabilityCheck> objListStabilityCheck = new List <StabilityCheck>(); DataSet ds = oD.dGetStabilityCheck(id); if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { foreach (DataRow Row in ds.Tables[0].Rows) // Loop over the rows. { StabilityCheck ob = new StabilityCheck(); ob.Id = Convert.ToInt16(Row["Id"]); ob.BatchId = Convert.ToInt16(Row["BatchId"]); ob.ChamberId = Convert.ToInt16(Row["ChamberId"]); ob.ProductId = Convert.ToInt16(Row["ProductId"]); ob.BatchNo = Row["BatchNo"].ToString(); ob.ChamberName = Row["ChamberName"].ToString(); ob.StudyReason = Row["StudyReason"].ToString(); ob.ProtocolNo = Row["ProtocolNo"].ToString(); ob.Remark = Row["Remark"].ToString(); ob.M1 = FormatDate(Row["M1"].ToString()); ob.M2 = FormatDate(Row["M2"].ToString()); ob.M3 = FormatDate(Row["M3"].ToString()); ob.M6 = FormatDate(Row["M6"].ToString()); ob.M9 = FormatDate(Row["M9"].ToString()); ob.M12 = FormatDate(Row["M12"].ToString()); ob.M18 = FormatDate(Row["M18"].ToString()); ob.M24 = FormatDate(Row["M24"].ToString()); ob.M30 = FormatDate(Row["M30"].ToString()); ob.M36 = FormatDate(Row["M36"].ToString()); ob.M42 = FormatDate(Row["M42"].ToString()); ob.M48 = FormatDate(Row["M48"].ToString()); ob.M60 = FormatDate(Row["M60"].ToString()); ob.M72 = FormatDate(Row["M72"].ToString()); objListStabilityCheck.Add(ob); } } return(objListStabilityCheck); }
public bool bInsertUpdateStabilityCheck(StabilityCheck o) { return(oD.dInsertUpdateStabilityCheck(o)); }