private void bindDiary() { SqlDataAdapter addiary, addiary1; // B7 addiary = new SqlDataAdapter("select DiaryEntry.DiaryNo,DiaryEntry.Diary,DiaryEntry.Status,DiaryEntry.CourierNo as RefNo,DiaryEntry.IMID as Membership from DiaryEntry where SubmittedTo='Project'and Status='ProReceive' and DiaryNo in (select DairyNo from DairyCount where Department='Project') and ExamSession='" + lblHiddenSeason.Text + "'", con); addiary1 = new SqlDataAdapter("select DiaryEntry.DiaryNo,DiaryEntry.Diary,DiaryEntry.Status,DiaryEntry.CourierNo as RefNo,DiaryEntry.IMID as Membership from DiaryEntry where SubmittedTo='Project'and Status='CountDispatch' and DiaryNo in (select DairyNo from DairyCount where Department='Account') and ExamSession='" + lblHiddenSeason.Text + "'", con); DataTable ds = new DataTable(); addiary.Fill(ds); addiary1.Fill(ds); GridDiaryNo.DataSource = ds; GridDiaryNo.DataBind(); //B6 addiary = new SqlDataAdapter("select DairyNo,Status,IMID from DairyCount where DairyNo IN (select Distinct DiaryNo From DiaryEntry where Status='CountDispatch' and ExamSession='" + lblHiddenSeason.Text.ToString() + "') and Department='Project' order by DairyNo desc", con); DataTable dt = new DataTable(); addiary.Fill(dt); GrdCountDispatch.DataSource = dt; GrdCountDispatch.DataBind(); //B8 addiary = new SqlDataAdapter("select Status,DairyNo,IMID,DDRcv,DDSub,ProformaARcv,ProformaASub,ProformaBRcv,ProformaBSub,CurrentDate from Projectcount where Session='" + lblHiddenSeason.Text + "' and dairyNo in(select DiaryNo from DiaryEntry where SubmittedTo='Project') order by DairyNo desc", con); DataTable dt1 = new DataTable(); addiary.Fill(dt1); GridProject.DataSource = dt1; GridProject.DataBind(); }
protected void txtIDIM_TextChanged(object sender, EventArgs e) { lblException.Text = ""; con.Close(); con.Open(); cmd = new SqlCommand(); SqlTransaction sTR; sTR = con.BeginTransaction(); cmd.Connection = con; cmd.Transaction = sTR; try { int i = 0; cmd.CommandText = "select * from IM where ID='" + txtIDIM.Text.ToString() + "'"; reader = cmd.ExecuteReader(); if (reader.Read()) { lblIMName.Text = reader[1].ToString(); lblIMAddress.Text = reader[3].ToString(); lblIMCity.Text = reader["Address2"].ToString() + ", " + reader[4].ToString() + " ,( " + reader[5].ToString() + " )"; lblEnrolment.Text = reader["ID"].ToString(); lblGroupID.Text = reader["GID"].ToString(); btnSubmitAmt.Enabled = true; pnlIMInfo.Visible = true; i += 1; } else { txtIDIM.Text = "Invalid ID"; lblIMAddress.Text = ""; lblIMName.Text = ""; lblIMCity.Text = "Please Insert Valid IM ID."; pnlIMInfo.Visible = false; txtIDIM.Focus(); } reader.Close(); if (i == 1) { // total(txtIDIM.Text, sTR, cmd); txtACNO.Text = ""; lblexceptionDirary.Text = ""; cmd.CommandText = "select DairyCount.DairyNo,DairyCount.IMID,DiaryEntry.MemberType from DairyCount left outer join DiaryEntry on DairyCount.DairyNo=DiaryEntry.DiaryNo where DairyCount.TotalDDRcv > (DairyCount.TotalDDSub+DairyCount.MemberRcv) and DiaryCount.Session='" + lblhiddenSession.Text + "' and DiaryEntry.IMID='" + txtIDIM.Text + "' order by DairyCount.DairyNo desc"; //cmd.CommandText = "select DiaryNo,MembershipNo,MemberType From DiaryEntry where IMID='" + txtIDIM.Text.ToString() + "' and ExamSession='" + lblhiddenSession.Text.ToString() + "' and Status='Open' order by DiaryNo desc"; reader = cmd.ExecuteReader(); GridDiaryNo.DataSource = reader; GridDiaryNo.DataBind(); reader.Close(); reader.Dispose(); sTR.Commit(); } txtACNO.Focus(); } catch (Exception ex) { sTR.Rollback(); } finally { con.Close(); con.Dispose(); } }
private void fillgr() { SqlDataAdapter addiary = new SqlDataAdapter("select DairyNo from DairyCount where MemberRcv>0 and MemberRcv>MemberSub and IMID='" + txtId.Text + "'", con); DataSet ds = new DataSet(); addiary.Fill(ds); if (ds.Tables[0].ToString() != "") { GridDiaryNo.DataSource = ds; GridDiaryNo.DataBind(); } }
private void fillDiary() { SqlDataAdapter addiary = new SqlDataAdapter("select DairyCount.DairyNo,DiaryEntry.IMID,DiaryEntry.MemberType from DairyCount left outer join DiaryEntry on DairyCount.DairyNo=DiaryEntry.DiaryNo where DiaryEntry.ExamSession='" + lblhiddenSession.Text.ToString() + "' and DiaryEntry.Status='Open' and (DairyCount.TotalDDRcv > (DairyCount.TotalDDSub+DairyCount.MemberRcv)) order by DairyCount.DairyNo desc", con); DataSet ds = new DataSet(); addiary.Fill(ds); if (ds.Tables[0].ToString() != "") { GridDiaryNo.DataSource = ds; GridDiaryNo.DataBind(); } }
private void bindDiary() { SqlDataAdapter addiary = new SqlDataAdapter("select Distinct DiaryNo,Diary,Status,CourierNo as RefNo,MembershipNo as Mem_No From DiaryEntry where (Status='CountReceived' OR Status='CountDispatch') and ExamSession='" + lblHiddenSeason.Text + "' order by Diary desc", con); DataSet ds = new DataSet(); addiary.Fill(ds); GridDiaryNo.DataSource = ds; //B3 GridDiaryNo.DataBind(); SqlDataAdapter countdiary = new SqlDataAdapter("select Distinct DiaryNo,Diary,CourierNo as RefNo,MembershipNo as Mem_No From DiaryEntry where Status='DiaryEntry' and ExamSession='" + lblHiddenSeason.Text + "' order by Diary desc", con); DataSet ds1 = new DataSet(); countdiary.Fill(ds1); GrdCountReceived.DataSource = ds1; //B2 GrdCountReceived.DataBind(); }
private void bindDiary() { SqlDataAdapter addiary = new SqlDataAdapter("select Distinct DiaryNo,Diary From DiaryEntry where Status='Open' and ExamSession='" + lblHiddenSeason.Text.ToString() + "' order by Diary desc", con); DataSet ds = new DataSet(); addiary.Fill(ds); if (ds.Tables[0].ToString() != "") { GridDiaryNo.DataSource = ds; GridDiaryNo.DataBind(); } foreach (GridViewRow rw in GridDiaryNo.Rows) { rw.Cells[2].Visible = false; GridDiaryNo.HeaderRow.Cells[2].Visible = false; } }
private void txtIMID() { con.Close(); con.Open(); SqlCommand cmd = new SqlCommand("select ID from IM where ID='" + txtIDIM.Text.ToString() + "'", con); string chk = Convert.ToString(cmd.ExecuteScalar()); int i = 0; if (chk == txtIDIM.Text.ToString()) { i += 1; } else { txtIDIM.Text = "Invalid ID"; lblIMAddress.Text = ""; lblIMName.Text = ""; lblIMCity.Text = "Please Insert Valid IM ID."; pnlIMInfo.Visible = false; txtIDIM.Focus(); } if (i == 1) { cmd = new SqlCommand("select * from IM where ID='" + txtIDIM.Text.ToString() + "'", con); SqlDataReader reader; reader = cmd.ExecuteReader(); while (reader.Read()) { lblIMName.Text = reader[1].ToString(); lblIMAddress.Text = reader[3].ToString(); lblIMCity.Text = reader["Address2"].ToString() + ", " + reader[4].ToString() + " ,( " + reader[5].ToString() + " )"; lblEnrolment.Text = reader["ID"].ToString(); lblGroupID.Text = reader["GID"].ToString(); pnlIMInfo.Visible = true; } reader.Close(); txtDiaryNo.Text = ""; lblexceptionDirary.Text = ""; SqlDataAdapter addiary = new SqlDataAdapter("select Distinct DiaryNo From DiaryEntry where IMID='" + txtIDIM.Text.ToString() + "' and ExamSession='" + lblhiddenSession.Text.ToString() + "' and Status='Open' order by DiaryNo desc", con); DataSet ds = new DataSet(); addiary.Fill(ds); if (ds.Tables[0].ToString() != "") { GridDiaryNo.DataSource = ds; GridDiaryNo.DataBind(); } txtDiaryNo.Focus(); } con.Close(); }
private void bindDiary() { SqlDataAdapter addiary = new SqlDataAdapter("select Distinct DiaryNo,Diary,Status,CourierNo as RefNo,MembershipNo as Membership From DiaryEntry where Status='AccReceive' and ExamSession='" + lblHiddenSeason.Text.ToString() + "' order by Diary desc", con); DataSet ds = new DataSet(); addiary.Fill(ds); if (ds.Tables[0].ToString() != "") { GridDiaryNo.DataSource = ds; GridDiaryNo.DataBind(); } SqlDataAdapter countDispatch = new SqlDataAdapter("select DairyNo,Status,IMID from DairyCount where DairyNo IN (select Distinct DiaryNo From DiaryEntry where Status='CountDispatch' and ExamSession='" + lblHiddenSeason.Text.ToString() + "') order by DairyNo desc ", con); DataSet ds1 = new DataSet(); countDispatch.Fill(ds1); if (ds1.Tables[0].ToString() != "") { GrdCountDispatch.DataSource = ds1; GrdCountDispatch.DataBind(); } }