hey
when user upload new documents then this document goes for approval to supervisor and for this i use dropdowns ...when i use dropdown the exact result not occur and now i wat to approve/reject through checkboxes
here is code
<table class="CSSTableGenerator" border="0" cellpadding="0" cellspacing="0" id="results">
<asp:Repeater ID="Repeater2" OnItemCommand="Repeater2_ItemCommand"
runat="server" onitemdatabound="Repeater2_ItemDataBound">
<HeaderTemplate>
<tr>
<%-- <td>
DocumentID
</td>--%>
<td>
Document Name
</td>
<td>
File Name
</td>
<td>
Uploaded By
</td>
<td>
Uploaded Date
</td>
<td>
Email
</td>
<td>
Department
</td>
<td>
Status
</td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<asp:HiddenField ID="DocId" runat="server" Value='<%#DataBinder.Eval(Container.DataItem, "DocID")%>' />
<td>
<asp:Label Id="DocName" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "DocumentName")%>'></asp:Label>
</td>
<td>
<asp:Label Id="Uploadfile" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "Uploadfile")%>'></asp:Label>
</td>
<td>
<asp:Label Id="Label1" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "UploadedBy")%>'></asp:Label>
</td>
<td>
<asp:Label Id="UploadedDate" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "UploadedDate")%>'></asp:Label>
</td>
<td>
<asp:Label Id="YourEamil" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "UserEmail")%>'></asp:Label>
</td>
<td>
<asp:Label Id="DepType" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "Department")%>'></asp:Label>
</td>
<td>
<asp:Label ID="lblCountry" runat="server" Text='<%# Eval("ApproveID") %>' Visible = "false" />
<asp:HiddenField ID="hfDepartmentId" runat="server" Value='<%# Eval("ApproveID") %>' />
<asp:DropDownList ID="DropDownList4" runat="server" EnableViewState="true" class="vpb_dropdown1" DataTextField="ApproveType" DataValueField="ApproveID" AutoPostBack="true" OnSelectedIndexChanged="DropDownList4_SelectedIndexChanged">
<asp:ListItem Text="Pending" selected="selected" Value="3"></asp:ListItem>
<asp:ListItem Text="Approve" Value="1"></asp:ListItem>
<asp:ListItem Text="Reject" Value="2"></asp:ListItem>
</asp:DropDownList>
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
</table>
<asp:Label ID="Supvisor" runat="server" Font-Size="Medium" ForeColor="Red" ></asp:Label><br />
<asp:Label ID="Successz" runat="server" Font-Size="Medium" ForeColor="Green" ></asp:Label><br />
<asp:Button ID="Button1" runat="server" class="button1" Text="Submit" onclick="Button1_Click" />
<%-- <asp:Button ID="notic" runat="server" Text="Send" onclick="Button4_Click" /> <br />
--%> <%--<div visible="false" id="hiddenn">
<input class="add_message" type="text" value="type your message" name="add_message"/>
<asp:Button ID="Button2" value="add message" onclick="Button2_Click" runat="server" Text="send ntofica" />--%>
<input type="button" value="add message" /></div>
</div>
</center>
</div>
and code
protected void Button1_Click(object sender, EventArgs e)
{
try
{
string connStr = ConfigurationManager.ConnectionStrings["mydms"].ConnectionString;
SqlConnection mySQLconnection = new SqlConnection(connStr);
string empId = string.Empty;
DataTable dt = new DataTable();
if (mySQLconnection.State == ConnectionState.Closed)
{
mySQLconnection.Open();
for (int i = 0; i < Repeater2.Items.Count; i++)
{
DropDownList DropDownListcontrol = ((DropDownList)Repeater2.Items[i].FindControl("DropDownList4"));
HiddenField DocId = ((HiddenField)Repeater2.Items[i].FindControl("DocId"));
//Label DocId = ((Label)Repeater2.Items[i].FindControl("DocId"));
//Label Label2 = ((Label)Repeater2.Items[i].FindControl("Label2"));
//if (Label2.Text.ToString() != "")
//{
// string emailId = Label2.Text.ToString();
//}
SqlCommand cmd = new SqlCommand("approveddd", mySQLconnection);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@DocID", SqlDbType.Int).Value = Convert.ToInt32((DocId.Value));
cmd.Parameters.Add("@ApproveID", SqlDbType.Int).Value = Convert.ToInt32(DropDownListcontrol.SelectedValue);
cmd.Parameters.Add("@ApproveBy", SqlDbType.VarChar, 50).Value = (Session["Login2"]);
cmd.Parameters.Add("@DesigID", SqlDbType.Int).Value = (Session["UserDesignationID"]);
string DocName = ((Label)Repeater2.Items[i].FindControl("DocName")).Text;
string emailId = ((Label)Repeater2.Items[i].FindControl("YourEamil")).Text;
DropDownList dropdownvalue = ((DropDownList)Repeater2.Items[i].FindControl("DropDownList4"));
string approver = Session["Login2"] != null ? Session["Login2"].ToString() : string.Empty;
string Designationn = Session["UserDesignationID"] != null ? Session["UserDesignationID"].ToString() : string.Empty;
string docname = String.Empty;
string emailID = String.Empty;
string dropdownvalues = String.Empty;
if (Session["Login2"] != null)
{
approver = Session["Login2"].ToString();
}
if (Session["UserDesignationID"] != null)
{
Designationn = Session["UserDesignationID"].ToString();
}
if (DocName.ToString() != "")
{
docname = DocName.ToString();
}
else
{
docname = "Unavailable";
}
if (emailId.ToString() != "")
{
emailID = emailId.ToString();
}
else
{
emailID = "Unavailable";
}
if (dropdownvalue.SelectedItem.ToString() != "")
{
dropdownvalues = dropdownvalue.SelectedItem.ToString();
}
else
{
dropdownvalues = "Unavailable";
}
//SendEmailUsingGmail(docname.ToString(), dropdownvalue.ToString(), emailId.ToString());
//SendEmailUsingGmail(DocName.ToString(), emailId.ToString(), dropdownvalue.ToString());
SendEmailUsingGmail(DocName, emailId, dropdownvalues, approver, Designationn);
cmd.ExecuteNonQuery();
Successz.Text = "Documents Approve and Email Successfully Send To Users";
//UPDATE APPPROVEID IN DOCUMENTINFO TABLE
//DMSLIB.Doc myDoc = new DMSLIB.Doc();
//myDoc.MarkDocAs(Convert.ToInt16(DocId.Text), Convert.ToInt32(DropDownListcontrol.SelectedValue));
}
}
else
{
Supvisor.Text = "Error";
}
if (mySQLconnection.State == ConnectionState.Open)
{
mySQLconnection.Close();
}
}
catch
{
Supvisor.Text = "Already Approved";
}
}
now i want to use checkboxes can any please tell me how i replace dropdown checkboxes in html and also in asp.net