static AccountExtansions() { _add = new RightAdd(); _delete = new RightDelete(); _admin = new RightAdmin(); _view = new RightView(); }
static void Main(string[] args) { { MovableObject obj = new MovableObject(); // left ILeft objLeft = obj; objLeft.Move(); // right IRight objRight = obj; objRight.Move(); } Console.WriteLine("-------------"); { // implementing both IMoving moving = new MovingObject(); //moving.Move(); // does not compile, ambiguous call // left ILeft movingLeft = moving; movingLeft.Move(); // right IRight movingRight = moving; movingRight.Move(); } Console.ReadKey(); }
static void Main(string[] args) { MovableObject obj = new MovableObject(); // left ILeft objLeft = obj; objLeft.Move(); // right IRight objRight = obj; objRight.Move(); // implementing both IMoving moving = new MovingObject(); // smoving.Move(); // does not compile, ambiguous call // left ILeft movingLeft = moving; movingLeft.Move(); // right IRight movingRight = moving; movingRight.Move(); }
public UserCommonController(IUser _userBL, IRole _roleBL, IPost _postBL, IRight _rightBL, IDepartment _deptBL) { userBL = _userBL; roleBL = _roleBL; postBL = _postBL; deptBL = _deptBL; rightBL = _rightBL; }
void cmdEdit_Click(object sender, EventArgs e) { IRight ir = (IRight)iapplication.GetService(typeof(IRight)); FormBuyApplay FBA = new FormBuyApplay(iapplication, idataservice, GetPlugQueryCmdInfo()); FBA.RegStatickElement("F_CREATEUSER", System.Data.SqlDbType.Int, ir.UserId); FBA.RegStatickElement("F_CREATEAGENCY", System.Data.SqlDbType.Int, ir.AgencyId); FBA.ShowForm(FormType.Edit); }
void cmdAdd_Click(object sender, EventArgs e) { FormCreateOrder FCO = new FormCreateOrder(iapplication, idataservice); IRight ir = (IRight)iapplication.GetService(typeof(IRight)); FCO.RegStatickElement("F_APPLAYUSER", System.Data.SqlDbType.Int, ir.UserId);//谁负责咨询,采购下单由谁负责; // FCO.RegStatickElement("F_CREATENAME", System.Data.SqlDbType.VarChar, ir.UserName); // FCO.RegStatickElement("F_CREATEAGENCY", System.Data.SqlDbType.VarChar, ir.AgencyName); FCO.ShowForm(FormType.Edit); }
public UserManageController(IUser _userBL, IRole _roleBL, IPost _postBL, IRight _rightBL, IDepartment _deptBL, ITr_MonthPlan _Imonth, ITr_YearPlan _Iyear, ICl_Attendce _iattendce) { userBL = _userBL; roleBL = _roleBL; postBL = _postBL; deptBL = _deptBL; rightBL = _rightBL; Imonth = _Imonth; Iyear = _Iyear; iattendce = _iattendce; }
public override void AfterShowForm() { IRight ir = (IRight)iapplication.GetService(typeof(IRight)); myUserName.FieldValue = ir.UserName; myAgencyName.FieldValue = ir.AgencyName; if (FType == FormType.Insert) { myOrderNumber.FieldValue = "SQ" + ir.UserId + DateTime.Now.ToString("yyMMddhhmmss"); } myState.ShowFieldValue = "0"; base.AfterShowForm(); }
void cmdAdd_Click(object sender, EventArgs e) { IRight ir = (IRight)iapplication.GetService(typeof(IRight)); FormBuyApplay FBA = new FormBuyApplay(iapplication, idataservice, GetPlugQueryCmdInfo()); FBA.RegStatickElement("F_CREATEUSER", System.Data.SqlDbType.Int, ir.UserId); FBA.RegStatickElement("F_CREATEAGENCY", System.Data.SqlDbType.Int, ir.AgencyId); FBA.ShowForm(FormType.Insert); // FormCreateOrder FCO = new FormCreateOrder(iapplication,idataservice,GetPlugQueryCmdInfo()); // // //// FCO.RegStatickElement("F_CREATENAME", System.Data.SqlDbType.VarChar, ir.UserName); //// FCO.RegStatickElement("F_CREATEAGENCY", System.Data.SqlDbType.VarChar, ir.AgencyName); // FCO.ShowForm(FormType.Insert); }
public override void AfterShowForm() { IRight ir = (IRight)iapplication.GetService(typeof(IRight)); textBox1.Text = ir.UserName; textBox2.Text = ir.AgencyName; myOrderNumber.FieldValue = "CG" + ir.UserId + DateTime.Now.ToString("yyMMddhhmmss"); myEditTreeView1.MyItemCheck += new EventHandler(myEditTreeView1_MyItemCheck); listView1.Columns.Add("商品ID", 60, HorizontalAlignment.Left); listView1.Columns.Add("商品编码", 60, HorizontalAlignment.Left); listView1.Columns.Add("商品名称", 60, HorizontalAlignment.Left); listView1.Columns.Add("采购数量", 60, HorizontalAlignment.Left); listView1.Columns.Add("单位", 60, HorizontalAlignment.Left); listView1.Columns.Add("商品单价", 60, HorizontalAlignment.Left); listView1.Columns.Add("小计金额", 60, HorizontalAlignment.Left); base.AfterShowForm(); }
public WebAppSPGlymaSession(string callingUrl, Guid sessionId, bool isParameter, MapParameter domainParameter, MapParameter rootMapParameter, params IRight[] requiredRights) { _callingUrl = callingUrl; _sessionId = sessionId; IRight[] heightenedRightRequirement = requiredRights; Guid?domainId = null; Guid?rootMapId = null; if (rootMapParameter == null || rootMapParameter.IsDelayed) { /// If they passed through a delayed rootmap ID parameter, they are going to have to be a Glyma Map Manager at the very minimum to finish this transaction. heightenedRightRequirement = new IRight[] { SPGlymaRightFactory.Instance.RootMapCreateRight }; } else { rootMapId = rootMapParameter.Value; } if (domainParameter == null || domainParameter.IsDelayed) { /// If they passed through a delayed domain ID parameter, they are going to have to be a Glyma Project Manager at the very minimum to finish this transaction. heightenedRightRequirement = new IRight[] { SPGlymaRightFactory.Instance.ProjectCreateRight }; } else { domainId = domainParameter.Value; } if (!IsAuthorised(domainId, rootMapId, heightenedRightRequirement)) { throw new UnauthorizedAccessException("This user does not have the required privileges for this task."); } _session = new MapSession(this, _sessionId); _parameters = new MapParameters(this); }
public WebAppSPGlymaSession(string callingUrl, Guid sessionId, bool isParameter, MapParameter domainParameter, MapParameter rootMapParameter, params IRight[] requiredRights) { _callingUrl = callingUrl; _sessionId = sessionId; IRight[] heightenedRightRequirement = requiredRights; Guid? domainId = null; Guid? rootMapId = null; if (rootMapParameter == null || rootMapParameter.IsDelayed) { /// If they passed through a delayed rootmap ID parameter, they are going to have to be a Glyma Map Manager at the very minimum to finish this transaction. heightenedRightRequirement = new IRight[] { SPGlymaRightFactory.Instance.RootMapCreateRight }; } else { rootMapId = rootMapParameter.Value; } if (domainParameter == null || domainParameter.IsDelayed) { /// If they passed through a delayed domain ID parameter, they are going to have to be a Glyma Project Manager at the very minimum to finish this transaction. heightenedRightRequirement = new IRight[] { SPGlymaRightFactory.Instance.ProjectCreateRight }; } else { domainId = domainParameter.Value; } if (!IsAuthorised(domainId, rootMapId, heightenedRightRequirement)) { throw new UnauthorizedAccessException("This user does not have the required privileges for this task."); } _session = new MapSession(this, _sessionId); _parameters = new MapParameters(this); }
public override void AfterShowForm() { IRight ir = (IRight)iapplication.GetService(typeof(IRight)); //myOrderNumber.FieldValue = "CG" + ir.UserId + DateTime.Now.ToString("yyMMddhhmmss"); myEditTreeView1.MyItemCheck += new EventHandler(myEditTreeView1_MyItemCheck); listView1.Columns.Add("商品ID", 60, HorizontalAlignment.Left); listView1.Columns.Add("商品编码", 60, HorizontalAlignment.Left); listView1.Columns.Add("商品名称", 60, HorizontalAlignment.Left); listView1.Columns.Add("采购数量", 60, HorizontalAlignment.Left); listView1.Columns.Add("单位", 60, HorizontalAlignment.Left); listView1.Columns.Add("商品单价", 60, HorizontalAlignment.Left); listView1.Columns.Add("小计金额", 60, HorizontalAlignment.Left); MyRealAmount.FieldValue = "0.0"; string sql = "select * from ck_buyorderdetail where f_purchasno ='" + MyOrderNumber.FieldValue.ToString() + "'"; IAdapter iadp = (IAdapter)iapplication.GetService(typeof(IAdapter)); DataTable dt = (DataTable)iadp.RunCmdnoCheck("AFunction2", new object[] { sql }); if (dt != null && dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { ListViewItem item = new ListViewItem(dr["f_productid"].ToString()); item.SubItems.Add(dr["F_CODE"].ToString()); item.SubItems.Add(dr["f_product"].ToString()); item.SubItems.Add(dr["f_count"].ToString()); item.SubItems.Add(dr["f_unit"].ToString()); item.SubItems.Add(dr["f_unitprice"].ToString()); item.SubItems.Add((Convert.ToInt32(dr["f_count"].ToString()) * float.Parse(dr["f_unitprice"].ToString())).ToString()); item.Tag = dr["f_id"].ToString(); listView1.Items.Add(item); MyRealAmount.FieldValue = (float.Parse(MyRealAmount.FieldValue.ToString()) + Convert.ToInt32(dr["f_count"].ToString()) * float.Parse(dr["f_unitprice"].ToString())).ToString(); } } base.AfterShowForm(); }
public LoginController(IUser _userBL, IRight _rightBL, ISys_Log _logBL) { userBL = _userBL; rightBL = _rightBL; logBL = _logBL; }
public SlotCounter(IRight right) { _right = right; }