public static ADLHeaderDetailnDateTime GetADLHeaderDetailnDateTimeByID(int id) { ADLHeaderDetailnDateTime aDLHeaderDetailnDateTime = new ADLHeaderDetailnDateTime(); SqlADLHeaderDetailnDateTimeProvider sqlADLHeaderDetailnDateTimeProvider = new SqlADLHeaderDetailnDateTimeProvider(); aDLHeaderDetailnDateTime = sqlADLHeaderDetailnDateTimeProvider.GetADLHeaderDetailnDateTimeByID(id); return aDLHeaderDetailnDateTime; }
public static ADLHeaderDetailnDateTime GetADLHeaderDetailnDateTimeByID(int id) { ADLHeaderDetailnDateTime aDLHeaderDetailnDateTime = new ADLHeaderDetailnDateTime(); SqlADLHeaderDetailnDateTimeProvider sqlADLHeaderDetailnDateTimeProvider = new SqlADLHeaderDetailnDateTimeProvider(); aDLHeaderDetailnDateTime = sqlADLHeaderDetailnDateTimeProvider.GetADLHeaderDetailnDateTimeByID(id); return(aDLHeaderDetailnDateTime); }
private void showADLHeaderDetailnDateTimeData() { ADLHeaderDetailnDateTime aDLHeaderDetailnDateTime = new ADLHeaderDetailnDateTime(); aDLHeaderDetailnDateTime = ADLHeaderDetailnDateTimeManager.GetADLHeaderDetailnDateTimeByID(Int32.Parse(Request.QueryString["aDLHeaderDetailnDateTimeID"])); ddlADLDateTime.SelectedValue = aDLHeaderDetailnDateTime.ADLDateTimeID.ToString(); ddlADLHeaderDetail.SelectedValue = aDLHeaderDetailnDateTime.ADLHeaderDetailID.ToString(); ddlADLHeaderDetail.SelectedValue = aDLHeaderDetailnDateTime.ADLHeaderDetailID.ToString(); txtExtraField1.Text = aDLHeaderDetailnDateTime.ExtraField1; txtExtraField2.Text = aDLHeaderDetailnDateTime.ExtraField2; txtExtraField3.Text = aDLHeaderDetailnDateTime.ExtraField3; txtExtraField4.Text = aDLHeaderDetailnDateTime.ExtraField4; txtExtraField5.Text = aDLHeaderDetailnDateTime.ExtraField5; }
protected void btnAdd_Click(object sender, EventArgs e) { ADLHeaderDetailnDateTime aDLHeaderDetailnDateTime = new ADLHeaderDetailnDateTime(); aDLHeaderDetailnDateTime.ADLDateTimeID = Int32.Parse(ddlADLDateTime.SelectedValue); aDLHeaderDetailnDateTime.ADLHeaderDetailID = Int32.Parse(ddlADLHeaderDetail.SelectedValue); aDLHeaderDetailnDateTime.ADLHeaderDetailID = Int32.Parse(ddlADLHeaderDetail.SelectedValue); aDLHeaderDetailnDateTime.ExtraField1 = txtExtraField1.Text; aDLHeaderDetailnDateTime.ExtraField2 = txtExtraField2.Text; aDLHeaderDetailnDateTime.ExtraField3 = txtExtraField3.Text; aDLHeaderDetailnDateTime.ExtraField4 = txtExtraField4.Text; aDLHeaderDetailnDateTime.ExtraField5 = txtExtraField5.Text; int resutl = ADLHeaderDetailnDateTimeManager.InsertADLHeaderDetailnDateTime(aDLHeaderDetailnDateTime); Response.Redirect("AdminADLHeaderDetailnDateTimeDisplay.aspx"); }
public bool UpdateADLHeaderDetailnDateTime(ADLHeaderDetailnDateTime aDLHeaderDetailnDateTime) { using (SqlConnection connection = new SqlConnection(this.ConnectionString)) { SqlCommand cmd = new SqlCommand("AL_UpdateADLHeaderDetailnDateTime", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@ADLHeaderDetailnDateTimeID", SqlDbType.Int).Value = aDLHeaderDetailnDateTime.ADLHeaderDetailnDateTimeID; cmd.Parameters.Add("@ADLDateTimeID", SqlDbType.DateTime).Value = aDLHeaderDetailnDateTime.ADLDateTimeID; cmd.Parameters.Add("@ADLHeaderDetailID", SqlDbType.Int).Value = aDLHeaderDetailnDateTime.ADLHeaderDetailID; cmd.Parameters.Add("@ExtraField1", SqlDbType.NVarChar).Value = aDLHeaderDetailnDateTime.ExtraField1; cmd.Parameters.Add("@ExtraField2", SqlDbType.NVarChar).Value = aDLHeaderDetailnDateTime.ExtraField2; cmd.Parameters.Add("@ExtraField3", SqlDbType.NVarChar).Value = aDLHeaderDetailnDateTime.ExtraField3; cmd.Parameters.Add("@ExtraField4", SqlDbType.NVarChar).Value = aDLHeaderDetailnDateTime.ExtraField4; cmd.Parameters.Add("@ExtraField5", SqlDbType.NVarChar).Value = aDLHeaderDetailnDateTime.ExtraField5; connection.Open(); int result = cmd.ExecuteNonQuery(); return(result == 1); } }
protected void btnUpdate_Click(object sender, EventArgs e) { ADLHeaderDetailnDateTime aDLHeaderDetailnDateTime = new ADLHeaderDetailnDateTime(); aDLHeaderDetailnDateTime = ADLHeaderDetailnDateTimeManager.GetADLHeaderDetailnDateTimeByID(Int32.Parse(Request.QueryString["aDLHeaderDetailnDateTimeID"])); ADLHeaderDetailnDateTime tempADLHeaderDetailnDateTime = new ADLHeaderDetailnDateTime(); tempADLHeaderDetailnDateTime.ADLHeaderDetailnDateTimeID = aDLHeaderDetailnDateTime.ADLHeaderDetailnDateTimeID; tempADLHeaderDetailnDateTime.ADLDateTimeID = Int32.Parse(ddlADLDateTime.SelectedValue); tempADLHeaderDetailnDateTime.ADLHeaderDetailID = Int32.Parse(ddlADLHeaderDetail.SelectedValue); tempADLHeaderDetailnDateTime.ADLHeaderDetailID = Int32.Parse(ddlADLHeaderDetail.SelectedValue); tempADLHeaderDetailnDateTime.ExtraField1 = txtExtraField1.Text; tempADLHeaderDetailnDateTime.ExtraField2 = txtExtraField2.Text; tempADLHeaderDetailnDateTime.ExtraField3 = txtExtraField3.Text; tempADLHeaderDetailnDateTime.ExtraField4 = txtExtraField4.Text; tempADLHeaderDetailnDateTime.ExtraField5 = txtExtraField5.Text; bool result = ADLHeaderDetailnDateTimeManager.UpdateADLHeaderDetailnDateTime(tempADLHeaderDetailnDateTime); Response.Redirect("AdminADLHeaderDetailnDateTimeDisplay.aspx"); }
public ADLHeaderDetailnDateTime GetADLHeaderDetailnDateTimeFromReader(IDataReader reader) { try { ADLHeaderDetailnDateTime aDLHeaderDetailnDateTime = new ADLHeaderDetailnDateTime ( (int)reader["ADLHeaderDetailnDateTimeID"], (int)reader["ADLDateTimeID"], (int)reader["ADLHeaderDetailID"], reader["ExtraField1"].ToString(), reader["ExtraField2"].ToString(), reader["ExtraField3"].ToString(), reader["ExtraField4"].ToString(), reader["ExtraField5"].ToString() ); return(aDLHeaderDetailnDateTime); } catch (Exception ex) { return(null); } }
public static bool UpdateADLHeaderDetailnDateTime(ADLHeaderDetailnDateTime aDLHeaderDetailnDateTime) { SqlADLHeaderDetailnDateTimeProvider sqlADLHeaderDetailnDateTimeProvider = new SqlADLHeaderDetailnDateTimeProvider(); return sqlADLHeaderDetailnDateTimeProvider.UpdateADLHeaderDetailnDateTime(aDLHeaderDetailnDateTime); }
public static int InsertADLHeaderDetailnDateTime(ADLHeaderDetailnDateTime aDLHeaderDetailnDateTime) { SqlADLHeaderDetailnDateTimeProvider sqlADLHeaderDetailnDateTimeProvider = new SqlADLHeaderDetailnDateTimeProvider(); return sqlADLHeaderDetailnDateTimeProvider.InsertADLHeaderDetailnDateTime(aDLHeaderDetailnDateTime); }
protected void btnSave_Click(object sender, EventArgs e) { lblMsg.Visible = true; int ADLDateTimeID = 0; if (ddlExistingRecord.SelectedValue == "0") { ADLDateTime aDLDateTime = new ADLDateTime(); aDLDateTime.ADLDateTimeValue = DateTime.Now; ADLDateTimeID = ADLDateTimeManager.InsertADLDateTime(aDLDateTime); } else { ADLDateTimeID = int.Parse(ddlExistingRecord.SelectedValue); ADLHeaderDetailnDateTimeManager.DeleteADLHeaderDetailnDateTimeByADLDateTimeID(ADLDateTimeID); } foreach (GridViewRow gvr in gvHeader.Rows) { HiddenField hfADLHeaderID = (HiddenField)gvr.FindControl("hfADLHeaderID"); GridView gvDetail = (GridView)gvr.FindControl("gvDetail"); foreach (GridViewRow gvrDetail in gvDetail.Rows) { HiddenField hfADLHeaderDetialID = (HiddenField)gvrDetail.FindControl("hfADLHeaderDetialID"); TextBox txtNewStatus = (TextBox)gvrDetail.FindControl("txtNewStatus"); TextBox txtRemark = (TextBox)gvrDetail.FindControl("txtRemark"); DropDownList ddlADLStatusInGrid = (DropDownList)gvrDetail.FindControl("ddlADLStatusInGrid"); RadioButtonList rbtnlADLStatusInGrid = (RadioButtonList)gvrDetail.FindControl("rbtnlADLStatusInGrid"); //if (txtNewStatus.Text != "" || ddlADLStatusInGrid.SelectedValue != "0") try { ADLHeaderDetailnDateTime aDLHeaderDetailnDateTime = new ADLHeaderDetailnDateTime(); aDLHeaderDetailnDateTime.ADLDateTimeID = ADLDateTimeID; aDLHeaderDetailnDateTime.ADLHeaderDetailID = Int32.Parse(hfADLHeaderDetialID.Value); aDLHeaderDetailnDateTime.ExtraField1 = (txtNewStatus.Text == "" ? rbtnlADLStatusInGrid.SelectedValue : txtNewStatus.Text); aDLHeaderDetailnDateTime.ExtraField2 = getLogin().ExtraField4; aDLHeaderDetailnDateTime.ExtraField3 = txtRemark.Text; aDLHeaderDetailnDateTime.ExtraField4 = getLogin().LoginID.ToString(); aDLHeaderDetailnDateTime.ExtraField5 = ""; int resutl = ADLHeaderDetailnDateTimeManager.InsertADLHeaderDetailnDateTime(aDLHeaderDetailnDateTime); } catch (Exception ex) { } } } loadMedicineTimenDateDate(); foreach (GridViewRow gvr in gvHeader.Rows) { HiddenField hfADLHeaderID = (HiddenField)gvr.FindControl("hfADLHeaderID"); GridView gvDetail = (GridView)gvr.FindControl("gvDetail"); foreach (GridViewRow gvrDetail in gvDetail.Rows) { HiddenField hfADLHeaderDetialID = (HiddenField)gvrDetail.FindControl("hfADLHeaderDetialID"); TextBox txtNewStatus = (TextBox)gvrDetail.FindControl("txtNewStatus"); TextBox txtRemark = (TextBox)gvrDetail.FindControl("txtRemark"); DropDownList ddlADLStatusInGrid = (DropDownList)gvrDetail.FindControl("ddlADLStatusInGrid"); RadioButtonList rbtnlADLStatusInGrid = (RadioButtonList)gvrDetail.FindControl("rbtnlADLStatusInGrid"); txtRemark.Text = ""; rbtnlADLStatusInGrid.SelectedIndex = -1; } } }
public static bool UpdateADLHeaderDetailnDateTime(ADLHeaderDetailnDateTime aDLHeaderDetailnDateTime) { SqlADLHeaderDetailnDateTimeProvider sqlADLHeaderDetailnDateTimeProvider = new SqlADLHeaderDetailnDateTimeProvider(); return(sqlADLHeaderDetailnDateTimeProvider.UpdateADLHeaderDetailnDateTime(aDLHeaderDetailnDateTime)); }
public static int InsertADLHeaderDetailnDateTime(ADLHeaderDetailnDateTime aDLHeaderDetailnDateTime) { SqlADLHeaderDetailnDateTimeProvider sqlADLHeaderDetailnDateTimeProvider = new SqlADLHeaderDetailnDateTimeProvider(); return(sqlADLHeaderDetailnDateTimeProvider.InsertADLHeaderDetailnDateTime(aDLHeaderDetailnDateTime)); }
public ADLHeaderDetailnDateTime GetADLHeaderDetailnDateTimeFromReader(IDataReader reader) { try { ADLHeaderDetailnDateTime aDLHeaderDetailnDateTime = new ADLHeaderDetailnDateTime ( (int)reader["ADLHeaderDetailnDateTimeID"], (int)reader["ADLDateTimeID"], (int)reader["ADLHeaderDetailID"], reader["ExtraField1"].ToString(), reader["ExtraField2"].ToString(), reader["ExtraField3"].ToString(), reader["ExtraField4"].ToString(), reader["ExtraField5"].ToString() ); return aDLHeaderDetailnDateTime; } catch(Exception ex) { return null; } }
public bool UpdateADLHeaderDetailnDateTime(ADLHeaderDetailnDateTime aDLHeaderDetailnDateTime) { using (SqlConnection connection = new SqlConnection(this.ConnectionString)) { SqlCommand cmd = new SqlCommand("AL_UpdateADLHeaderDetailnDateTime", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@ADLHeaderDetailnDateTimeID", SqlDbType.Int).Value = aDLHeaderDetailnDateTime.ADLHeaderDetailnDateTimeID; cmd.Parameters.Add("@ADLDateTimeID", SqlDbType.DateTime).Value = aDLHeaderDetailnDateTime.ADLDateTimeID; cmd.Parameters.Add("@ADLHeaderDetailID", SqlDbType.Int).Value = aDLHeaderDetailnDateTime.ADLHeaderDetailID; cmd.Parameters.Add("@ExtraField1", SqlDbType.NVarChar).Value = aDLHeaderDetailnDateTime.ExtraField1; cmd.Parameters.Add("@ExtraField2", SqlDbType.NVarChar).Value = aDLHeaderDetailnDateTime.ExtraField2; cmd.Parameters.Add("@ExtraField3", SqlDbType.NVarChar).Value = aDLHeaderDetailnDateTime.ExtraField3; cmd.Parameters.Add("@ExtraField4", SqlDbType.NVarChar).Value = aDLHeaderDetailnDateTime.ExtraField4; cmd.Parameters.Add("@ExtraField5", SqlDbType.NVarChar).Value = aDLHeaderDetailnDateTime.ExtraField5; connection.Open(); int result = cmd.ExecuteNonQuery(); return result == 1; } }