public void fnOffersOpprortunityCount() { clsProjects clsPObj = new clsProjects(); int iOfferCount = 0; int iOpportunityCount = clsPObj.fnGetOpportunityCount(Common.iProjectID, Common.iUserID, ref iOfferCount); lblOpportunities.Text = "Opportunities : : " + iOpportunityCount.ToString(); lblOffers.Text = "Offers : : " + iOfferCount.ToString(); }
private void fnMapProjectDetails() { if (Common.iProjectID != 0) { clsProjects clsPObj = new clsProjects(); DataTable dt = clsPObj.fnGetProjectDetails(Common.iProjectID); if (dt.Rows.Count > 0) { lblCreatedBy.Text = "Created By : " + dt.Rows[0]["UName"]; lblProjectName.Text = "Project Name : " + dt.Rows[0]["Name"]; lblCreatedDate.Text = "Created On : " + dt.Rows[0]["CREATEDON"]; } } else { fnShowProjects(false); } }
protected void Page_Load(object sender, EventArgs e) { //redirect to the main page if (clsSmallItemsHandler.SessionIdIsSet == false) { Response.Redirect("/"); } //end clsAuthentication authclass = new clsAuthentication(); clsProjects projects = new clsProjects(); var id = Request.QueryString["id"] == null?"" : Request.QueryString["id"]; var decoded_id = authclass.DecryptString(id); //var session = HttpContext.Current.Session["user_id"]; //clsPrivateChat privateChat = new clsPrivateChat(session); if (Request.Params["user_id"] != null) { var name = Request.Params["user_name"]; var user_id = Request.Params["user_id"]; var project_id = Request.Params["course_id"]; var time = Request.Params["time"].ToString().Replace("_", " "); var message = Request.Params["message"]; projects.InsertMessage(name, user_id, project_id, time, message); } // undone there is an error on the line below course_list = projects.current_project_chats(decoded_id); user_id = HttpContext.Current.Session["user_id"]; user_name = HttpContext.Current.Session["user_name"]; }
protected void Page_Load(object sender, EventArgs e) { var project_id = Request.Params["id"]; var type = Request.Params["type"]; //undone there is an error and exception on this variable // var session = clsSmallItemsHandler.GetSessionId; clsProjects project = new clsProjects(); if (type == "send-likes") { // undone this line gives an error //project.checkLikes(project_id, session); return; } if (type == "get-likes") { //return JSON Response.ContentType = "application/json; charset=utf-8"; // Response.Write("{'likes':" + project.getLikes(project_id) + "}"); Response.End(); } }
protected void Page_Load(object sender, EventArgs e) { //redirect to the main page if (clsSmallItemsHandler.SessionIdIsSet == false) { Response.Redirect("/"); } //end var session = HttpContext.Current.Session["user_id"]; clsGroupChat groupChat = new clsGroupChat(session); ///group chat clsPrivateChat privateChat = new clsPrivateChat(session); //private clsProjects projects = new clsProjects(); var javaScriptSerializer = new JavaScriptSerializer(); var course_id = Request.Params["course_id"]; var messageLimit = Request.Params["limit"]; var token = Request.Params["token"]; if (Request.Params["reset_group_notification"] != null) { groupChat.resetNotification(course_id); } else if (Request.Params["get_group_notification"] != null) { var notification = groupChat.current_user_Notification(course_id); //OBJECT -> JSON string myObjectJson = javaScriptSerializer.Serialize(notification); //return JSON Response.Clear(); Response.ContentType = "application/json; charset=utf-8"; Response.Write(myObjectJson); Response.End(); } else if (token == "get_group_messages") { var messages = groupChat.FetchMesssges(course_id, messageLimit); //OBJECT -> JSON string myObjectJson = javaScriptSerializer.Serialize(messages); //return JSON Response.Clear(); Response.ContentType = "application/json; charset=utf-8"; Response.Write(myObjectJson); Response.End(); } else if (token == "get_comment_messages") { var project_id = course_id; var messages = projects.FetchMesssges(project_id, messageLimit); //OBJECT -> JSON string myObjectJson = javaScriptSerializer.Serialize(messages); //return JSON Response.Clear(); Response.ContentType = "application/json; charset=utf-8"; Response.Write(myObjectJson); Response.End(); } else if (Request.Params["reset_group_notification"] != null) { privateChat.resetNotification(course_id); } else if (Request.Params["get_private_notification"] != null) { var notification = privateChat.Current_user_Notification(course_id); //OBJECT -> JSON string myObjectJson = javaScriptSerializer.Serialize(notification); //return JSON Response.Clear(); Response.ContentType = "application/json; charset=utf-8"; Response.Write(myObjectJson); Response.End(); } else if (token == "get_private_messages") { var messages = privateChat.FetchMesssges(course_id, messageLimit); //OBJECT -> JSON string myObjectJson = javaScriptSerializer.Serialize(messages); //return JSON Response.Clear(); Response.ContentType = "application/json; charset=utf-8"; Response.Write(myObjectJson); Response.End(); } }
private void tsbSave_Click(object sender, EventArgs e) { if (txtID.Text.Trim() == string.Empty) { MessageBox.Show("Project id cannot be empty."); txtID.Focus(); return; } if (txtName.Text.Trim() == "") { MessageBox.Show("Project name cannot be empty."); txtName.Focus(); return; } if (txtCurrentNumber.Text == "") { MessageBox.Show("Current number cannot be empty."); txtCurrentNumber.Focus(); return; } if (txtPrefix.Text == "") { MessageBox.Show("Prefix cannot be empty."); txtPrefix.Focus(); return; } foreach (DataGridViewRow dgr in dgList.Rows) { if (dgr.Cells["ProjectID"].Value.ToString().Trim().ToUpper() == txtID.Text.Trim().ToUpper() && this.id != Convert.ToInt32(dgr.Cells["ID1"].Value)) { MessageBox.Show("A project with same ID already exists."); return; } } clsProjects project = new clsProjects(); project.strProjectid = txtID.Text.Trim(); project.strProjectName = txtName.Text.Trim(); project.strPrefix = txtPrefix.Text.Trim(); project.strNumber = txtCurrentNumber.Text.Trim(); project.id = this.id; project.bSubProject = chkBoxSubProject.Checked; if (chkBoxSubProject.Checked == true) { if (cmbMainProject.Text == "") { MessageBox.Show("Select Main Project."); return; } if (cmbBlock.Text == "") { MessageBox.Show("Select Location."); cmbBlock.Focus(); return; } } project.strMainProjecID = cmbMainProject.Text; project.strLocation = cmbBlock.Text; bool result = da.AddProjectInfo(project); if (result == false) { MessageBox.Show("An error occurred."); return; } LoadProjects(); Clear(); }