本文整理汇总了C#中Organization_mst.Get_Organization方法的典型用法代码示例。如果您正苦于以下问题:C# Organization_mst.Get_Organization方法的具体用法?C# Organization_mst.Get_Organization怎么用?C# Organization_mst.Get_Organization使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Organization_mst
的用法示例。
在下文中一共展示了Organization_mst.Get_Organization方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnAdd_Click
protected void btnAdd_Click(object sender, EventArgs e)
{
#region Declaration of Local Variables
int siteid, priorityid;
int SLAid = 0;
int createdbyid = 0;
int requesterid = 0;
int FlagInsert;
int requesttypeid;
string userName;
bool FlagUserStatus;
FlagUserStatus = true;
FlagInsert = 0;
#endregion
#region Fetch Current User
MembershipUser User = Membership.GetUser();
userName = User.UserName.ToString();
#endregion
#region Get Current Site and Priority id
siteid = Convert.ToInt16(drpSite.SelectedValue);
priorityid = Convert.ToInt16(drpPriority.SelectedValue);
#endregion
#region Get SLAid on the basis of siteid and Priority id
if (siteid != 0 && priorityid != 0)
{
SLAid = objIncident.Get_By_SLAid(siteid, priorityid);
requesttypeid = Convert.ToInt16(Resources.MessageResource.strRequestTypeId.ToString());
if (requesttypeid == Convert.ToInt16(drpRequestType.SelectedValue))
{
SLAid = 0;
}
}
#endregion
if (userName != "")
{
#region Find Userid of User who Created this Request
objOrganization = objOrganization.Get_Organization();
objUser = objUser.Get_UserLogin_By_UserName(userName, objOrganization.Orgid);
if (objUser.Userid != 0)
{
createdbyid = objUser.Userid;
}
#endregion
#region Find Userid of User who is Requesting to log a call
#region If User Already Exist
if (Session["UserCreate"].ToString() == "Exist")
{
objUser = objUser.Get_UserLogin_By_UserName(txtUsername.Text.ToString().Trim(), objOrganization.Orgid);
if (objUser.Userid != 0)
{
requesterid = objUser.Userid;
}
}
#endregion
#region If New User is to be Created
else if (Session["UserCreate"].ToString() == "create")
{
string varEmail = "";
string varRoleName = Resources.MessageResource.BasicUserRole.ToString();
if (txtEmail.Text == "")
{
varEmail = Resources.MessageResource.errMemshipCreateUserEmail.ToString();
}
else
{
varEmail = txtEmail.Text;
}
int roleid = objRole.Get_By_RoleName(varRoleName);
int status;
objOrganization = objOrganization.Get_Organization();
UserLogin_mst objUserLogin = new UserLogin_mst();
objUserLogin.Username = txtUsername.Text.Trim().ToString();
objUserLogin.Password = Resources.MessageResource.strDefaultPassword.ToString();
objUserLogin.Roleid = roleid;
objUserLogin.Orgid = objOrganization.Orgid;
objUserLogin.ADEnable = false;
objUserLogin.Enable = true;
objUserLogin.Createdatetime = DateTime.Now.ToString();
status = objUserLogin.Insert();
if (status == 1)
{
// Create Mstatus field to send in Membership.CreateUser function as Out Variable for creating Membership User database
MembershipCreateStatus Mstatus = default(MembershipCreateStatus);
// Call Membership.CreateUser function to create Membership user
Membership.CreateUser(txtUsername.Text.ToString().Trim(), Resources.MessageResource.strDefaultPassword.ToString(), varEmail, "Project Name", "Helpdesk", true, out Mstatus);
// Call Roles.AddUserToRole Function to Add User To Role
Roles.AddUserToRole(txtUsername.Text.ToString().Trim(), varRoleName);
// Declare Local Variable Userid to fetch userid of newly created user
// Create Object objUserLogin of UserLogin_mst()Class
objUserLogin = new UserLogin_mst();
// Fetch userid of Newly created user and assign to local variable userid by calling function objUserLogin.Get_By_UserName
requesterid = objUserLogin.Get_By_UserName(txtUsername.Text.ToString().Trim(), objOrganization.Orgid);
// If userid not equal to 0 then we get userid of Newly created user otherwise error Occured
ContactInfo_mst objContactInfo = new ContactInfo_mst();
//.........这里部分代码省略.........
开发者ID:progressiveinfotech,项目名称:PRO_FY13_40_Helpdesk-Support-and-Customization_TerexBest,代码行数:101,代码来源:IncidentRequest.aspx.cs
示例2: btnAdd_Click
protected void btnAdd_Click(object sender, EventArgs e)
{
/////Add Exception handilng try catch change by vishal 21-05-2012
try
{
#region Declaration of Local Variables
int siteid, priorityid;
int SLAid = 0;
int createdbyid = 0;
int requesterid = 0;
int FlagInsert;
int requesttypeid;
string userName;
bool FlagUserStatus;
FlagUserStatus = true;
FlagInsert = 0;
#endregion
#region Fetch Current User
MembershipUser User = Membership.GetUser();
userName = User.UserName.ToString();
#endregion
#region Get Current Site and Priority id
siteid = Convert.ToInt32(drpSite.SelectedValue);
priorityid = Convert.ToInt32(drpPriority.SelectedValue);
#endregion
#region Get SLAid on the basis of siteid and Priority id
if (siteid != 0 && priorityid != 0)
{
SLAid = objIncident.Get_By_SLAid(siteid, priorityid);
requesttypeid = Convert.ToInt32(Resources.MessageResource.strRequestTypeId.ToString());
if (requesttypeid == Convert.ToInt32(drpRequestType.SelectedValue))
{
SLAid = 0;
}
}
#endregion
if (userName != "")
{
#region Find Userid of User who Created this Request
objOrganization = objOrganization.Get_Organization();
objUser = objUser.Get_UserLogin_By_UserName(userName, objOrganization.Orgid);
if (objUser.Userid != 0)
{
createdbyid = objUser.Userid;
}
#endregion
#region Find Userid of User who is Requesting to log a call
#region If User Already Exist
if (Session["UserCreate"].ToString() == "Exist")
{
objUser = objUser.Get_UserLogin_By_UserName_Ex(txtUsername.Text.ToString().Trim(), objOrganization.Orgid);
if (objUser.Userid != 0)
{
requesterid = objUser.Userid;
}
}
#endregion
#region If New User is to be Created
else if (Session["UserCreate"].ToString() == "create")
{
string varEmail = "";
string varRoleName = Resources.MessageResource.BasicUserRole.ToString();
if (txtEmail.Text == "")
{
varEmail = Resources.MessageResource.errMemshipCreateUserEmail.ToString();
}
else
{
varEmail = txtEmail.Text;
}
int roleid = objRole.Get_By_RoleName(varRoleName);
int status;
objOrganization = objOrganization.Get_Organization();
UserLogin_mst objUserLogin = new UserLogin_mst();
objUserLogin.Username = txtUsername.Text.ToString();
objUserLogin.Password = Resources.MessageResource.strDefaultPassword.ToString();
objUserLogin.Roleid = roleid;
objUserLogin.Orgid = objOrganization.Orgid;
objUserLogin.ADEnable = false;
objUserLogin.Enable = true;
objUserLogin.Createdatetime = DateTime.Now.ToString();
status = objUserLogin.Insert();
if (status == 1)
{
// Create Mstatus field to send in Membership.CreateUser function as Out Variable for creating Membership User database
MembershipCreateStatus Mstatus = default(MembershipCreateStatus);
// Call Membership.CreateUser function to create Membership user
Membership.CreateUser(txtUsername.Text.ToString().Trim(), Resources.MessageResource.strDefaultPassword.ToString(), varEmail, "Project Name", "Helpdesk", true, out Mstatus);
// Call Roles.AddUserToRole Function to Add User To Role
Roles.AddUserToRole(txtUsername.Text.ToString().Trim(), varRoleName);
// Declare Local Variable Userid to fetch userid of newly created user
//.........这里部分代码省略.........
开发者ID:progressiveinfotech,项目名称:PRO_FY13_40_Helpdesk-Support-and-Customization_HT,代码行数:101,代码来源:IncidentRequest.aspx.cs